4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: fah on February 13, 2008, 10:03:51 AM
-
Hello,
defaultly there is only 1 random image, but I would like to do 4 random images. Please help!
-
Here please Review :arrow: http://www.4homepages.de/forum/index.php?board=15.0
-
But I would like random images withou slideshow.
-
But I would like random images withou slideshow.
In this category afternoon
-
Try this:
http://www.4homepages.de/forum/index.php?topic=4259.msg17513#msg17513
-
Try this:
http://www.4homepages.de/forum/index.php?topic=4259.msg17513#msg17513
This works, but only on home page And I need random images on Detail page. :(
-
... than add V@no's code in details.php ...
... and use {random_images} in details.html ...
... ;) ...
-
... than add V@no's code in details.php ...
... and use {random_images} in details.html ...
... ;) ...
Not works :( (SQL errors).
-
... do you read the error message ... :?:
... so ... replace ...
LIMIT $num_new_images";
... by ... e.g. ...
LIMIT 4";
... and now it works perfectly ... :!:
-
... do you read the error message ... :?:
... so ... replace ...
LIMIT $num_new_images";
... by ... e.g. ...
LIMIT 4";
... and now it works perfectly ... :!:
Now it works, but I heve very interesting problem. When I click on any image with random images, it opens DIFFERENT image (eg. when I clicks thumbnail of image Nr 1, it opens image NR 5)!
-
... you must insert the "random code" from V@no on the top in details.php ...
... directly after ...
$additional_sql = "";
if (!empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_sql .= ", i.".$key;
}
}
-
Now it works well! Thank you very much!
-
Hey there!
How can I add this code:
AND a.cat_id IN (2,6)
in this section of "random_image":
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")
ORDER BY RAND()
LIMIT 10";
It doesn't if I replace "AND c.cat_id = i.cat_id"
I get an error after I did that.
So I want just show some random images from certain categories on my details.php
Thanks for your help!
-
anybody?? :)
-
Hey there!
How can I add this code:
AND a.cat_id IN (2,6)
in this section of "random_image":
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")
ORDER BY RAND()
LIMIT 10";
It doesn't if I replace "AND c.cat_id = i.cat_id"
I get an error after I did that.
So I want just show some random images from certain categories on my details.php
Thanks for your help!
is there already a solution available for above requested question? I would like to know how to realize this....