Number of Registered Users in Statistics Bar
================================
CPG 1.4xThis mod will add the number of registered users to the statistics bar on the main page.
So you will end up with something like this:
"339 files in 94 albums and 10 categories with 169 comments viewed 22444 times by 1321 registered users "This mod is very simple. Here are the instructions:
Step 1. Its best practice to backup the files you are going to edit before.
Step 2. Open theme.php
Find:
if ($statistics && count($cat_data) > 0) {
$template = template_extract_block($template_cat_list, 'footer');
$params = array('{STATISTICS}' => $statistics);
echo template_eval($template, $params);
}
Replace with:
$result = mysql_query("SELECT * FROM XXXXX_users");
$reg_usr = mysql_num_rows($result);
if ($statistics && count($cat_data) > 0) {
$template = template_extract_block($template_cat_list, 'footer');
$params = array('{STATISTICS}' => $statistics,
'{REG_USR}' => $reg_usr,
);
echo template_eval($template, $params);
}
Replace XXXX in the code above with your gallery table prefix.Step 3.
Find:
<!-- BEGIN footer -->
<tr>
<td colspan="3" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>
</tr>
<!-- END footer -->
Replace with:
<!-- BEGIN footer -->
<tr>
<td colspan="3" class="tableh1" align="center"><span class="statlink">{STATISTICS} by <strong>{REG_USR}</strong> registered users </span></td>
</tr>
<!-- END footer -->
And there you go, finished,
just_some_guy
DEMO (http://www.mysimtractor.com)
Not sure you find
if ($statistics && count($cat_data) > 0) {
$template = template_extract_block($template_cat_list, 'footer');
$params = array('{STATISTICS}' => $statistics);
echo template_eval($template, $params);
}
in all theme.php file. ;)
one more time, the best way to apply a mod is to copy/paste the function you have to modify from the
theme/sample/theme.php to the theme.php file from your theme if the function not exist before modifying.Don't modify the
include/theme.inc.php filean other thing:
QuoteReplace XXXX in the code above with your gallery table prefix.
XXXX = $CONFIG['TABLE_PREFIX']
Thanks Frantz.
I cant seem to be able to edit my post, but i will add some instructions here:
If you cant find those sections of code in theme.php then copy the appropriate parts from the sample theme.
You can either replace the XXXX with $CONFIG['TABLE_PREFIX'] or the way mentioned in my first post.
Please can a Dev Member moving this to MODS: Statistics
thanks,
Please post complete instructions (including the suggested modifications) in a separate posting. The mods board is only for complete, working mods. Yours still needs some tweaks. A mod will move your thread accordingly if applicable anyway.
Sure, thanks GauGau