PDA

View Full Version : [Release vB2.0] PM Stats 1.0


the_sisko
20 Apr 2001, 20:09
PM Stats 1.1 Hack | 28.05.2001-22:10 CET

What does it do:
This Hacks show some stats for your PM's, which includes:

Version 1.0
It show per page all users who stores PM's in the database, sort by users with the most PM's.
It shows: total PM's, new PM's and unread PM's
Total PM's in database
How many Users with at least one PM are in db
Users PM average
it highlight users who stores more then 90% of the current PM quota, so you can find those users fast.
Updated Version 1.1
link to userprofile for direct edit (this one was requested)
delete all PM's of one user (this one was requested)
the last part is a little big tricky to explain: you can know see the Last Visit, Last Activity, Last Post of an user in different colors. What is it good for? Lets say you can easy see if an user is inactive and you can delete his PM's to keep your database clean. If there need to explain more, take a look at the screenshot or ask me and I'll try to explain it more.


I found this very usefull so I can trackdown which user stores how many PM's and how to set the PM quota. This idea is only usefull for those of us, who had some server limitation and like to find ways to keep the diskquota of the database small.

For version: vBulletin 2.0.0 (should work with RC2 and RC3, but for odler versions the CSS is missing).

Files needed: pmstats.php

Files to edit: pmstats.php

Templates to create/edit: none

Instructions are in pmstats.php file.

Screenshot http://www.studenten-city.de/stf/pmstats.jpg

FEEDBACK WANTED! :D Likes/dislikes/modification requests all gladly accepted.

rockergrrl
20 Apr 2001, 20:19
Works Great!!

I've been wondering about the numbers of PMs my girls have have storing... :)

Thanks!!

the_sisko
20 Apr 2001, 20:21
For those of you who want a link form the CP:

In /admin/index.php find first instance:<tr><td><hr></td></tr>under it place:<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr bgcolor="#3F3849"><td><font color="#BCB6CD">
<b>PM Functions</b>
</font></td></tr></table>
<a href="pmstats.php?s=<?php echo $session[sessionhash]; ?>">PM Stats</a><br>
</td></tr>reupload it!

tubedogg
20 Apr 2001, 20:24
I love it! :)

Even if you did borrow ;) my release wording.

the_sisko
20 Apr 2001, 21:41
Originally posted by tubedogg
I love it! :)

Even if you did borrow ;) my release wording.

Thx :) and sorry for taking your release wording :D, but were the best I could find!!!:)

SystemLogic
20 Apr 2001, 23:26
Looks great!!!

bokhalifa
21 Apr 2001, 04:06
Great ;)

Blue2000
30 Apr 2001, 01:35
this is very nice Sisko.

i know its only a stats but is there anyway you could turn it into a maintains/stats hack and add a delete all read messages next to there names? (just an idea) great hack tho dude

the_sisko
30 Apr 2001, 19:57
Originally posted by Blue2000
this is very nice Sisko.Thx :)Originally posted by Blue2000
i know its only a stats but is there anyway you could turn it into a maintains/stats hack didn't get it?:confused: Can you explain it a little more for me? Originally posted by Blue2000
and add a delete all read messages next to there names? (just an idea) great hack tho dude Great Idea, will try to add it in the next few days!

Blue2000
01 May 2001, 13:47
Originally posted by The_Sisko
Thx :)didn't get it?:confused: Can you explain it a little more for me?


yeah you did get it :D


Great Idea, will try to add it in the next few days!

NickyNet
01 May 2001, 20:37
great hack..

thx

Flare
01 May 2001, 21:11
Nice hack! Thank you very much :)

jojo85
03 May 2001, 11:49
It's a really nice idea cause at the moment there were only the page and threads stats
thx youuu

zarkov
23 May 2001, 16:48
Thanks for this i could do with this to see who's doin what with the space

GhostMaster
26 May 2001, 17:15
can Admin empty, insert also a User pm box?
that would not badly be if that possible were

krohn
28 May 2001, 01:32
dear god.... We've got over 5k PM's sitting in our db! the average user has 10PM's

the_sisko
28 May 2001, 09:36
Originally posted by GhostMaster
can Admin empty, insert also a User pm box?
that would not badly be if that possible were

Yes he cann do so in the next version...I forgot to publish my ready next version. I'll post it when I'm at home.

Features:

