// New images total count v1.0 (Please proceed to v1.1 below)
// IntroductionThis MOD allows you to see directly how many new images you have from your site header like this :
new images (x)
rather than clicking on it all the time to see how many new images has been in your database lately.
// Affected files
- index.php
- templates/<your_template>/home.html
// Backup your filesAlways backup your files before proceeding to these steps below.// Step 1In your index.php file,
find :
if (!$num_rows) {
add
above :
$new_images_count = str_replace("{new_images_count}", "", $num_rows);
Then, find :
$site_template->register_vars("new_images", $new_images);
add
above :
$site_template->register_vars("new_images_count", $new_images_count);
// Step 2In your templates/<your_template>/home.html file,
find :
<a href="{url_new_images}"><b>{lang_new_images}</b></a>
replace with :
<a href="{url_new_images}"><b>{lang_new_images} ({new_images_count})</b></a>
========================================================================================
// New images total count v1.1
// Step 1Uninstall v1.0 before proceeding to this steps below (of course, if you already installed it in the first place).
// Step 2In your includes/page_header.php file,
find :
// Replace Globals in $lang
$lang = $site_template->parse_array($lang);
add below :
// Verification of new images in your gallery.
$is_new = ($image_row['image_date'] >= (time() - 60 * 60 * 24 * $config['new_cutoff'])) ? 1 : 0;
Then, find :
"lang_new_images" => $lang['new_images'],
add below :
"image_is_new" => ($is_new) ? $is_new : "",
Then, on all your HTML templates that you can find the following :
<a href="{url_new_images}"><b>{lang_new_images}</b></a>
Change them
all to :
<a href="{url_new_images}"><b>{lang_new_images}</a>{if image_is_new} ({image_is_new}){endif image_is_new}</b>
// Installation completeThat's it. You're done !
Go to your home gallery page and check out your 'new images' link. You should see the total number right aside of it.
Additional note: This should work on all your pages from the clickstream bar.