4images Forum & Community
4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: that Dude on March 20, 2005, 07:27:53 PM
-
Is it possible to exclude a folder from the randome image section? Thanks!
-
Can someone please help me here?
I have six categories in my 4image gallery and one of them has graphic war pictures. Consequently, I don't want that specific category along with all its sub categories to be a part of random image display.
How can I disable that?
Thank you all for your help!
-
its not as easy as it might looks like...
try this
in includes/functions.php find: srand((float)microtime() * 1000000);
$category_id = array_rand($random_image_cache);
replace with: $notincat = array(1,2,3,4); //add as many categories IDs as u wish
for ($i = 0; $i < 100; $i++)
{
srand((float)microtime() * 1000000);
$category_id = array_rand($random_image_cache);
if (!in_array($category_id, $notincat)) break;
else $category_id = -1;
}
$notincat = array(1,2,3,4); //add as many categories IDs as u wish
-
You are just awesome! Thanks a lot!
-
hi v@no,
i have a category (with alot of subcategorys) too, that i want to hide from random image selection.
your solution did not work for me. still have random pics from excluded categorys
i have tryed
$notincat = array(68);
and
$notincat = array(68,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25);
68 is the maincategory i want to hide and the other id's are subcategorys from it - i want to hide too.
any idea?
-
anyone? :roll:
-
made a misstake while applying the patch?
-
i double checked everything...
is it for the random_cat_image selection only :?:
i have disabled that for performance reasons.
want to hide some categories from random_image selection.
-
actualy it is...this only works when random_cat_image is enabled...:?
-
try this then:
in includes/functions.php find: $cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
Insert below: $cat_id_sql .= (($cat_id_sql) ? "," : "")."1,2,3,5,10,8";
-
thanks for ur help v@no, but it dont werks :(
any other idea?
-
Hi,
is it possible at all to exclude single images from different categories, for example by specifying there ID's in the same way as above with the category ID's. I want to add a titel graphic as a first image in every category - with text to describe the category, but obviously don't want it to show up in the random images (since it's not an image)
Appreciate your help
-
actualy it is...this only works when random_cat_image is enabled...Confused
How can I enable this?
In my galery the "mod" doesn't work too :-(
-
How can I enable this?
In my galery the "mod" doesn't work too :-(
its in includes/constants.php
-
I applied both variants (first suggestion, second suggestion, both together...) and random cat images are turnded on in constants.php, but categories that should not be shown in random images on mainpage still appear? I use 4images 1.7. Is there another way? Did I forget something?
includes/functions.php
$random_image_cache = array();
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
$cat_id_sql .= (($cat_id_sql) ? "," : "")."34,35,36,58,59,61";
if (SHOW_RANDOM_CAT_IMAGE) {
$notincat = array(34,35,36,58,59,61); //add as many categories IDs as u wish
for ($i = 0; $i < 100; $i++)
{
srand((float)microtime() * 1000000);
$category_id = array_rand($random_image_cache);
if (!in_array($category_id, $notincat)) break;
else $category_id = -1;
}
}
else {
$category_id = 0;
}
}
includes/constants.php
// If you have a lot of images in your database,
// the random image function could make your programm slow.
// Try first to set "SHOW_RANDOM_CAT_IMAGE" to 0.
define('SHOW_RANDOM_IMAGE', 1);
define('SHOW_RANDOM_CAT_IMAGE', 1);
thanks
-
Hi
I also want to do this. I have a category of Religious wallpaper and I want to block them to show up in random.
But it’s not working. I mean I can still see the image in “random images”
Do I need to change anything?? (May be coz I just want to block one category)
-
This is becoming important for me now so I am asking again.
It’s not working on v1.7.1. :(
(I can still see the images from this category under new images)
Before I thought it’s me be coz I am trying to exclude only one category but now I m pretty much sure that’s its not working. I tried it with two categories by exactly following the post.
Is there anything else I can do??
Please Help.
-
(I can still see the images from this category under new images)
what? we were not discusing random NEW images on home page and you didnt even mention this!
and besides that, 4images does not randomize new images, so you must have installed a mod that randomize them, in that case you know the drill ;)
-
I can't get this to work either.
I tried to exclude my wallpapers folder. They still show up.
;( hehe.
-
This is what I need also. I want to exclude 2 categories and their subcategories. I've applied the code to the function.php file and am still getting images from those categories. How can I get this to work? I am using 1.7.6.
Thank you to whomever can help!