X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Top_menu.tpl what is wrong with my code? Why can't I get a logout link tab? (https://forum.x-cart.com/showthread.php?t=40896)

loopsound 07-03-2008 12:01 PM

Top_menu.tpl what is wrong with my code? Why can't I get a logout link tab?
 
Calling all the X-Cart experts!!! I have been trying to modify top_menu.tpl so that the speed bar displays and next to it a changing login/out link appears

Can someone please tell me what is wrong with the below code. I've been trying to get a link on my logout tab for hours and I think I may cry if I don't solve it. The logout title displays fine but the link does not work?

You would make a very frustrated person very happy if you can help me!

Quote:

{if $printable ne ''}
{include file="customer/top_menu_printable.tpl"}
{else}
<table cellpadding="0" cellspacing="0" width="100%">
{if $speed_bar}
<tr>
<td align="right">
<table cellpadding="0" cellspacing="0">
<tr>
{section name=sb loop=$speed_bar}
{if $speed_bar[sb].active eq "Y"}
<td>{include file="customer/tab.tpl" tab_title="<a href=\"`$speed_bar[sb].link`\">`$speed_bar[sb].title`</a>"}</td>
{/if}
{/section}
{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}
{*<td valign="center" width="50">{include file="customer/top_menu_mod.tpl}</td>*}
</tr>
</table>
</td>
</tr>
{/if}
<tr>
<td height="35" align="center" class="HeadText">
{if $config.Company.company_phone}{$lng.lbl_phone_1_ti tle}: {$config.Company.company_phone}{/if}{if $config.Company.company_phone_2}&nbsp;&nbsp;&nbsp; {$lng.lbl_phone_2_title}: {$config.Company.company_phone_2}{/if}&nbsp;&nbsp;</td>
</tr>
</table>
{/if}


JWait 07-06-2008 06:02 AM

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.


All times are GMT -8. The time now is 11:20 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.