Support Forums

Old 03-05-2008, 04:54 PM   #1
Member
 
Join Date: Nov 2007
Location: Metro Detroit
Posts: 59
Rep Power: 9
LittleRascal is on a distinguished road
Default if/else statement for Guest viewer

I am looking to see if anybody has developed if/else statement for a telling a guest that they need to login in, in order to view the seller details? Could anybody point me onto that direction?

Thanks, Dave
__________________
David Anthony Schnoblen
uSelliBuy.com
My Email
v 4.1.3 Developer
Templates: Default 3 Col
LittleRascal is offline   Reply With Quote
Old 03-05-2008, 05:12 PM   #2
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,118
Rep Power: 118
Eric Barnes is a jewel in the rough
Default

This if statement is in the layout template file.

Code:
{if $smarty.session.username<>'' || $smarty.cookies.username<>""}
You are logged in
{else}
You are a guest
{/if}
__________________
Eric Barnes
68 Classifieds Developer
Please do not send me a private message asking for support. Instead use these open forums or our ticket system.

Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 03-05-2008, 06:36 PM   #3
Member
 
Join Date: Nov 2007
Location: Metro Detroit
Posts: 59
Rep Power: 9
LittleRascal is on a distinguished road
Default Tell a guest they need to log in to view seller details

would this code go in viewlisting.tpl.php...I want to tell a seller they need to login to contact the owner...
__________________
David Anthony Schnoblen
uSelliBuy.com
My Email
v 4.1.3 Developer
Templates: Default 3 Col
LittleRascal is offline   Reply With Quote
Old 03-05-2008, 07:33 PM   #4
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,624
Rep Power: 47
Mike-N-Tosh is just really niceMike-N-Tosh is just really nice
Default

Quote:
Originally Posted by LittleRascal View Post
would this code go in viewlisting.tpl.php...I want to tell a seller they need to login to contact the owner...
I think you mean you want to tell a buyer (guest) they need to login to contact the owner. Yes?

I thought so.

Here's what I do for my site:
In my showlistings templates I use the following code around line 20 just above this...
{* This section shows the listings in categories, search results, and user store *}
PHP Code:
{if $smarty.session.userlevel==5}
    <
table width="80%" align="center">
        <
tr>
            <
td>Welcome GuestAlthough you can browse all of our listings,<br>
            
You must be registered and <strong>logged in</strongto<br>
            
see the seller information or contact the seller.</td>
        </
tr>
    </
table>
{/if} 
Then in my viewlistings templates I have this code around line 50 in it's own <tr><td> after the contacts phone info code.
PHP Code:
{if $smarty.session.userlevel==5}
<
tr>
   <
td>You must be logged in to see the seller or contact the seller</td>
</
tr>
{/if} 
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.3)
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
Mike-N-Tosh is offline   Reply With Quote
Old 03-05-2008, 11:05 PM   #5
Coder
 
Join Date: Mar 2006
Posts: 4,564
Rep Power: 111
Lhotch is just really niceLhotch is just really nice
Default

Quote:
Originally Posted by LittleRascal View Post
would this code go in viewlisting.tpl.php...I want to tell a seller they need to login to contact the owner...
Why dont you just edit the user group so that guests (ie those not logged in) cant contact the seller? Or am I missing something?
__________________
Larry.
Lhotch 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
Need help with an if/else statement on links. michael HTML, CSS, and Design Help 14 09-24-2007 10:00 AM
If statement in meta tag Title SkGold v3.1 Modules & Modifications 2 04-12-2007 12:36 AM


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


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