Support Forums


Go Back   68 Classifieds Forums > Help & Support > v4 Questions & Support

 
LinkBack Thread Tools Display Modes
Old 01-14-2009, 09:46 AM   #1
Junior Member
 
Join Date: Jun 2008
Posts: 17
Rep Power: 4
dexignz is on a distinguished road
Default Can you limit guest access on viewlisting.php

Is there a way that I can prevent guest from viewing the actually detailed ad page? I know how to prevent guests from searching by adding the following code.

{if $smarty.session.userlevel != 5}
<a href="linkgoeshere">Link</a>
{/if}

However, I want guest to get a prompt to register if they try to go to the viewlisting.php page.

I see there is an option to ban guests from viewing the whole site, but that restricts too much, I just want to limit access to the members ad. Is this possible?
__________________
v4.0.8 Developer
Ebony Honeys | Adult Classifieds
dexignz is offline   Reply With Quote
Old 01-14-2009, 09:49 AM   #2
Moderator
 
 
Join Date: Mar 2006
Posts: 3,989
Rep Power: 97
Lhotch is just really niceLhotch is just really nice
Default

I havent tested this, but you should be able to use the same logic you have in your post and apply it to the whole viewlisting.tpl template.

Basically at the top of the template put your {if $smarty.session.userlevel != 5} and then at the bottom of the template place {else} and then after the else tag add some text to let the visitor know they need to log in to see the ad and then after that add the closing {/if} tag.
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

Set your site apart from the competition with one of my modules......
Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Lhotch is offline   Reply With Quote
Old 01-14-2009, 08:19 PM   #3
Junior Member
 
Join Date: Jun 2008
Posts: 17
Rep Power: 4
dexignz is on a distinguished road
Default Guest Access Notice Message

Thanks, your suggestion worked. The only thing I need to figure out now is how to add a little message saying "Guest Access Restricted, Please register to view listing". Currently it just shows a blank white page. I want to setup a small notice on the page similar to how the banned members error message on a page is setup. I was unable to find where to add the message. Any suggestions?

I already tried to add it directly under the code but it didn't work.
{if $smarty.session.userlevel != 5}
My Error message
{/if}


Quote:
Originally Posted by Lhotch View Post
I havent tested this, but you should be able to use the same logic you have in your post and apply it to the whole viewlisting.tpl template.

Basically at the top of the template put your {if $smarty.session.userlevel != 5} and then at the bottom of the template place {else} and then after the else tag add some text to let the visitor know they need to log in to see the ad and then after that add the closing {/if} tag.
__________________
v4.0.8 Developer
Ebony Honeys | Adult Classifieds
dexignz is offline   Reply With Quote
Old 01-14-2009, 08:27 PM   #4
Moderator
 
 
Join Date: Mar 2006
Posts: 3,989
Rep Power: 97
Lhotch is just really niceLhotch is just really nice
Default

Quote:
Originally Posted by dexignz View Post
Thanks, your suggestion worked. The only thing I need to figure out now is how to add a little message saying "Guest Access Restricted, Please register to view listing". Currently it just shows a blank white page. I want to setup a small notice on the page similar to how the banned members error message on a page is setup. I was unable to find where to add the message. Any suggestions?

I already tried to add it directly under the code but it didn't work.
{if $smarty.session.userlevel != 5}
My Error message
{/if}
As I already mentioned, you need to use an {else} in there.......ie

{if $smarty.session.userlevel != 5}
contents of original template here
{else}
my message here
{/if}
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

Set your site apart from the competition with one of my modules......
Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Lhotch is offline   Reply With Quote
Old 01-14-2009, 08:52 PM   #5
Junior Member
 
Join Date: Jun 2008
Posts: 17
Rep Power: 4
dexignz is on a distinguished road
Thumbs up

Thanks..my fault. It works perfect. I appreciate your help

Quote:
Originally Posted by Lhotch View Post
As I already mentioned, you need to use an {else} in there.......ie

{if $smarty.session.userlevel != 5}
contents of original template here
{else}
my message here
{/if}
__________________
v4.0.8 Developer
Ebony Honeys | Adult Classifieds
dexignz is offline   Reply With Quote
Old 01-14-2009, 10:00 PM   #6
Senior Member
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 650
Rep Power: 17
bowers01 is on a distinguished road
Default

you can use this as well:
<script type="text/javascript">
alert("To view this page please register or login! www.yoursite.com")
</script>
__________________
Nick Bowers
68c v4.09 Developer
bowers01 is offline   Reply With Quote
Old 03-26-2009, 02:26 AM   #7
Junior Member
 
Join Date: Mar 2009
Posts: 18
Rep Power: 1
Ldanakos is on a distinguished road
Default

where exactly would you all place the code?
Ldanakos is offline   Reply With Quote
Old 03-26-2009, 03:18 AM   #8
Senior Member
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 650
Rep Power: 17
bowers01 is on a distinguished road
Default

Quote:
Originally Posted by Ldanakos View Post
where exactly would you all place the code?
{if $smarty.session.userlevel == 5}
<script type="text/javascript">
alert("To view this page please register or login! www.yoursite.com")
</script>
{/if}
put it in the <head>
Then in the body put the template code inside

{if $smarty.session.userlevel != 5}
contents of original template here
{/if}
Havn't tested it though.
Nick
__________________
Nick Bowers
68c v4.09 Developer
bowers01 is offline   Reply With Quote
Old 03-27-2009, 03:31 AM   #9
Junior Member
 
Join Date: Mar 2009
Posts: 18
Rep Power: 1
Ldanakos is on a distinguished road
Default

Ok I think i'm doing something wrong as the pages still show the listings.

I've placed this in all the files head and also above the section in the page.

I try setting it to where the guest can view site it says it's banned. i have it set w/everything on no for guests.
__________________
Developer 4.1.1 - Easy Checkoutv1 - Twitter - Deep blue theme
Ldanakos is offline   Reply With Quote
Old 03-27-2009, 07:36 AM   #10
Senior Member
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 650
Rep Power: 17
bowers01 is on a distinguished road
Default

Just tested it then, it works like a charm.
In layout.tpl place this in the <head> section
Code:
{if $body=='viewlisting.tpl'}{if $smarty.session.userlevel == 5}
<script type="text/javascript">
alert("To view this page please register or login! www.yoursite.com")
</script> 
{/if}{/if}
Then in viewlisting(2).tpl use this
Code:
{if $smarty.session.userlevel != 5}
contents of original template here
{/if}
It works on 4.09

Cheers,
Nick
__________________
Nick Bowers
68c v4.09 Developer

Last edited by bowers01; 03-27-2009 at 09:13 AM.
bowers01 is offline   Reply With Quote

Bookmarks

Tags
banned users, limit guest access, members ads, viewlisting.php

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
Can't access v4 Q's & Support page redstar v3.1 Questions & Support 3 09-24-2008 08:28 AM
if/else statement for Guest viewer LittleRascal v3.1 Questions & Support 4 03-05-2008 11:05 PM
Allowing Guest Posting takeshimedia v3.1 Questions & Support 0 03-09-2007 09:54 AM
Admin access query calaf6 v3.0 Questions & Support 10 03-31-2006 09:32 PM


All times are GMT -4. The time now is 12:36 PM.


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