Support Forums

Old 10-09-2008, 10:25 AM   #1
Senior Member
 
 
Join Date: Jan 2007
Posts: 260
Rep Power: 14
michael is on a distinguished road
Default Need a bit of help with an if/else statement.

I'm successfully using {include file="elements/quicklogin.tpl} in my sidebar but I want the blue login header to disappear once the member has logged in.

See what I mean at mkclassifieds.co.uk

Username: demo
Password: demo
__________________
v4.09 Developer
MKClassifieds


"All truths are easy to understand once they are discovered; the point is to discover them" - Galileo Galilei (1564 - 1642)
michael is offline   Reply With Quote
Old 10-09-2008, 10:31 AM   #2
Moderator
 
 
Join Date: Mar 2006
Location: NJ/NYC Area
Posts: 2,149
Rep Power: 57
juven14 is a jewel in the rough
Default

{if $smarty.session.username<>'' || $smarty.cookies.username<>""}
no login conent
{else}
...include the file as you have been doing
{/if}
__________________
Regards,

John



�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
juven14 is offline   Reply With Quote
Old 10-09-2008, 10:35 AM   #3
Senior Member
 
 
Join Date: Jan 2007
Posts: 260
Rep Power: 14
michael is on a distinguished road
Default

Sorry John but the header still remains and with the text 'no login conent' beneath it.
__________________
v4.09 Developer
MKClassifieds


"All truths are easy to understand once they are discovered; the point is to discover them" - Galileo Galilei (1564 - 1642)
michael is offline   Reply With Quote
Old 10-09-2008, 10:40 AM   #4
Senior Member
 
 
Join Date: Jan 2007
Posts: 260
Rep Power: 14
michael is on a distinguished road
Default

Here's my sidebar code if it helps . . .

Code:
<!-- start sidebar -->
    <div id="sidebar">
                <h2>Search</h2>
<br><div valign=centre>{include file="elements/quicksearch.tpl}</div>
<br>
                <h2>Login</h2>
<div valign=centre>{include file="elements/quicklogin.tpl}</div>
        <ul>
{if $smarty.session.username<>'' || $smarty.cookies.username<>""}
            <li>
                <h2>Members Menu</h2>
                <ul>
        <li><a href="http://www.mkclassifieds.co.uk/userindex.php">My Account</a></li>
        <li><a href="http://www.mkclassifieds.co.uk/userfavorites.php">My Favourites</a></li>
        <li><a href="http://www.mkclassifieds.co.uk/usercheckout.php">Place An Ad'</a></li>
        <li><a href="http://www.mkclassifieds.co.uk/userbrowselistings.php">Modify An Ad'</a></li>
        <li><a href="http://www.mkclassifieds.co.uk/logout.php">Logout</a></li>
        <li><a href="modules.php?mod=seller_store">My Store</a></li>
                </ul>
            </li>
                {/if}
            <li>
                <h2>Categories</h2>
{categories_parent}
<ul>
{foreach from=$pcat item=entry}
<li>{$entry.link}</li>
{/foreach}
</ul>
                <h2>Featured Ads</h2>
<br>
{feature_listings_horizontal number=10 cols=1 table_attr='width="100%" cellpadding="14" cellspacing="0"' td_attr='valign="middle" align="center"' style="border-top: 0px dashed #999;"'}
            <ul>
    </div>
    <!-- end sidebar -->
__________________
v4.09 Developer
MKClassifieds


"All truths are easy to understand once they are discovered; the point is to discover them" - Galileo Galilei (1564 - 1642)
michael is offline   Reply With Quote
Old 10-09-2008, 10:54 AM   #5
Moderator
 
 
Join Date: Mar 2006
Location: NJ/NYC Area
Posts: 2,149
Rep Power: 57
juven14 is a jewel in the rough
Default

HTML Code:
{if !$smarty.session.username && !$smarty.cookies.username}
	<h2>Login</h2>
	<div valign="center">{include file="elements/quicklogin.tpl}</div>
{/if}
I'm not sure if cookie and username variables are unset or empty though when not logged in or after logout. Give it a shot, if it works let me know.
__________________
Regards,

John



�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
juven14 is offline   Reply With Quote
Old 10-09-2008, 04:25 PM   #6
Senior Member
 
 
Join Date: Jan 2007
Posts: 260
Rep Power: 14
michael is on a distinguished road
Default

Perfect! Thanks very much John, I appreciate your help.
__________________
v4.09 Developer
MKClassifieds


"All truths are easy to understand once they are discovered; the point is to discover them" - Galileo Galilei (1564 - 1642)
michael is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding IF Statement VanWertAds*com v3.1 Modules & Modifications 3 11-04-2007 11:42 AM
Need help with an if/else statement on links. michael HTML, CSS, and Design Help 14 09-24-2007 11:00 AM
if statement broke ? free2take v3.1 Questions & Support 3 08-24-2007 04:41 AM
If statement in meta tag Title SkGold v3.1 Modules & Modifications 2 04-12-2007 01:36 AM
thumbnail statement. wel-usa v3.1 Questions & Support 9 07-15-2006 01:35 PM


All times are GMT -4. The time now is 11:57 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0