vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Plugin PHP Code to show total number of members. (https://vborg.vbsupport.ru/showthread.php?t=217992)

notrious 07-06-2009 07:48 PM

Plugin PHP Code to show total number of members.
 
I am trying somr thing:

$t_members = $vbulletin->userstats['numbermembers'] + $vbulletin->options['t_stats_members'];

where @ "$t_members" I am able to get the value i have added. But what i am not getting is $vbulletin->userstats['numbermembers'] total number of users.

I have placed $t_members in header template just to test and its showing the added value but not getting total users value. I have tried this as well.

$t_members = $numbermembers + $vbulletin->options['t_stats_members']; where @ $numbermembers i am getting total numers of users. But by combining this i am not getting.

t members value + total members value :

So any help please so i could get total users + t members.

I searched a lot but nothing helps so posting here.

Lynne 07-06-2009 08:19 PM

I don't believe this is valid - $vbulletin->userstats['numbermembers'] . Can you print that out on it's own? If not, then it isn't valid. (I don't think I've ever seen that variable used before.)

HMBeaty 07-06-2009 08:22 PM

Should look something like this
PHP Code:

$numbermembers vb_number_format($vbulletin->userstats['numbermembers']); 


notrious 07-06-2009 08:38 PM

Trying this ..

$numbermembers = vb_number_format($vbulletin->userstats['numbermembers']);

$t_members = $numbermembers + $vbulletin->options['t_stats_members'];

" $numbermembers = vb_number_format($vbulletin->userstats['numbermembers']); " Nothing displaying on it..

still nothing ...

HMBeaty 07-06-2009 08:46 PM

Can you paste the code you're using in your php file and template please?

notrious 07-06-2009 09:08 PM

Redlinemotorsports Thanks a lot for your help...


Templates

Code:

  $numbermembers
is showing total registered users.

Code:

$fake_members
is showing added fake user value.

Code:

     
Hook Location: global_start

Code:

$fake_members = vb_number_format($vbulletin->userstats['numbermembers']) + $vbulletin->options['fake_stats_members'] ;

$numbermembers = vb_number_format($fake_members);


as i mentioned above @ "$numbermembers" in templates is showing total registered users value but at "$fake_members" is showing added fake value.


What i am want to get is "$numbermembers" + "$fake_members" by using either on these $fake_members or $numbermembers veriab is templates.



Once again "Redlinemotorsports" thanks a lot boss.

HMBeaty 07-06-2009 09:12 PM

Ok, so to clarify and get some things sorted, you have BOTH values (Registered Users and Fake Users) showing up in the templates? You just want to combine the 2 values?

notrious 07-06-2009 09:15 PM

Right sir i am getting both of these values in templates but not getting,

"$numbermembers" + "$fake_members"

That's all i want to get.

HMBeaty 07-06-2009 09:18 PM

Try this:
PHP Code:

$total_members$numbermembers $fake_members 

Not sure if that'll work but its worth a shot

notrious 07-06-2009 09:19 PM

To make it more clear by using
Code:

$fake_members
in templates i am getting my added value. I am using

Code:

$fake_members = number_format($numbersmembers['users']) + $vbulletin->options['fake_stats_members'] ;
in php plugin code, and i am getting only 2nd part $vbulletin->options['fake_stats_members'] but i am not getting actual registered users value by using number_format($numbersmembers['users']). So i need is some thing instead of this to ge value.

--------------- Added [DATE]1246918984[/DATE] at [TIME]1246918984[/TIME] ---------------

SHowing just a 0. So bottom line didn't work.


Quote:

Originally Posted by Redlinemotorsports (Post 1844111)
Try this:
PHP Code:

$total_members$numbermembers $fake_members 

Not sure if that'll work but its worth a shot

--------------- Added [DATE]1246955309[/DATE] at [TIME]1246955309[/TIME] ---------------

huuuh?


All times are GMT. The time now is 01:07 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01812 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete