Author Topic: Non-Registered Viewers able to see Category, but not thumbnails  (Read 7295 times)

0 Members and 1 Guest are viewing this topic.

Offline Anarchology

  • Jr. Member
  • **
  • Posts: 60
  • I LULZ too much!
    • View Profile
    • Tainted Pix
Non-Registered Viewers able to see Category, but not thumbnails
« on: January 12, 2009, 03:25:28 AM »
Hi everyone,

I have a couple categories that can be viewed by members only, but want it so that when non-registered viewers try to view it they get some kind of message saying they can't view the images without registering.

I know that under Category modification area in Admin Panel, I can make the categories able to be viewed, but the problem is that they can stll click on them and view thumbnails... but can't click on the thumbnails in order to view them.

How can I make a message pop-up or maybe a redirect when a "Guest" tries to click on a Category only for members to say something like, "You must be a registered member to view these images'????

Thanks in advance!
A personal THANK YOU to all of the great programmers on this site for helping me get my site from something basic to what it is today!

My site: http://taintedpix.com
(warning: some adult content)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Non-Registered Viewers able to see Category, but not thumbnails
« Reply #1 on: January 12, 2009, 03:50:29 AM »
You can try this:

in categories.php find:
$cache_id create_cache_id(

Insert above:
if (!check_permission("auth_viewimage"$cat_id))
{
  
redirect("index.php?template=cat_error");
}


Then create a new template file cat_error.html and save it as templates/<your template>/cat_error.html
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Anarchology

  • Jr. Member
  • **
  • Posts: 60
  • I LULZ too much!
    • View Profile
    • Tainted Pix
Re: Non-Registered Viewers able to see Category, but not thumbnails
« Reply #2 on: January 12, 2009, 08:23:34 AM »
That worked like a charm. I put a little twist on it that might be an idea for anyone else wanting to do this. I simply added a redirect code to the new html file that points directly to the registration page.

I just put in the following below, but will be making the page a little more nice than just that code.

Code: [Select]
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourdomain.com/index.html">
Hey V@no, your advice was great. I'm also wondering if that could be added to the "new image" thumbnails that show up. From the looks of things, they are just made so someone cannot click on them.
A personal THANK YOU to all of the great programmers on this site for helping me get my site from something basic to what it is today!

My site: http://taintedpix.com
(warning: some adult content)

Offline jotabonfim

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Non-Registered Viewers able to see Category, but not thumbnails
« Reply #3 on: June 24, 2009, 11:01:57 PM »
Hello guys, how do I change this function?
 
I would like the unregistered user could have access to view the thumbs up and when he click on the thumb to redirect the page to register, php

Offline jotabonfim

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Non-Registered Viewers able to see Category, but not thumbnails
« Reply #4 on: August 03, 2009, 04:15:18 PM »
Hello V@no, how do I change this function?
 
I would like the unregistered user could have access to view the thumbs up and when he click on the thumb to redirect the page to register, php


--------------------------------------



You can try this:

in categories.php find:
$cache_id create_cache_id(

Insert above:
if (!check_permission("auth_viewimage"$cat_id))
{
  
redirect("index.php?template=cat_error");
}


Then create a new template file cat_error.html and save it as templates/<your template>/cat_error.html

Offline lelananh

  • Banned for spam
  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: Non-Registered Viewers able to see Category, but not thumbnails
« Reply #5 on: August 04, 2009, 12:17:33 PM »

Thanks for sharing this useful information. It's great.
« Last Edit: August 04, 2009, 03:33:42 PM by V@no »

Offline jotabonfim

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Non-Registered Viewers able to see Category, but not thumbnails
« Reply #6 on: August 08, 2009, 03:18:58 AM »
????? help please

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Non-Registered Viewers able to see Category, but not thumbnails
« Reply #7 on: August 08, 2009, 04:47:17 AM »
in includes/functions.php find:
  return $thumb;

Insert above:
  if (!$show_link)
  {
    
$thumb "<a href=\"".$site_sess->url(ROOT_PATH."register.php")."\">".$thumb."</a>";
  }
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline jotabonfim

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Non-Registered Viewers able to see Category, but not thumbnails
« Reply #8 on: August 10, 2009, 05:04:31 PM »
Thanks Vano. :wink: