View Single Post
  #2  
Old 07-06-2008, 06:02 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: Top_menu.tpl what is wrong with my code? Why can't I get a logout link tab?

Umm.. are you trying to make "logout" one of your "tabs" because that is what it looks like?

By default "login" will display "logout" once a user is logged in.

Try changing..
Code:
{if $login ne ""} <td>{include file="customer/tab.tpl" tab_title="<a href="include/login.php?mode=logout">$lng.lbl_log_out</a>"}</td> {else} <td valign="top"><a href="help.php?section=login" class="Tab">{$lng.lbl_log_in}</a></td>{/if}
to
Code:
<td class="Tab">{if $login eq "" }{ include file="auth.tpl" } {else}{ include file="authbox.tpl" }{/if} </td>

You will probably need to modify auth.tpl and authbox.tpl to suit your purposes, maybe even making a duplicate, calling them mod-auth.tpl and mod-authbox.tpl or whatever format you use for modified templates.

The reason you are not getting the desired response is that you are not getting the input to the proper form. You are calling include/login.php without including
Code:
<form action="{$xcart_web_dir}/include/login.php" method="post" name="loginform">
and
Code:
<input type="hidden" name="mode" value="logout" /> <input type="hidden" name="redirect" value="{$redirect}" />

Anyway, look at auth.tplo and authbox.tpl and you should find what you need.
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote