PDA

View Full Version : Statistics Modifications - Dream's Forum Statistics


Pages : 1 [2]

Dream
11-06-2007, 10:57 PM
My monthly registrations are also 0s for some reason... it was working until this month.

Carlos2
11-06-2007, 11:58 PM
Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Anybody knows whats the problem when i try to see registrations statistics?

control1110
11-07-2007, 10:19 AM
I happened on the first of this month thats all I know it worked fine before that

Carlos2
11-07-2007, 02:48 PM
Cange:
$percent = ($total_users / $monthly_total) * 100;

to

If ($monthly_total > 0){
$percent = ($total_users / $monthly_total) * 100;
}


(in File statsmod/statistics_registrations.php )The same as doogie, the error doesnt appear now but all the month statistics are in 0, an also are 0 if you try to look them in admin panel :(

Carlos2
11-07-2007, 08:37 PM
I also dissable the product, and the registraitions of last months are dissapeared...

This is a very bad thing :(

Carlos2
11-08-2007, 02:30 PM
Today is working propertly again. Very strangeeeeee.

max8028
11-17-2007, 06:26 AM
where would I import the statistics.php if i am using domainnames as my host.

I really need help on this one.

I am getting this error:

Warning: include(statsmod/statistics_general_stats.php) [function.include]: failed to open stream: No such file or directory in /statistics.php on line 203

Warning: include() [function.include]: Failed opening 'statsmod/statistics_general_stats.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /statistics.php on line 203

What Now?

Dream
11-17-2007, 08:57 AM
Did you upload the directory statsmod/ ?

max8028
11-17-2007, 05:52 PM
working thanks ! Looks good too

centralss
11-17-2007, 08:28 PM
registration stats get this error at top of page. Shows no stats for the rest of the months of the year. Does show the stats for the current month. Any ideas?

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

TeknoSounds
11-17-2007, 09:37 PM
ditto on that one ^^

Audentio
11-17-2007, 11:41 PM
Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

I got that when I clicked on Registrations.

Other than this error, its a great mod.

EDIT: After re-reading the thread I see that I am not the only one with this problem XD.

Elenna
11-18-2007, 02:30 AM
Quick fix for the above, edit the /statsmod/statistics_registrations.php

Change line 105
$percent = ($total_users / $monthly_total) * 100;

to

if (empty($monthly_total)) { $percent = 0; } else { $percent = ($total_users / $monthly_total) * 100; }

TeknoSounds
11-18-2007, 04:13 AM
sweet thanks Elenna :)

tho...continued with another error on line 110... replaced the daily and monthly percentage lines. Daily shows up fine now, but monthly doesn't display anything at all...its all 0's.

ideas?

Elenna
11-18-2007, 01:41 PM
Not sure on that, sorry :( My board is new, so my should all have 0 in Monthly. lol

That was a quick fix that worked for me, so if someone else can edit it to work for them, good:)

Artes_Marciales
11-19-2007, 10:26 AM
Great!! :)

doogie1775
11-19-2007, 02:55 PM
Now I don't have any registration stats for some reason. However, if I go into the AdminCP, they are all there for daily and monthly as well? Otherwise, a great MOD - but would love to get the registration stats working correctly.

murrtex
11-23-2007, 07:45 PM
thanks hilfe-forum

