Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: [MOD] Number of Registered Users in Statistics Bar  (Read 3961 times)

0 Members and 1 Guest are viewing this topic.

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
[MOD] Number of Registered Users in Statistics Bar
« on: October 13, 2007, 06:24:02 pm »

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:

Code: [Select]
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:

Code: [Select]
$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:

Code: [Select]
<!-- BEGIN footer -->
        <tr>
                <td colspan="3" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>
        </tr>
<!-- END footer -->

Replace with:

Code: [Select]
<!-- 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

Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: [MOD] Number of Registered Users in Statistics Bar
« Reply #1 on: October 13, 2007, 06:40:33 pm »

Not sure you find
Code: [Select]
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:
Quote
Replace XXXX in the code above with your gallery table prefix.
XXXX = $CONFIG['TABLE_PREFIX']
Logged
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

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: [MOD] Number of Registered Users in Statistics Bar
« Reply #2 on: October 13, 2007, 08:00:18 pm »

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.
Logged
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

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: [MOD] Number of Registered Users in Statistics Bar
« Reply #3 on: October 13, 2007, 11:15:28 pm »

Please can a Dev Member moving this to MODS: Statistics

thanks,
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: [MOD] Number of Registered Users in Statistics Bar
« Reply #4 on: October 14, 2007, 10:43:45 am »

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.
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: [MOD] Number of Registered Users in Statistics Bar
« Reply #5 on: October 14, 2007, 10:47:30 am »

Sure, thanks GauGau
Logged
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
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.