4images Forum & Community
4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: rohanrohanrohan 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.
-
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:"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:"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:"media_url" => MEDIA_PATH,
add before:"notguest" => ($user_info['user_level'] == GUEST) ? 0 : 1,
After that u can use in your templates this format:
{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
-
thanks a lot man! will try it now!
-
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 =
(http://www.gifanimer.com/templates/imagine/icons/jpg.gif)
after register =
register =
(http://www.gifanimer.com/data/thumbnails/34/90.jpg)
-
yeah tahts also a good idea! is it possible?
-
try this:
in /includes/functions.php find:
global $site_sess, $config;
replace withglobal $site_sess, $config, $user_info;
then, find:if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) {
replace with: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
-
excellent maitre v@no thk :D
-
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 :?:
-
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:if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0) || $user_info['user_level'] == GUEST) {
replace with: $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.
-
yes very good thk v@no
is possible to case option in admin CP for choise visible or no visible for guest.
very thk
-
2. if u want disable also something else (atleast in templates), then u could do this:
in /includes/page_header.php find:"media_url" => MEDIA_PATH,
add before:"notguest" => ($user_info['user_level'] == GUEST) ? 0 : 1,
After that u can use in your templates this format:
{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