Support Forums

Need a bit of help with an if/else statement.

This is a discussion on Need a bit of help with an if/else statement. within the Templates, HTML, CSS, and Design Help forums, part of the General category; I'm successfully using {include file="elements/quicklogin.tpl} in my sidebar but I want the blue login header to disappear once the member ...


Go Back   68 Classifieds Forums > General > Templates, HTML, CSS, and Design Help

Reply
 
Thread Tools Display Modes
Old 10-09-2008, 09:25 AM   #1
Just get on with it!
 
michael's Avatar
 
Join Date: Jan 2007
Location: Milton Keynes, England
Posts: 474
Rep Power: 31
michael is just really nice michael is just really nice
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
__________________
M Michael
V4.2.1 Developer - Sigma Template


"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, 09:31 AM   #2
Staff
 
Join Date: Mar 2006
Location: New Jersey
Posts: 2,041
Rep Power: 64
John Snyder 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}
__________________
John
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
John Snyder is offline   Reply With Quote
Old 10-09-2008, 09:35 AM   #3
Just get on with it!
 
michael's Avatar
 
Join Date: Jan 2007
Location: Milton Keynes, England
Posts: 474
Rep Power: 31
michael is just really nice michael is just really nice
Default

Sorry John but the header still remains and with the text 'no login conent' beneath it.
__________________
M Michael
V4.2.1 Developer - Sigma Template


"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, 09:40 AM   #4
Just get on with it!
 
michael's Avatar
 
Join Date: Jan 2007
Location: Milton Keynes, England
Posts: 474
Rep Power: 31
michael is just really nice michael is just really nice
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 -->
__________________
M Michael
V4.2.1 Developer - Sigma Template


"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, 09:54 AM   #5
Staff
 
Join Date: Mar 2006
Location: New Jersey
Posts: 2,041
Rep Power: 64
John Snyder 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.
__________________
John
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
John Snyder is offline   Reply With Quote
Old 10-09-2008, 03:25 PM   #6
Just get on with it!
 
michael's Avatar
 
Join Date: Jan 2007
Location: Milton Keynes, England
Posts: 474
Rep Power: 31
michael is just really nice michael is just really nice
Default

Perfect! Thanks very much John, I appreciate your help.
__________________
M Michael
V4.2.1 Developer - Sigma Template


"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
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with an if/else statement on links. michael Templates, HTML, CSS, and Design Help 14 09-24-2007 10:00 AM


All times are GMT -4. The time now is 12:01 AM.


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