vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   User's Percent of Total Posts (https://vborg.vbsupport.ru/showthread.php?t=32050)

apfeifer 11-02-2001 10:00 PM

Hack: User's Percent of Total Posts
Version of vB: 2.2.0, although may work on earlier versions but not tested
Current Version: 1.0.0
Description: This gives you a user's percent of the total posts on your forum.


Once again, this is a small hack but show's something interesting. Enjoy!

:cool:

apfeifer 11-03-2001 01:30 AM

Er, duh, helps if I attach the file...

03.11.01: Fixed issue with percent's on users with post count of over 1000, thanks FireFly!

LanciaStratos 11-03-2001 02:15 AM

Very nice hack! But, when I tried it out, it said that one of my users had 5988.52% of total posts. :?: :)

JJR512 11-03-2001 03:09 AM

Yeah, it looks like the results are 1000 times higher than what they should be.

For example, I have 9771 posts on a 116,395-post board. I have 8.39469% of the total posts. Yet it says I have 8423.28%. (It also looks like the rounding is off.)

MrLister 11-03-2001 03:47 AM

hmm well on popular boards the percent would be .02 % and so forth.... also it's a good idea to restrict the number of decimals.

apfeifer 11-03-2001 11:40 AM

Eek, sorry about that, I'll fix it as soon as I get home from tryouts.

:cool:

apfeifer 11-03-2001 12:20 PM

Quote:

Originally posted by JJR512
Yeah, it looks like the results are 1000 times higher than what they should be.

For example, I have 9771 posts on a 116,395-post board. I have 8.39469% of the total posts. Yet it says I have 8423.28%. (It also looks like the rounding is off.)

Hmm, I just plugged the numbers for your posts / your boards posts in and it worked fine:

PHP Code:

$percentoftotalposts round((9774  116429) * 100,2);

echo 
$percentoftotalposts

That echo's: 8.39

So I'm not totally sure. Paste the exact code that you have in member.php (just those couple lines, of course:p), and I'll look them over. I don't really see anything to fix because it's working for me.

:cool:

Admin 11-03-2001 12:23 PM

Code:

  $totalposts=number_format($countposts['posts']);
should be
Code:

  $totalposts=$countposts['posts'];
because number_format() adds commas to the number (i.e 1000 => 1,000).

apfeifer 11-03-2001 03:07 PM

Thank's FireFly! I have uploaded the fixed version of it.

:cool:

toLTcaboLT 11-03-2001 03:21 PM

Hmzz I know it's little stupid .. but when I install where I can see that info ? :)

Can someone post screenshot .. I wanna too see that Hack .. Please? Tnx


All times are GMT. The time now is 01:41 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.01038 seconds
  • Memory Usage 1,734KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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