vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Statistics Modifications - Dream's Forum Statistics (https://vborg.vbsupport.ru/showthread.php?t=140812)

murrtex 10-31-2007 08:31 PM

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

what will we do?

doogie1775 11-01-2007 06:41 AM

As always, another fantastic Mod from Dream - Thank you!

Dream 11-02-2007 11:57 AM

You are welcome, glad you liked it :)

Sorry murrtex, this mod has some bugs depending whether you have some missing information. Right now I don't have time to fix it, sorry.

nureeves 11-04-2007 01:33 AM

I got same problem with Murtex. And all monthly registration value is zero.

c'mon Dream .. this is such wonderful mod,
i thought you should fix it immeadiately, to maki it perfect :D !!!

GBU

hilfe-forum 11-04-2007 09:54 AM

Quote:

Originally Posted by murrtex (Post 1373003)
Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

what will we do?

Cange:
$percent = ($total_users / $monthly_total) * 100;

to

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


(in File statsmod/statistics_registrations.php )

doogie1775 11-05-2007 06:31 AM

Quote:

Originally Posted by hilfe-forum (Post 1375455)
Cange:
$percent = ($total_users / $monthly_total) * 100;

to

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


(in File statsmod/statistics_registrations.php )

I ended up having the same problem as murrtex, but the obove fixed the error - thank you!

However, I am showing zero for the monthly registration stats? Any idea why?

Thnx!

control1110 11-05-2007 01:04 PM

Why does this error occur? I am having the same issue it was working fine before

JohnnieOO 11-06-2007 12:26 PM

Yep, same error for me (worked fine before)
Warning: Division by zero in /statsmod/statistics_registrations.php on line 105

I have a very small board and this error occured, I THINK, right after I deleted a spammer. Since then, I get this error. The dailey registrations appear OK, but the monthly registrations are all zero.

Johnnie

yoyoyoyo 11-06-2007 01:14 PM

so this statistics mod doesn't load a user's browser with any cookies, right?

also - in viewing some of the example sites it seems that the monthly registration stats are faulty, since it shows recent registrations, but the monthly stats show none.

Also wondering if there is any way to limit the countries of registered users to only those that are really registered, so the list isn't filled with a bunch of zeroes? for instance, if I have no users from Zimbabwe registered, can the list be fixed to not display that country?

fury 11-06-2007 07:33 PM

Can anyone suggest some table indexes for me to add to make this stuff go faster? I notice a long loading time on my board, and anticipate if the statistics page ever gets crawled by a search engine spider, my server will be brought to its knees... I could just declare statistics.php in robots.txt but I think I'd rather just make the stats faster to begin with.

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

Quote:

Originally Posted by hilfe-forum (Post 1375455)
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

Code:

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
Code:

$percent = ($total_users / $monthly_total) * 100;
to

Code:

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

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:
PHP Code:

  // 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.

PHP Code:

$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.

PHP Code:

  // 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 (which compliments the Thank You hack)
  • Who has read a thread (which I feel gives a better rating for thread views, then just the vBulletin view #)
  • VB Image Hosting (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

Quote:

Originally Posted by TomasDR (Post 1388706)
I found the problem with Monthly registrations stats.

The section in statistics.php that computes the year(s) is incorrect:
PHP Code:

  // 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.

PHP Code:

$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.

PHP Code:

  // 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

Quote:

Originally Posted by doogie1775 (Post 1394239)
This worked perfectly!!!! Thanks a MILLION Tomas :)

What he said TomasDR.

Thanks, such a simple fix in the end.


All times are GMT. The time now is 12:39 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.01722 seconds
  • Memory Usage 1,856KB
  • 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
  • (3)bbcode_code_printable
  • (6)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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