Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-06-2009, 07:48 PM
notrious notrious is offline
 
Join Date: Mar 2007
Location: New York
Posts: 373
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 07-06-2009, 08:19 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.)
Reply With Quote
  #3  
Old 07-06-2009, 08:22 PM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Should look something like this
PHP Code:
$numbermembers vb_number_format($vbulletin->userstats['numbermembers']); 
Reply With Quote
  #4  
Old 07-06-2009, 08:38 PM
notrious notrious is offline
 
Join Date: Mar 2007
Location: New York
Posts: 373
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ...
Reply With Quote
  #5  
Old 07-06-2009, 08:46 PM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you paste the code you're using in your php file and template please?
Reply With Quote
  #6  
Old 07-06-2009, 09:08 PM
notrious notrious is offline
 
Join Date: Mar 2007
Location: New York
Posts: 373
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 07-06-2009, 09:12 PM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 07-06-2009, 09:15 PM
notrious notrious is offline
 
Join Date: Mar 2007
Location: New York
Posts: 373
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

"$numbermembers" + "$fake_members"

That's all i want to get.
Reply With Quote
  #9  
Old 07-06-2009, 09:18 PM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this:
PHP Code:
$total_members$numbermembers $fake_members 
Not sure if that'll work but its worth a shot
Reply With Quote
  #10  
Old 07-06-2009, 09:19 PM
notrious notrious is offline
 
Join Date: Mar 2007
Location: New York
Posts: 373
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 View Post
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?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04324 seconds
  • Memory Usage 2,265KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_code
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete