4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Chris on September 24, 2002, 03:00:55 AM
-
I use 4images for my personal photography. When I add new images, I always do it in bulk. That is, I typically use FTP to upload 10 to 100 images and then use the admin control panel 'Check New Images' to add all of them at once.
{new_images} used in the home.html template always displays the LAST <Image table cells> number of new images. (which for me is 4)
How can I randomize which 4 new images are displayed in place of the {new_images} template tag?
By that I mean I want to randomly display 4 new images rather than the LAST 4 new images added.
-
Just replace in index.php
ORDER BY i.image_date DESC
with
AND i.image_date >= ".(time() - 60 * 60 * 24 * $config['new_cutoff'])."
ORDER BY RAND()
This requires MySQL version >= 3.23.23
Greets Jan
-
Most excellent. It works for me and you made my day.
Thanks.
-
I don't think this will work if you don't have any new images.
I posted another post to show something a little more intelligent.
http://www.4homepages.de/forum/viewtopic.php?t=4010
-
Thanks. I'll check it out, although I think I'm happy with not showing any new images if they are outside the cutoff date.
-
could you create a mod that will have a feature where the randomized new images could be placed outside 4images??? ^^
thnx ^_~
-
How do I randomize all of my images?!?
Thx,
Fuztud!
-
Hi,
I want to display new images not on the homepage but on a "static" page (a page that is called with "... index.php?template=news" for instance) and I add {new_images} there it's empty. If I have it in the home.html it works so there are new images that fall into this category.
Any idea what I need to change where to get it to work?
Thanks in advance,
Bernd
-
because custom template prcessed before everything else generated.
maby try comment this in index.php:if (!empty($template)) {
$clickstream = "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>".$config['category_separator'].str_replace("_", " ", ucfirst($template));
$site_template->register_vars("clickstream", $clickstream);
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
}
but this way clickstream will be messed up.
-
I have mysql-version 3.23.14 and i get the following error on my index.php:
DB Error: Bad SQL Query: 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, c.cat_name, u.name FROM cb_gallery_images i, cb_gallery_categories c LEFT JOIN cb_ivb_members u ON (u.id = i.user_id) WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN (0, 12, 13, 14, 3, 10, 4, 15, 1, 5, 11, 7, 9, 8) // ORDER BY i.image_date DESC AND i.image_date >= 1054663003 ORDER BY RAND() ORDER BY RAND() LIMIT 3
You have an error in your SQL syntax near '/ ORDER BY i.image_date DESC AND i.image_date >= 1054663003 ORDER BY RA' at line 5
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /usr/local/www/htdocs/ivb/gallery/includes/db_mysql.php on line 116
help! :)
-
SQL query is just a string, because of that u CAN NOT comment like this:
// ORDER BY i.image_date DESC AND i.image_date >= 1054663003
ORDER BY RAND() ORDER BY RAND() LIMIT 3
also, u got too many ORDER BY things, remove them, leave just one.
-
oops & thx! :D
-
I have used the old randomized NEW IMAGES MOD, but now i lost my index.php and have to create
it new.
Can please somebody tell me how it works to show the last 6 random new images?
Thanks
-
Hey Guys,
Is it possible to "randomize" through a specific category?? If we upload a new cat with a number of images every couple of days, it would be kewl to randomize through the "new" latest cat?? I have tried changing the "new" period to a more recent one, but it still shows up old pics from 2 months ago, because they were only uploaded in the past 7 days.. Any suggestions??
TIA
Chris
-
Just replace in index.php
Thank you very much Jan, it works perfect.
-
Hi,
I have Mysql 5.0.45 and me the script does not work.
What change do I need in the code in order that it works well?
Thanks
Just replace in index.php
ORDER BY i.image_date DESC
with
AND i.image_date >= ".(time() - 60 * 60 * 24 * $config['new_cutoff'])."
ORDER BY RAND()
This requires MySQL version >= 3.23.23
Greets Jan
-
Solved :D
Thanks
http://www.4homepages.de/forum/index.php?topic=7430.0
-
I'm using it but i notticed that page is loading after a few secconds... 15-20 sec of thinking. Without the randomizing code is instant.