expatdirectory
11-24-2007, 03:34 AM
Works a dream - installed without probs here (http://forums.theexpatdirectory.com/statistics.php)

Would be nice to know the strings used for content in each statistic i.e new member or top posters over past week etc.

This could then be placed into a left/right column as interest for users. Just a thought.

Clicked Install

TomasDR
11-24-2007, 04:23 PM
I found the problem with Monthly registrations stats.

The section in statistics.php that computes the year(s) is incorrect:
// calc year to get registrations from
$year = $today['year'];
if ($howmany > $today['month']) {
$year--;
}
$year = $year - floor(($howmany - $today['month']) / 12);

// calc month since to get registrarions from
$month = $today['month'] - ($howmany - 1);
if ($month < 1) {
$month = 12 + ($month % 12);
}


The statement on line 1293 is incorrect.

$year = $year - floor(($howmany - $today['month']) / 12);

As mentioned in other posts this just started happening. It's because the default results number is 10 & November is the 11th month. What happens is if the results # is lower then the current month the PHP function "floor" rounds down but it's rounding down a negative number and then when you subtract a negative # you are adding, so it's getting registration stats for the year 2008!

$year = $year - floor(($howmany - $today['month']) / 12)
$year = $year - floor((10 - 11) / 12)
$year = $year - floor((-1) / 12)
$year = $year - floor(-0.0833)
$year = $year - -1
$year = 2007 - -1
$year = 2008

A simple fix is to use the "intval" function rather then "floor", which just returns the integer which is what was being attempted with the "floor" function and when the result is (-0.0833) it will return 0 which will work.

// calc year to get registrations from
$year = $today['year'];
if ($howmany > $today['month']) {
$year--;
}
$year = $year - intval(($howmany - $today['month']) / 12);

// calc month since to get registrarions from
$month = $today['month'] - ($howmany - 1);
if ($month < 1) {
$month = 12 + ($month % 12);
}

TeknoSounds
11-25-2007, 03:18 AM
works great ty muchly!!!

Merrillizer
11-27-2007, 04:02 AM
Thanks you TomasDR for the fix! I had just noticed a few minutes ago that I was getting that error when looking at registrations. I edited my statistics.php as you stated and it's back to normal. :D

croportal
11-27-2007, 11:55 AM
Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

TeknoSounds
11-28-2007, 12:45 AM
croportal, please see the posts on the previous page, theres a fix

TomasDR
11-28-2007, 03:40 PM
I sent Dream a PM and I am awaiting his reply. He states his code is all reusable now but I wanted to offer him some additions I made first otherwise I will be uploading an add-on to the statistics add-on.

I added:

The Post Groan Hack (https://vborg.vbsupport.ru/showthread.php?t=129975) (which compliments the Thank You hack)
Who has read a thread (https://vborg.vbsupport.ru/showthread.php?t=122594) (which I feel gives a better rating for thread views, then just the vBulletin view #)
VB Image Hosting (https://vborg.vbsupport.ru/showthread.php?t=123481) (a stats page similar to attachments showing: top uploaders, recent files, total files, total size, avg filesize)Of course each add-on is turned off by default.

I would be open to adding other popular add-ons.

JohnnieOO
11-29-2007, 02:34 PM
OK, I am a complete idiot, how do I make the changes suggested by ThomasDR?

Johnnie

nureeves
11-30-2007, 04:34 AM
So, just update the mod !!
I can't edit php file myself .. hehe

GBU All !!

tekguru
12-01-2007, 03:33 PM
Sounds good Thomas - can't wait!

doogie1775
12-03-2007, 07:25 PM
I found the problem with Monthly registrations stats.

The section in statistics.php that computes the year(s) is incorrect:
// calc year to get registrations from
$year = $today['year'];
if ($howmany > $today['month']) {
$year--;
}
$year = $year - floor(($howmany - $today['month']) / 12);

// calc month since to get registrarions from
$month = $today['month'] - ($howmany - 1);
if ($month < 1) {
$month = 12 + ($month % 12);
}


The statement on line 1293 is incorrect.

$year = $year - floor(($howmany - $today['month']) / 12);

As mentioned in other posts this just started happening. It's because the default results number is 10 & November is the 11th month. What happens is if the results # is lower then the current month the PHP function "floor" rounds down but it's rounding down a negative number and then when you subtract a negative # you are adding, so it's getting registration stats for the year 2008!

$year = $year - floor(($howmany - $today['month']) / 12)
$year = $year - floor((10 - 11) / 12)
$year = $year - floor((-1) / 12)
$year = $year - floor(-0.0833)
$year = $year - -1
$year = 2007 - -1
$year = 2008

A simple fix is to use the "intval" function rather then "floor", which just returns the integer which is what was being attempted with the "floor" function and when the result is (-0.0833) it will return 0 which will work.

// calc year to get registrations from
$year = $today['year'];
if ($howmany > $today['month']) {
$year--;
}
$year = $year - intval(($howmany - $today['month']) / 12);

// calc month since to get registrarions from
$month = $today['month'] - ($howmany - 1);
if ($month < 1) {
$month = 12 + ($month % 12);
}


This worked perfectly!!!! Thanks a MILLION Tomas :)

rwoscott
12-03-2007, 07:38 PM
This worked perfectly!!!! Thanks a MILLION Tomas :)What he said TomasDR.

Thanks, such a simple fix in the end.

Dream
12-04-2007, 02:16 AM
I updated the mod with TomasDR fix, and put a thanks notice for him on statistics.php.

Also I gave him permission to take this mod, modify it and release his own. I just won't add his addons by default because I won't be able to support them.

Elenna
12-04-2007, 11:24 AM
Thanks, Dream and TomasDR!

To upgrade, do we need to replace all files, or just the statistics.php? And reimport, or no?

Dream
12-04-2007, 01:54 PM
just statistics.php

Saviour
12-04-2007, 03:07 PM
Dream...

I prefer this mod over another I was using...simply becuase it doesn't intrude on any of the forum pages...it has its own page...very nice feature.

Since you have incorporated the "Thank You" stats in this mod...it would only seem fair that you include the "Groan" stats as well from this mod: https://vborg.vbsupport.ru/showthread.php?t=129975

Hope to hear back from you soon on this one, Dream...

Dream
12-04-2007, 03:11 PM
Tomas seems to have working code for the Groan hack, I won't add it because I wouldn't use it, sorry.

Saviour
12-04-2007, 03:26 PM
So how do I get this code to use in your mod?

Dream
12-04-2007, 03:34 PM
I don't have it, your best bet is to send Tomas a PM.

loonytune15
12-05-2007, 01:36 AM
Thanks for the update, look forward to seeing the new mod...

fishlore
12-05-2007, 02:12 AM
Thanks for the update! Just installed and monthly registrations are working again. Thank you.

pyd
12-05-2007, 04:47 AM
What group will I find the phrases in, in the Phrase-manager?

Dream
12-05-2007, 08:08 AM
global, they begin with statistics_ and some with dreamstatistics_

pyd
12-05-2007, 08:25 AM
global, they begin with statistics_ and some with dreamstatistics_

Found it :)
Just finished translating it all into swedish.
Just waiting for some of my users to check the translation out...

Btw. Thanks for a great mod!

Dream
12-05-2007, 10:46 AM
no problem, glad you like it.

nureeves
12-06-2007, 01:38 AM
I have replaced all file with updated one
but it doesnt change anything ... my monthly registrations still going zero :(

do i miss something?
btw, i use vb 3.6.4

Dream
12-06-2007, 03:06 AM
you just need to update statistics.php

TomasDR
12-06-2007, 04:18 AM
I have posted my version here:
https://vborg.vbsupport.ru/showthread.php?t=164479

Thank you again to Dream's hard work.

Carlos2
12-06-2007, 10:14 PM
Thanks for update ;)

rwoscott
12-10-2007, 06:43 PM
I found another issue with the registration stats. Not a major drama.

If you select Results = 23 , you get 23 months.

If you select Results = 25 , you get 25 months.

Correct so far.

However, if you select 24 months, you get 36 months,
If you select 36 months you get 48 months.
If you select 48 months you get 60 months. I see a pattern here
The additional 12 months have a date of 01/01/1970.
(see attached).

I assume this is related to December being the 12th month.

Any ideas?

Dream
12-10-2007, 07:24 PM
Try asking Tomas about this on his new mod thread

https://vborg.vbsupport.ru/showthread.php?t=164479

I haven't got the time to work on this right now, sorry.

TomasDR
12-11-2007, 04:13 AM
I found another issue with the registration stats. Not a major drama.

If you select Results = 23 , you get 23 months.

If you select Results = 25 , you get 25 months.

Correct so far.

However, if you select 24 months, you get 36 months,
If you select 36 months you get 48 months.
If you select 48 months you get 60 months. I see a pattern here
The additional 12 months have a date of 01/01/1970.
(see attached).

I assume this is related to December being the 12th month.

Any ideas?

I will look into it, BTW did you try 24 or 36 when it was November?

rwoscott
12-11-2007, 05:24 PM
I will look into it, BTW did you try 24 or 36 when it was November?

Possibly, but I don't remember. Sorry.

SuperD
12-13-2007, 12:10 AM
Thanks for the mod but where exactly to upload the statistics.php and statsmod/ folder ?

rwoscott
12-13-2007, 06:12 PM
Thanks for the mod but where exactly to upload the statistics.php and statsmod/ folder ?

statistics.php => forum/statistics.php
statsmod/ folder => forum/statsmod/

Ie. upload both to your forum directory.

SuperD
12-14-2007, 03:35 AM
Thanks

WhatChaMissin
12-15-2007, 12:43 PM
Works great
*clicks install

TomasDR
12-15-2007, 04:56 PM
Possibly, but I don't remember. Sorry.

I took a look at the functions and did the math but it all looks good. I will continue looking but it might be next month, so I can see if a different month does the same.

rwoscott
12-16-2007, 05:47 AM
I took a look at the functions and did the math but it all looks good. I will continue looking but it might be next month, so I can see if a different month does the same.

Cool, thanks mate.

rwoscott
12-17-2007, 12:43 AM
I found another issue with the registration stats. Not a major drama.

If you select Results = 23 , you get 23 months.

If you select Results = 25 , you get 25 months.

Correct so far.

However, if you select 24 months, you get 36 months,
If you select 36 months you get 48 months.
If you select 48 months you get 60 months. I see a pattern here
The additional 12 months have a date of 01/01/1970.
(see attached).

I assume this is related to December being the 12th month.

Any ideas?

I'm no php expert, but I did the following to fix this error.

In statistics.php replace
$year = $year - intval(($howmany - $today['month']) / 12);
With
$year = $year - intval(($howmany - $today['month'] - 1) / 12);

I've tested it for this month and it seems fine.

I've run through it on paper and I think it should work for other months. (fingers crossed) :up:

rokked
12-17-2007, 05:39 AM
great addon, thanks a lot for this
have it running over at
http://forums.rokked.com/statistics.php?forum=0&stats=topposters&show=10

blastup
12-25-2007, 10:54 PM
i saw the http://www.s10planet.com/forum/statistics.php in your demo

but your mod is different from that? is there a way to change into that? with all the things displayed? let me know asap thanks

TCE Killa
12-25-2007, 11:39 PM
Great hack, only thing is everytime I click Statistics now, a 404 error comes up, so I move the statistics.php to my actual rout directory and an even bigger error comes up saying error on line 46 statistics.php.... Atleast with the other error, the page isn't found until I get assistance, thanks. I have uploaded the forum folder and all of its contents to my rout directory and imported the product and changed the optional settings, just an error - page not found when I actually click the statistics link. Any help would be highly appreciated, thanks.

TCE Killa
12-25-2007, 11:56 PM
Lol nevermind, I managed it, great hack.

rwoscott
01-06-2008, 08:24 AM
I'm no php expert, but I did the following to fix this error.

In statistics.php replace
$year = $year - intval(($howmany - $today['month']) / 12);
With
$year = $year - intval(($howmany - $today['month'] - 1) / 12);

I've tested it for this month and it seems fine.

I've run through it on paper and I think it should work for other months. (fingers crossed) :up:
I've checked this month and all seems to be OK with the above fix.

Elenna
01-09-2008, 02:52 PM
I'm not sure that the Exclude Usergroup ID thing is working for me.

We have 115 registered users. I have excluded 6 usergroup IDs from Statistics.

In the User listing (General Statistics) removes the users properly; however, other statistics (user profiles, age) is not taking the excluded groups into account, and is displaying statistics for all of my 115 members.

Dream
01-20-2008, 08:50 PM
In some places I believe the exclude usergroup is not taken into account because of design decisions, but I can't remember now (it's been 1 year).

Anyone test this on 3.7?

Nynaeve
01-28-2008, 12:38 AM
Love the hack, but I ran into this problem after installing it. Here's the error message I get from the statistics.php page:

Warning: main(statsmod/statistics_general_stats.php) [function.main]: failed to open stream: No such file or directory in /statistics.php on line 206

Warning: main() [function.include]: Failed opening 'statsmod/statistics_general_stats.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /statistics.php on line 206


And I can't figure out what I did wrong. Any ideas/clues/suggestions?

Dream
01-28-2008, 12:10 PM
Did you upload the statsmod directory?

Yuuko_Kitaiko
01-28-2008, 08:54 PM
I'm a second admin on the same forum, so I'm doing most of the uploading. The statsmod directory...all the files in the statsmod folder are uploaded to our server, as well as the statistics.php file. Was there anything else in there, becuase I didn't see anything.

I'm thinking it might be a problem with how they were uploaded, but if it's the lack of this file, then that would make it worlds easier, I suppose.

Dream
01-28-2008, 09:32 PM
The error is that statistics.php is not finding the files in statsmod/

Where did you upload both?

Yuuko_Kitaiko
01-29-2008, 12:22 AM
Edited all that because it's not worth looking at now. Yeah, the directory was the problem, and I got that all sorted out. Thank you so much for your help. This is a whole first time thing with working on vBulletin for me, so I'm a bit out of sorts with it.

