Hi,
Thank you for help. I will describe what I did to solve my problem. Perhaps this info will be helpful for others.
I started with:
http://www.4homepages.de/forum/index.php?topic=11165.0Since creating second set of thumbnails didn't sound good to me, I decided to create only one thumbnail (say:
you_dont_have _permission_to_see_thumbnails.jpg) which is supposed to be presented instead of regular thumbnails to all who don't have permission to see images in a given category.
To do so, first apply V@no's modification
http://www.4homepages.de/forum/index.php?topic=11165.msg57291#msg57291 but instead of line:
$file_src_new = str_replace("/".$thumb_file_name, "/blur/".$thumb_file_name, $file_src);
insert:
$file_src_new = str_replace("/".$thumb_file_name, "/../you_dont_have _permission_to_see_thumbnails.jpg", $file_src);
assuming that
you_dont_have _permission_to_see_thumbnails.jpg is placed in data/thumbnails/ folder.
Next problem I faced was to exclude categories set to "View Image: Users" from random image. It didn't look nice when my
you_dont_have _permission_to_see_thumbnails.jpg showed up as a random image. I found a couple of posts on this forum regarding this issue. Unfortuanatelly, all of them (all I have read) are about excluding a static array of cat_id. So I did as follows:
In include/functions.php find:
srand((float)microtime() * 1000000);
$category_id = array_rand($random_image_cache);
and replace with:
$sql = "SELECT cat_id FROM ".CATEGORIES_TABLE." WHERE auth_viewimage=0";
$result = $site_db->query($sql);
$index=0;
while($temp = $site_db->fetch_array($result))
{
$inrand[$index] = $temp['cat_id'];
$index = $index+1;
}
$site_db->free_result($result);
$index = array_rand($inrand);
$category_id = $inrand[$index];
Actually, the first line:
$sql = "SELECT cat_id FROM ".CATEGORIES_TABLE." WHERE auth_viewimage=0";
may be replaced with any other condition to apply a different rule of exclusion.
Although the above mentioned mods work fine on my website, I cannot take any responsibility of how they work on any other website. I am beginner in php and mysql.
Regards,
Maciej