forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: dustbunny on March 10, 2006, 06:49:30 pm

Title: total memebers number mod
Post by: dustbunny on March 10, 2006, 06:49:30 pm
I would like to show to all users the number of users total who registered.

Allow logged in users to view memberlist ( I"ve selected [NO])

Thanks,
Dustbunny
Title: Re: total memebers number mod
Post by: Joachim Müller on March 11, 2006, 09:54:48 am
is the "who is online (http://forum.coppermine-gallery.net/index.php?topic=26532.0)" plugin an option for you?
Title: Re: total memebers number mod
Post by: dustbunny on March 11, 2006, 08:23:30 pm
That is not what I'm looking for. All I need is a variable that counts registered users since the beginning so I can show how many have joined. Just like the user manager had in version 1.3 at the bottom of the page. I would like it if that variable was shown as part of the stats in the home page. 

I appreciate your help,
Dustbunny
Title: Re: total memebers number mod
Post by: Nibbler on March 11, 2006, 08:30:43 pm
Look in your lang file (eg lang/english.php) for the phrase that applies to your gallery

Code: [Select]
$lang_list_categories = array(
  'home' => 'Home',
  'stat1' => '<b>[pictures]</b> files in <b>[albums]</b> albums and <b>[cat]</b> categories with <b>[comments]</b> comments viewed <b>[views]</b> times',
  'stat2' => '<b>[pictures]</b> files in <b>[albums]</b> albums viewed <b>[views]</b> times',
  'xx_s_gallery' => '%s\'s Gallery',
  'stat3' => '<b>[pictures]</b> files in <b>[albums]</b> albums with <b>[comments]</b> comments viewed <b>[views]</b> times',
);

Adjust the wording to include a new [usercount] tag.

Then adjust the corresponding code in the get_cat_list() function in index.php to include

Code: [Select]
'[usercount]' => $cpg_udb->get_user_count(),
Finally add in

Code: [Select]
global $cpg_udb;
at the top of the get_cat_list() function.
Title: Re: total memebers number mod
Post by: lordprodigy on March 12, 2006, 05:24:03 pm
I tried it and it works.
Title: Re: total memebers number mod
Post by: dustbunny on March 12, 2006, 11:05:25 pm
Quote
Then adjust the corresponding code in the get_cat_list() function in index.php to include

Code:
'[usercount]' => $cpg_udb->get_user_count(),

It goes between where and where exactly? I tried to guess a few places but without knowing exactly I just get error messages for index.php
Title: Re: total memebers number mod
Post by: Joachim Müller on March 13, 2006, 09:48:38 am
into a line of it's own between
Code: [Select]
$lang_list_categories = array(and the closing tag of this array definition
Title: Re: total memebers number mod
Post by: dustbunny on March 13, 2006, 08:32:06 pm
That is not what I'm asking for.

I was asking where exactly does

'[usercount]' => $cpg_udb->get_user_count(),

go in index.php?
Title: Re: total memebers number mod
Post by: lordprodigy on March 13, 2006, 10:35:10 pm
Instructions were pretty clear. What you need to do is to spend some time to look at your index.php and understand how it works. Once you do that, you will know exactly where to place it. And trust me understanding the code will help you for future mods you may want to do.