Anyway, thanks again.

futuredood
01-29-2008, 09:05 PM
How do you get it to show all the stats at once like this site, rather than having to select it from the drop down?

http://www.s10planet.com/forum/statistics.php

Dream
01-30-2008, 03:16 PM
thats an old version that I dont have anymore.

Peejay
02-17-2008, 03:33 PM
Just installed, great stuff to satisfy all the 'stato's out there, love it.

Here's our working version http://clubaristo.net/forums/statistics.php

Feel free to add it to your list of live demo's.

Many thanks.
PJ

RedGTiVR6
02-27-2008, 05:38 PM
Anyone test this on 3.7?


bump?

I'd like to know as well.

Dream
03-02-2008, 05:24 PM
This seems to be working fine on 3.7, no errors so far.

DiverTree
05-10-2008, 05:51 PM
This seems to be working fine on 3.7, no errors so far.
workin fine for me too ... 3.7.0. thanks :)

Dream
05-10-2008, 05:57 PM
Yeah it's working for me too. Maybe some day I'll update it to add Blog and Profile stats. Right now I'm really busy with other projects of mine.

DiverTree
05-10-2008, 06:06 PM
Yeah it's working for me too. Maybe some day I'll update it to add Blog and Profile stats. Right now I'm really busy with other projects of mine.that would be cool, but i dont even have those features right now. im off to update my spider list ;)

