[MOD] Number of Registered Users in Statistics Bar [MOD] Number of Registered Users in Statistics Bar
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[MOD] Number of Registered Users in Statistics Bar

Started by just_some_guy, October 13, 2007, 06:24:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

just_some_guy

Number of Registered Users in Statistics Bar
================================

CPG 1.4x

This 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

Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

François Keller

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 file
an other thing:
QuoteReplace XXXX in the code above with your gallery table prefix.
XXXX = $CONFIG['TABLE_PREFIX']
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

just_some_guy

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.
Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

just_some_guy

Please can a Dev Member moving this to MODS: Statistics

thanks,
Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

Joachim Müller

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.

just_some_guy

Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums