// IntroductionThis feature was already published by V@no in the past but seems to have been lost on the old forum. However, since the code was never found again, I have decided to re-code it myself.
// Affected files
- includes/page_header.php
- templates/<your_template>/user_logininfo.html
// Backup your filesAlways backup your files before proceeding to these steps below.// Step 1In your includes/page_header.php file,
find :
// Replace Globals in $lang
$lang = $site_template->parse_array($lang);
add below :
if (!empty($user_info['lightbox_image_ids'])) {
$lightbox_image_ids = explode(" ",$user_info['lightbox_image_ids']);
$lightbox_total_count = count ($lightbox_image_ids);
}
Then, find :
"lang_lightbox" => $lang['lightbox'],
add right below :
"lightbox_total_count" => intval($lightbox_total_count),
// Step 1.1Then, find : (updated - automatic refresh when ether removing and adding an image to lightbox).
$msg = (add_to_lightbox($id)) ? $lang['lightbox_add_success'] : $lang['lightbox_add_error'];
add below :
$site_template->register_vars("msg", $msg);
Then, find :
$msg = (remove_from_lightbox($id)) ? $lang['lightbox_remove_success'] : $lang['lightbox_remove_error'];
add below :
$site_template->register_vars("msg", $msg);
This will redirect automatically to your current page and refresh the lightbox count.
// Step 2In your templates/<your_template>/user_logininfo.html file,
find :
» <a href="{url_lightbox}">{lang_lightbox}</a><br />
replace with :
» <a href="{url_lightbox}">{lang_lightbox} ({lightbox_total_count})</a><br />
// Installation completeThat's it. You're done !
To test this out, simply go to your home page gallery as you should be to see the number aside of the lightbox. Add an image to the lightbox and click on the lightbox link (for the first time). Then, you should see the value changing.
For instance :
lightbox (1).
(Note: '1' is just an example).
Good luck !