RedTrinity
05-14-2008, 09:04 AM
I would really appreciate any help with this error...

Warning: Division by zero in [path]/includes/functions.php(5501) : eval()'d code on line 102

Just installed for the first time on 3.7 :confused:

paulnis
06-21-2008, 07:45 PM
Any chance of upgrading t his to 3.7?

Sgt Pepper
06-22-2008, 06:33 AM
wow u guys r having alot of trouble with this......i installed first go and got it easy......Dream added very simple rules....cant see how u wud get it wrong

rwoscott
06-24-2008, 09:13 AM
I would really appreciate any help with this error...



Just installed for the first time on 3.7 :confused:

Try this fix (https://vborg.vbsupport.ru/showpost.php?p=1388706&postcount=270)

Elenna
06-28-2008, 06:45 PM
In some places I believe the exclude usergroup is not taken into account because of design decisions, but I can't remember now (it's been 1 year).


If I wanted to modify it to properly exclude the excluded user groups, where might I do that? And am I allowed to, if I don't release the changes?

Dream
06-28-2008, 09:10 PM
If I wanted to modify it to properly exclude the excluded user groups, where might I do that? And am I allowed to, if I don't release the changes?
Not sure sorry, haven't looked at the code for a while now, and yes you can modify it at your hearts content.

SVTCobraLTD
08-29-2008, 12:35 PM
You say not to use it on a big forum. What do you classify as a big forum?

voter
01-19-2009, 12:53 PM
You say not to use it on a big forum. What do you classify as a big forum?
I have trouble, as of my forum got big in sense of amount of users and search bots 100-200 surfing forum at same time, which makes my CPU crazy especially from a lot of queries

SELECT count(*) AS 'PostsThisMonth'
FROM vbpost
WHERE YEAR(FROM_UNIXTIME(dateline)) = YEAR(NOW())
AND MONTH(FROM_UNIXTIME(dateline)) = MONTH(NOW())

This is really too cpu intensive mode.

Dearm I really didn't understood why still a lot of mentioned queries are runing, even if I disable access of guests and bots to statistic.

akee
12-31-2009, 08:35 AM
Maybe do you upgrade it to vb4?

Dream
12-31-2009, 11:22 AM
Sorry, but it's not likely. Very few people installed this mod, and it's not even used that often in my own forums.

But anyone is allowed to update this script to 4.0 if they want.

Art Andrews
04-23-2010, 05:48 PM
That is a shame because this is one of the best and cleanest little plugins that we use. :(

Dream
04-24-2010, 05:04 AM
I think Val's advanced forum statistics has most of the statistics of this mod, I'm using that one now.

acast
01-03-2013, 11:14 AM
I think Val's advanced forum statistics has most of the statistics of this mod, I'm using that one now.Well, that's not so true, i think this plugin was the best plugin of vbulletin stats ever.