4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: Vienix on June 13, 2002, 02:01:02 PM
-
Hi,
I would like to have a second random image on the frontpage, and maybey on some other pages as well.
I copied the "random image block" but then I get the same image.
How can I create a second random image ?
thanks...
-
OK, here's my *guess* on how it should work...
In page_header.php replace
$random_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image();
$site_template->register_vars("random_image", $random_image);
unset($random_image);
with
$random_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image();
$random_image2 = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image();
$site_template->register_vars("random_image", $random_image);
$site_template->register_vars("random_image2", $random_image2);
unset($random_image);
unset($random_image2);
Now copy {if random_image} till {endif random_image} in your templates, paste it where you want it and then change random_image to random_image2 in the second instance.
Nope, I didn't test this, but if you want you can try. (I think it should work) ;)
-
Nope, I didn't test this, but if you want you can try. (I think it should work)
I thought so too !, But it didn't... get the same image result
from both functions, with and without a "2".
There is something in the code with "$random_image_cache"
maybe the image gets pulled from cache or something?
I really dont know what I am talking about here, so smiling is allowed :)
-
Yes indeed, I think there's a random image cache... I'll take a quick look at it, maybe I can throw smth. together. :)
-
Anyone get this to work yet?
This would be great.
Is there a way to define the number of random images on the main page.
That might even be better then messing with the code.
Thanks
Anrob