Author Topic: Restriction of Guest access?  (Read 12997 times)

0 Members and 1 Guest are viewing this topic.

Offline rohanrohanrohan

  • Full Member
  • ***
  • Posts: 200
    • View Profile
Restriction of Guest access?
« on: June 05, 2003, 12:42:29 PM »
I have a large gallery and there are lots of guest browsing the thumbs, which I dont want.

I know hiding the cat names will not allow to see thumbs but i dont want this.

I  guests to see the category names but not allow guests to see the thumbs.

Is there any way to do this?

from first inspection of the code i guess i can remove the "if cats" statement in the home page and simply show the cats.

but am not sure. plz help.

thanks.

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
Restriction of Guest access?
« Reply #1 on: June 05, 2003, 01:04:00 PM »
u can do it in two ways:
1. if u want only restrict the thumbnails and nothing else, u can do this:
in /includes/functions.php find:
Code: [Select]
"thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link),replace it with:
Code: [Select]
"thumbnail" => ($user_info['user_level'] == GUEST) ? "" : get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link),

2. if u want disable also something else (atleast in templates), then u could do this:
in /includes/page_header.php find:
Code: [Select]
"media_url" => MEDIA_PATH,add before:
Code: [Select]
"notguest" => ($user_info['user_level'] == GUEST) ? 0 : 1,
After that u can use in your templates this format:
Quote
{if notguest}
...
whatever u want display if not a guest
...

{endif notguest}

in your case, u can disable the thumbnails by adding {if notguest} and {endif notguets} around the {thumbnail} tag in thumbnails_bit.html template
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 rohanrohanrohan

  • Full Member
  • ***
  • Posts: 200
    • View Profile
Restriction of Guest access?
« Reply #2 on: June 05, 2003, 03:00:37 PM »
thanks a lot man! will try it now!

Offline toto1

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
    • http://www.gifanimer.com
Restriction of Guest access?
« Reply #3 on: June 06, 2003, 09:16:02 AM »
v@no is you he possible to post the images by default of 4 images jpg GIF zip swf etc.... has the place of the thumnbails

guest =


after register =

register =

Offline rohanrohanrohan

  • Full Member
  • ***
  • Posts: 200
    • View Profile
Restriction of Guest access?
« Reply #4 on: June 06, 2003, 11:10:04 AM »
yeah tahts also a good idea! is it possible?

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
Restriction of Guest access?
« Reply #5 on: June 06, 2003, 11:14:35 AM »
try this:
in /includes/functions.php find:
Code: [Select]
global $site_sess, $config;
replace with
Code: [Select]
global $site_sess, $config, $user_info;
then, find:
Code: [Select]
if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) {
replace with:
Code: [Select]
if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0) || $user_info['user_level'] == GUEST) {
this should disable all thumbnails from showing to GUESTs
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 toto1

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
    • http://www.gifanimer.com
Restriction of Guest access?
« Reply #6 on: June 06, 2003, 11:34:38 AM »
excellent maitre v@no thk :D

Offline toto1

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
    • http://www.gifanimer.com
Restriction of Guest access?
« Reply #7 on: June 06, 2003, 11:44:18 AM »
is possible :

exemple :
Categorie : Avion =  acces guest  option in Cp = visualise = all
possible visualise thumnbail in the categorie.

Categorie : moto = acces members option in cp = visualise = members
possible is members visualise thumnbail and no guest. Guest visualise default images 4images

Is possible maitre v@no
thk

sorry for my english is french.
Request forum french in international forum 4images :?:

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
Restriction of Guest access?
« Reply #8 on: June 06, 2003, 12:23:57 PM »
Quote from: toto1
is possible :

exemple :
Categorie : Avion =  acces guest  option in Cp = visualise = all
possible visualise thumnbail in the categorie.

Categorie : moto = acces members option in cp = visualise = members
possible is members visualise thumnbail and no guest. Guest visualise default images 4images

yes, but u'll need new field in 4images_categories table in the DB.
then, do changes in /admin/  atleast two files, and again do changes in functions.php
but for now, the "dirty" way is do this way:
the line from my previous post:
Code: [Select]
if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0) || $user_info['user_level'] == GUEST) { replace with:
Code: [Select]
   $cat_array = array(xx, xx, xx);
    if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0) || ($user_info['user_level'] == GUEST && in_array($cat_id, $cat_array))) {

Replace xx with as many categories IDs where u want show icon for guests.
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 toto1

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
    • http://www.gifanimer.com
Restriction of Guest access?
« Reply #9 on: June 06, 2003, 10:12:54 PM »
yes very good thk v@no

is possible to case option in admin CP for choise visible or no visible for guest.

very thk

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
Restriction of Guest access?
« Reply #10 on: June 07, 2003, 04:51:34 PM »
Quote from: V@no
2. if u want disable also something else (atleast in templates), then u could do this:
in /includes/page_header.php find:
Code: [Select]
"media_url" => MEDIA_PATH,add before:
Code: [Select]
"notguest" => ($user_info['user_level'] == GUEST) ? 0 : 1,
After that u can use in your templates this format:
Quote
{if notguest}
...
whatever u want display if not a guest
...

{endif notguest}

in your case, u can disable the thumbnails by adding {if notguest} and {endif notguets} around the {thumbnail} tag in thumbnails_bit.html template

hmmm...thanks to SLL for finding, that all this already exist in /includes/page_header.php
u can use those tags in your templates:
{if user_loggedin} .... {endif user_loggedin}
or
{if user_loggedout} .... {endif user_loggedout}
no need do any changes in the code...:D
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)