![]() |
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: |
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! |
Very nice hack! But, when I tried it out, it said that one of my users had 5988.52% of total posts. :?: :)
|
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 well on popular boards the percent would be .02 % and so forth.... also it's a good idea to restrict the number of decimals.
|
Eek, sorry about that, I'll fix it as soon as I get home from tryouts.
:cool: |
Quote:
PHP Code:
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: |
Code:
$totalposts=number_format($countposts['posts']); Code:
$totalposts=$countposts['posts']; |
Thank's FireFly! I have uploaded the fixed version of it.
:cool: |
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 |
|
Cool .. Tnx man :)
|
Working great now. Thanks apfeifer and FireFly! :)
|
First, thanks to FireFly; that fixed my problem.
Next, I'd like to show how I took the basic idea of this hack and extended it to work with tubedogg's 'user has started xx threads' hack (which was my idea ;)). This hack adds a new line to a person's profile, below the person's post count (and now the post percentage count, with this hack), and shows how many threads a person has started. What I've done is taken the idea of this hack, interfaced it with tubedogg's hack, to display the percentage of total threads that a person has started. 1. Install this hack 2. Install tubedogg's hack from here, only instead of adding the contents of his memberadd.txt file where he tells you to in his step #2, insert the contents of that file just above the bit you added from this hack. 3. Below the bit you added to member.php from this hack, add this: Code:
// Find percentage of threads started I would like to get permission from apfeifer and tubedogg to re-release their individual hacks along with my modifications as one unified hack (with full crediting, of course). |
Me likes!
:cool: |
No problems. :)
I installed this here, it's cool to have. :pleased: |
I got it to work, but I did have a problem in this line
$percentoftotalposts = round(($userinfo[posts] / $totalposts) * 100,2); it wouldn't work so I had to change it to $percentoftotalposts = round(($userinfo[posts] / $totalposts) * 100); but for me it doesn't give decimals. |
What version of PHP are you using George?
|
http://www.vbulletin.com/forum/showt...threadid=32024
Try to use this: Code:
$percentoftotalposts=sprintf('%.2f', (($userinfo[posts] / $totalposts) * 100); |
Unfortunately I'm on php 3.16 I think. I'd have to check on the actual version number.
That replacement string didn't work :( |
Ooops, sorry. Did a typo. :o
Try again. :) |
well that didn't work at first, but I found another typo and it works now with
$percentoftotalposts = sprintf('%.2f', (($userinfo[posts] / $totalposts) * 100)); Thank you :) |
Glad to see you got it working!
Should I change the documentation so it is compatible with older versions of PHP? :cool: |
:cool:
|
I've got this installed, thanks man, nice hack! ^_^
|
nice hack :) thnx
couple of days ago i spent ages gettin some stats sorted for the top 10 posters :) gonna slightly modify it if thats ok with u to show % on the topposters script. |
Yet another nice little feature by apfeifer, Thanks! ;)
|
I'm getting this error at the top of my forum's profile page:
Quote:
|
What is you line 1151?
Mine has nothing to do with this edit.. but talks about Moderators.. Did you install another hack at the same time as this one? If I ever have a problem, I like to take Araxis Merge 2001 Professional and open my file thats having problems and a orig.. from the zip file.... to see what could be wrong.. |
Ahh, it was because there were no threads on the entire board ;)
Thank you! |
Great hack!
Could someone help me figure out how to put this in my forumhome? I tried just inserting the "$percentoftotalposts% of total posts" but when I do that all I get is "% of total posts". Am I doing something wrong? Thanks for your help! :) |
You mean the postbit template when you make a post?
If so.. I am wondering how to also.. I palced the contents in showthread.php, but when i did, it made the pages 427 pages long for some reason... Any help?? Ciao |
[high]* inetd installed this hack
[/high] Good hack! :) |
Quote:
Code:
$countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post'); after this Code:
$numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user'); GL! |
Which file am I supposed to edit to put the percentage in the postbit?
|
to also get the threads per day (assuming you've installed this hack and tubedog's hack according to this info: https://vborg.vbsupport.ru/showthrea...068#post198068)
in member.php FIND PHP Code:
PHP Code:
PHP Code:
PHP Code:
than, in the getinfo template REPLACE PHP Code:
PHP Code:
PS: see the screenie to see what I mean ;) |
Installed on 2.2.5. Thanks for this hack!
|
For the users with low posts, their percentage seems to be accurate, but for some reason I and others with high posts are getting a percentage over 100, see attachment:
|
Quote:
just read the first few posts, and see if that can help you... |
I guess my question was missed.
How can I display this percentage in the postbit? |
All times are GMT. The time now is 05:02 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|