Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

add log out (an extra one) to upper right of screen

   X-Cart forums > X-Cart 4 > Changing and adding new features
Thread Tools Search this Thread
Old 11-21-2007, 09:28 PM
chippiesavalanche chippiesavalanche is offline

Join Date: Oct 2007
Location: Denver
Posts: 15

Default add log out (an extra one) to upper right of screen

ok, for most websites, the log out is in the upper right.
(at least that is where i look first.) but in any case. i wanted to add a log out button in the upper right of most screens.

in looking for this, i came across someone who wanted to kill his original auth box and put log in and log out buttons there in the upper right.

his biggest problem was that he couldnt get the stuff to go to the right.

well i have solved that problem. took about an hour of playing and research, but it will serve me well.

i have also made the appearance of the log out stuff conditional on there being someone logged in.

this may appear long, but in actuality, its a small amount of changes and code.


what: if logged in, put log out button in upper right in search bar
file: /customer/search.tpl
how: modify some existing code and add some code.

step 1: we need to add another table data element and have it space all the way to the right. to do this, the first
four table data must have a defined width percentage to help with the overall spacing. the 4th table data is set to 15% so
that "advanced search" wont word wrap.
the 5th table data is where the log out stuff goes. inside the 5th table data,
is an IF statement,that way, the log out button stuff only shows if there is actually someone logged in.
otherwise, it wont show anything and the search stuff still hangs over to the left where it belongs.

look for: <td class="TopLabel" style="padding-left: 20px add: width="5%": should now look like: <td width="5%": class="TopLabel" style="padding-left: look for: <td valign="middle"><input type="text" add: width="5%": should now look like: <td width="5%": valign="middle"><input type="text" look for: <td valign="middle" style="padding-left: 5px; add: width="5%": should now look like: <td width="5%": valign="middle" style="padding-left: 5px; look for: <td><a href="search.php"><u>{$lng. add: width="15%": should now look like: <td width="15%"><a href="search.php"><u>{$lng. :::: step 2: ok here is where we add the 5th table data section. look for: advanced_search}</u></a></td> hit enter, we are adding another <td> here. paste this code: <td width="35%" align="right"> {if $login} <form action="{$xcart_web_dir}/include/login.php" method="post" name="loginform"> <div class="AuthText">{$login} {$lng.txt_logged_in}</div> {include file="buttons/button.tpl" button_title=$lng.lbl_logoff href="javascript: document.loginform.submit();" js_to_href="Y" type="input"} <input type="hidden" name="mode" value="logout" /> <input type="hidden" name="redirect" value="{$redirect|escape}" /> </form> {/if} </td> :::: just to make sure, right after pasting the above code, you should have the following at the bottom of the file right after the pasted code. </tr> </table> </form> if you want to remove the "x" is logged in ! stuff, then remove this line... <div class="AuthText">{$login} {$lng.txt_logged_in}</div>

hope this helps someone.

X-Cart DB Version: 4.3.1 GOLD
hosted by
Reply With Quote

The following user thanks chippiesavalanche for this useful post:
alw_23 (05-27-2009)
   X-Cart forums > X-Cart 4 > Changing and adding new features

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT -8. The time now is 06:14 AM.


X-Cart forums © 2001-2020