Support Forums

Adding IF Statement

This is a discussion on Adding IF Statement within the v3.1 Modules & Modifications forums, part of the Legacy Help & Support category; I would like to add the following IF statement in the viewlisting.tpl.php file. I want this to ONLY show if ...


Go Back   68 Classifieds Forums > Archives > Legacy Help & Support > v3.1 Modules & Modifications

 
 
Thread Tools Display Modes
Old 11-04-2007, 01:13 AM   #1
Member
 
 
Join Date: Feb 2007
Location: Ohio
Posts: 56
Rep Power: 13
VanWertAds*com is on a distinguished road
Arrow Adding IF Statement

I would like to add the following IF statement in the viewlisting.tpl.php file. I want this to ONLY show if a member is NOT logged In. (guest & awaiting email confirmation)

Could someone show me how to make this work? Please

Here is the text I want to show up:

PLEASE NOTE: In an effort to protect our members, you must be registered and logged in to view sellers contact info.

Thanks,
Josh
__________________
V3.1.5b Hosted
vanwertads*.com

"Do unto others as you would expect others to do unto you"
VanWertAds*com is offline  
Old 11-04-2007, 11:36 AM   #2
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,712
Rep Power: 50
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

This is what I use:
PHP Code:
    {if $smarty.session.userlevel==5}
    <
tr>
        <
td>In an effort to protect our membersyou must be registered and logged in to view sellers contact info.</td>
    </
tr>
    {/if} 
The userlevel==5 is for a guest not logged in.

Hope that helps!

-Mike
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified)
Sandbox (v3.1.10, v4.0.9, 4.1.5)
Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out

Last edited by Mike-N-Tosh; 11-04-2007 at 11:39 AM.
Mike-N-Tosh is offline  
Old 11-04-2007, 11:38 AM   #3
Coder
 
Join Date: Mar 2006
Posts: 4,680
Rep Power: 114
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

If you take a quick peek at the layout.tlp.php template where you know that only certain nav options are displayed when logged in you can see an example of what to use and modify it to suite your needs.

example...
Quote:
{if $smarty.session.username=='' || $smarty.cookies.username==<>""}
PLEASE NOTE: In an effort to protect our members, you must be registered and logged in to view sellers contact info.
{/if}
__________________
Larry

What I post here should be used only as a guide to point you in the right direction. If the code I post doesnt make any sense or work as posted then you should spend more time reading the various manuals and tutorials so it does make sense and you can tweak it to work. A sure fire way to get yourself in trouble is to implement changes you dont have an intimate understanding of. Im happy to help, but I am not here to teach you to code or create your site for you.
Lhotch is offline  
Old 11-04-2007, 11:42 AM   #4
Member
 
 
Join Date: Feb 2007
Location: Ohio
Posts: 56
Rep Power: 13
VanWertAds*com is on a distinguished road
Default

Thanks for the help!
__________________
V3.1.5b Hosted
vanwertads*.com

"Do unto others as you would expect others to do unto you"
VanWertAds*com is offline  
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
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
Adding Internal Navigation Menu sleepy Templates, HTML, CSS, and Design Help 1 04-13-2006 10:12 AM


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


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