Admin can now delete all PM's of a user with one click
Some kind of grafic stats (colors) about how active a user is, to chose if you like to delete the users PM's .


Will check older posts if there is more to do, if not, I will release it this evening (CET +1)

jucs
28 May 2001, 13:09
Did anyone recommend this for 2.1? It should be!:)

the_sisko
28 May 2001, 22:18
UPDATED VERSION 1.1

Go to first post in this thread for more infos!!!!!

jucs
29 May 2001, 00:05
3 users have a last post of:

31-12-69
19:00:00

It shows these in red. Not likely they posted in 1969! :)

And there is a .php3 extension used in the file so if one doesn't use php3 extensions it will give you an error when clicking on the links for users.

Great hack. This should be put in the next release.

krohn
29 May 2001, 03:09
How about something to auto delete all PM's stored by people who haven't visited in like a month?

Being able to delete things sure does help! Good job man :)
What are your plans on expanding even further? something like deleting messages older than like 2 months or something?

Vbulletin should be able to limit how long PM's are stored...

Blue2000
29 May 2001, 03:11
nice update mate well done

Blue2000
29 May 2001, 03:26
dude when i press 2 at the top of the page i get a page could not be displayed error

krohn
29 May 2001, 03:34
yeah I noticed a few .php3 tags in the code

do a quick search for .php3 in the code and delete the 3... it's in either 2 or 3 places I can't remember. But everythings working great for me after that quick fix.

try the file I attached...

the_sisko
29 May 2001, 09:14
I've updated the zip file and changed all .php3 to .php

jucs
29 May 2001, 11:37
3 users have a last post of:

31-12-69
19:00:00

It shows these in red. Not likely they posted in 1969!

the_sisko
29 May 2001, 13:42
Did you import from UBB?

RobAC
29 May 2001, 14:14
First of all nice job!!!

Second, I have that same problem with the last post showing up in 1969 for users that have never posted. I imported from UBB and ran an update script that Tubedogg told me about to fix the dates, which worked in some areas of my forums, but not in all. Any ideas?

the_sisko
29 May 2001, 15:21
RobAC and jucs,

try to go and edit one of the 1969 user in the CP and take a look at last post time. Does it be the same prob with the time, or only in my hack?

RobAC
29 May 2001, 15:43
No, it's not only in your hack but in other parts of the standard CP.

jucs
29 May 2001, 17:59
It is in the regular CP readout as well...

I did a clean install of V2.0. No importing from UBB was performed.

Now what?

Is this a V2.0 bug of some sort?

