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

Hide if logged or not logged in

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-04-2004, 01:39 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default Hide if logged or not logged in

Ok it's my turn to answer a question today

im trying to hide or show certain tabs depending on if the user is logged in or not logged in.

for example I have 4 tabs in the template "LOGIN / REGISTER, YOUR ACCOUNT, RECOVER PASSWORD & ORDER HISTORY"

if not logged in only "LOGIN / REGISTER" & " RECOVER PASSWORD" should be shown if LOGGED IN only "YOUR ACCOUNT" & "ORDER HISTORY" should be shown.

i've managed to hide the tabs I want to hide when logged in but I cant work out how to hide the tabs when NOT logged in

this is the code i've got so far

Code:
<table class"HeadLine" border="0" cellspacing="0" cellpadding="0"> <tr> {if $login eq ""} <td>[img]{$ImagesDir}/accountnavlcorner.gif[/img]</td> <td bgcolor="#000000"><span class="TopBannerItems">{$lng.lbl_your_profile}</span></td> <td>[img]{$ImagesDir}/accountnavrcorner.gif[/img]</td> <td>[img]{$ImagesDir}/spacer.gif[/img]</td> <td>[img]{$ImagesDir}/accountnavlcorner.gif[/img]</td> <td bgcolor="#000000"><span class="TopBannerItems">{$lng.lbl_recover_password}</span></td> <td>[img]{$ImagesDir}/accountnavrcorner.gif[/img]</td> <td>[img]{$ImagesDir}/spacer.gif[/img]</td> {/if} {if $usertype eq "C"} <td>[img]{$ImagesDir}/accountnavlcorner.gif[/img]</td> <td bgcolor="#000000"><span class="TopBannerItems">{$lng.lbl_orders_history}</span></td> <td>[img]{$ImagesDir}/accountnavrcorner.gif[/img]</td> <td>[img]{$ImagesDir}/spacer.gif[/img]</td> {/if} <td></td> </tr> </table>

i know it's something simple i've missed but the question is what???

Cheers for any help

THIS IS FOR VERSION 4.0.3
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #2  
Old 10-04-2004, 03:43 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

you probably want to use

{if $login ne ""}

eq - equals
ne - not equals

see http://smarty.php.net for all this and more
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 10-04-2004, 05:24 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

Bingo!!!

Cheers Shan, on another note how is your diary fixed for some mods i need doing.

i'll email you the full specs of what im trying to do.
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #4  
Old 06-06-2008, 06:49 AM
 
TL408 TL408 is offline
 

X-Adept
  
Join Date: Jan 2005
Posts: 549
 

Default Re: Hide if logged or not logged in

Hi COTC2001,

Do you know if your code below would work on the 4.1.9 version?

Thanks!


Quote:
Originally Posted by cotc2001
Ok it's my turn to answer a question today

im trying to hide or show certain tabs depending on if the user is logged in or not logged in.

for example I have 4 tabs in the template "LOGIN / REGISTER, YOUR ACCOUNT, RECOVER PASSWORD & ORDER HISTORY"

if not logged in only "LOGIN / REGISTER" & " RECOVER PASSWORD" should be shown if LOGGED IN only "YOUR ACCOUNT" & "ORDER HISTORY" should be shown.

i've managed to hide the tabs I want to hide when logged in but I cant work out how to hide the tabs when NOT logged in

this is the code i've got so far

Code:
<table class"HeadLine" border="0" cellspacing="0" cellpadding="0"> <tr> {if $login eq ""} <td>[img]{$ImagesDir}/accountnavlcorner.gif[/img]</td> <td bgcolor="#000000"><span class="TopBannerItems">{$lng.lbl_your_profile}</span></td> <td>[img]{$ImagesDir}/accountnavrcorner.gif[/img]</td> <td>[img]{$ImagesDir}/spacer.gif[/img]</td> <td>[img]{$ImagesDir}/accountnavlcorner.gif[/img]</td> <td bgcolor="#000000"><span class="TopBannerItems">{$lng.lbl_recover_password}</span></td> <td>[img]{$ImagesDir}/accountnavrcorner.gif[/img]</td> <td>[img]{$ImagesDir}/spacer.gif[/img]</td> {/if} {if $usertype eq "C"} <td>[img]{$ImagesDir}/accountnavlcorner.gif[/img]</td> <td bgcolor="#000000"><span class="TopBannerItems">{$lng.lbl_orders_history}</span></td> <td>[img]{$ImagesDir}/accountnavrcorner.gif[/img]</td> <td>[img]{$ImagesDir}/spacer.gif[/img]</td> {/if} <td></td> </tr> </table>

i know it's something simple i've missed but the question is what???

Cheers for any help

THIS IS FOR VERSION 4.0.3
__________________
Win2003 IIS6, PHP 5.2.3, MySQL 5.0.45 and X-Cart 4.1.9
Reply With Quote
  #5  
Old 06-06-2008, 11:40 PM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default Re: Hide if logged or not logged in

Cant tell for certain but it should do
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 05:54 AM.

   

 
X-Cart forums © 2001-2020