This mod will show logged in users all images added since their last visit. If not logged on, it will work the same as the 'New Images' link.
search.php (if you are using 4images v1.7.2 or newer, the following two changes must be done in
global.php instead)
find:
if (isset($HTTP_POST_VARS['search_new_images']) || isset($HTTP_GET_VARS['search_new_images'])) {
$search_new_images = 1;
comment out or remove:
$search_new_images = 1;
add after:
$search_new_images = (isset($HTTP_POST_VARS['search_new_images'])) ? trim($HTTP_POST_VARS['search_new_images']) : urldecode(trim($HTTP_GET_VARS['search_new_images']));
Note: Need this change because otherwise whatever was passed in got overidden with 1
search.phpfind:
if ($search_new_images && $show_result == 1) {
$search_id['search_new_images'] = 1;
}
add after:
if ($search_new_images == 2) {
$search_id['search_new_images'] = 2;
}
find:
if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
$new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
$sql_where_query .= "AND i.image_date >= $new_cutoff ";
}
add after:
if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 2) {
if ($user_info['user_level'] != GUEST) {
$new_cutoff = $user_info['user_lastvisit'];
}
else {
$new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
}
$sql_where_query .= "AND i.image_date >= $new_cutoff ";
}
page_header.phpfind:
"url_new_images" => $site_sess->url(ROOT_PATH."search.php?search_new_images=1"),
add after:
"url_new_images_last" => $site_sess->url(ROOT_PATH."search.php?search_new_images=2"),
find:
"lang_new_images" => $lang['new_images'],
add after:
"lang_new_images_last" => $lang['new_images_last'],
lang/xxx/main.phpfind:
$lang['new_images'] = "New images";
add after:
$lang['new_images_last'] = "New images since last visit";
templates/xxx/home.htmlWherever you prefer near the new_images and top_images logic add:
<a href="{url_new_images_last}" title="If logged in, click to see all images added since your last visit"><b>{lang_new_images_last}</b></a>
Also change any other template html screen that has the new images and top images links in them. I only put the 'title=' code on my home page template, but you could put it in all or none.
To see it in action, visit
http://www.jenrichardsphotography.com, although you would have to register and hope I add images before you visit the next time to see it work fully, so that may not be very practical.