jucs
29 May 2001, 18:34
Last Post Bug in V2.0? (http://www.vbulletin.com/forum/showthread.php?postid=116787#post116787)

eva2000
29 May 2001, 19:41
i just installed v1.1 and it's great but what's this about a bug ?

RobAC
29 May 2001, 19:53
Originally posted by eva2000
i just installed v1.1 and it's great but what's this about a bug ?

Well, looks like we have 2 separate bugs going on. One was the use of php3 extensions which was causing a problem when trying to view the next page of pms, but Sisko fixed that and re-uploaded the pmstats.php file to the top of this thread this morning I believe. So...basically, that's fixed, but the next one is what a lot of us have been seeing and that's the 1969 dates. I don't think it's got to with Sisko's hack, but rather a UBB importation problem for those of us who imported from UBB. I could be wrong.

the_sisko
29 May 2001, 21:27
All ZERO post users got this timestamp.......!

Blue2000
31 May 2001, 12:45
nice one dude now you have fixed that php3 code it works great

the_sisko
31 May 2001, 12:48
Just want to mention, a lot of people ask me to modify the hack to read the PM of an user.

I'll wont do this! Private means private and so it should be. Please stop asking me for this one!

etones
31 May 2001, 13:16
Nice Hack Sisqo... great stuff.

I look forward to your upgrade on Overgrows Mod log hack... nice.

lichtflits
01 Jun 2001, 14:05
when I deleted all post of a member I'll see this: All PM's from .... has been deleted!
that ok.
but is it posible that the page automatic going back to the main pmstats page? (admin/pmstats.php)

cditty
09 Jun 2001, 20:07
I have seen mention of colors but no definition of them. What do the the colors stand for?

Thanks.

Nice mod.

Chris

zarkov
10 Jun 2001, 10:26
the lastactivity, lostpost & lastvisit date & times are colour coded Green for less than a week, Blue for 1 - 2 weeks old, and red for any date older that 14 days.

zarkov
10 Jun 2001, 10:47
Ive come up with this to stop the date problem
In pmstats.php

Find

$lastpost = strftime("%d-%m-%y<br>%H:%M:%S", "$user[lastpost]");

and replace with

if ($user[lastpost]==0){
$lastpost = "Never Posted";
} else {
$lastpost = strftime("%d-%m-%y<br>%H:%M:%S", "$user[lastpost]");
}

All it does it looks for a dateline of 0 (no date) and sets $lastpost to Never Posted instead of the date.

ibeblunt
20 Jun 2001, 19:27
If the originator of this hack is reading this, how about a hack to be able to delete all PM's over a certain amount of days? Like delete PM's over [x] days old.

Jpp
21 Jun 2001, 19:43
Warning: Division by zero in C:\HTTPD\upload\admin\pmstats.php on line 59

can anyone tell me why??

the_sisko
21 Jun 2001, 19:53
You don't have any PM's on the board, so you got this error. I need to add a if command for fixing this one...

Jpp
21 Jun 2001, 22:10
Originally posted by The_Sisko
You don't have any PM's on the board, so you got this error. I need to add a if command for fixing this one...

But i do!! I got 122 Pm's in the database, 19 users with at least one

the_sisko
21 Jun 2001, 22:58
Did you installed this other stats hack you shows how many active user there are? This hacks adds a variable $limit to the boards, which I'm using too! You need to change then $limit in pmstats (all of it) to something else: e.g. $limit_pm

Jpp
21 Jun 2001, 23:07
Originally posted by The_Sisko
Did you installed this other stats hack you shows how many active user there are? This hacks adds a variable $limit to the boards, which I'm using too! You need to change then $limit in pmstats (all of it) to something else: e.g. $limit_pm

Yes it helped :) Thank's a lot

pwr_sneak
04 Jul 2001, 15:31
Hi,

i just installed this hack on my Board for the first time an tried to access the stats. I was wondering why it didn't show up, checked my server and saw one HTTP-Process using 150 Megs of RAM....

After restarting Apache i took a look at the script ;(
There are lots of MYSQL Queries returning huge unused arrays.

I like this hack, but i have to rewrite it for my board for better performance. If this still doesn't work i will create daily static HTML Pages containing the PMStats output.

BTW my Board at http://www.amihotornot.de has 30000 Users with 270000 stored messages.

If someone is interested in the fast version of this hack, please let me know.

sneak

ldydvr
05 Jul 2001, 13:47
Always, you bet!

Anytime someone can increase performance and better something I'm all ears (and fingers and eyes)!

=-)

ibeblunt
05 Jul 2001, 16:29
I would be.

My site has over 60,000 users with 414680 posts. It's crazy these days.

Steven

JackG
11 Jul 2001, 06:07
Total PM's in database 2331

Users with at least one PM 441

Users PM average ~5

------------------------
Above is my stats. question, are these based on 'un read' messages?

Any chance of a search option ?

the_sisko
11 Jul 2001, 16:38
I know, there are many querys but I couldn't think of it to make it better at this time. I'm getting better and better maybe I should try to remake it, but the problem is to get all PM of a user in a group....I 'll take a look at it.

I have:
~1100 Members
~80000 post
~2000 PM's

so it works. I'am on my own server (PIII 800, 128MB..)

JackG
11 Jul 2001, 16:40
Good job on it The_Sisko, if you have time, you may want to add some features. It's a quality usefull hack.

ShadowTech
26 Jul 2001, 02:38
I am now getting an error after having to swap databases the forum was running on.
<<
Warning: Division by zero in c:\inetpub\wwwroot\vB\admin\pmstats.php on line 59
>>

I read higher that you said it's because there are no posts.. which I don't see that as the problem considering the pmstats.php file is listing the total PMs under that error as :
Total PM's in database 5440
Users with at least one PM 300
Users PM average ~18

I don't know what is causing this.. I redownloaded the pmstats file from this thread and reuploaded it trying to fix it.. but it still gets the error.. worked perfectly before the DB swap.

Sinclair
27 Jul 2001, 00:34
Originally posted by The_Sisko
...
I have:
~80000 post
...

90000 Posts! ;)

Sinclair