Jump to content

PHP warning (normal importance issue)


Recommended Posts

[b]Warning[/b]: Division by zero in [b]/home/magicdue/public_html/ui/userprofile/load_profile.php[/b] on line [b]380[/b]

On the character page at the bottom of the screen. Because the total days does not increment in the DB probably or column name is wrong.

[b]See also :[/b]

This account was opened on (DD.MM.YYYY H:M): [b]13.08.2011 14:12[/b]

Activity days: [b]0% [/b] (A total of 2 out of 0 days)

And I was active both days.

I tried refreshing with new cache (CTRL + SHIFT + R in mozzila) and still not fixed.

Edited by living_puppet
Link to comment
Share on other sites

  • Root Admin

there was a post about this somewhere else, Its because it divides the active days by total days(which is zero) so the result is undefined, I believe Mur called it a "feature" But really it should be caught and not just show an error.

Link to comment
Share on other sites

I searched the forums a little but I didn't find it anywhere else.
I know what caused the problem but it is strange because active days are good and total days are not.

Just make a cron on a 24h schedule with runs at 00:00 to increment total days with 1 or integrate it in another existing cron with has that schedule.
But you have probably done exactly that, so the problem is with the initial date written first in the DB.

Just my opinion and advice, nothing more

Link to comment
Share on other sites

[size=3][font=verdana,geneva,sans-serif] :D:D:D i was about to cry even without Rendrils explanation. I love the way you fix bug's, I really do! but try to understand the ordinary man's thoughts. it's like:[/font][/size]

[size=3][font=verdana,geneva,sans-serif]- you bought one cup of tea, but you drank two![/font][/size]
[size=3][font=verdana,geneva,sans-serif]- (wth?!)[/font][/size]
[size=3][font=verdana,geneva,sans-serif]- pay for them!..[/font][/size]

[size=3][font=verdana,geneva,sans-serif]i'm not sure about implementation, but c'mon, i'm pretty sure you can put "$activeDays = '(select whatever from whatever)'; if ($activeDays == 0) $activeDays = 1; else { (ordinary way) }" instead of skipping else statement :D[/font][/size]
[size=3][font=verdana,geneva,sans-serif]and yeah, i know, it's way more complicated, but believe me - i'm not judging your voluntary job or something, it's just a friendly teasing :P[/font][/size]

Edited by duxie
Link to comment
Share on other sites

The implementation works something like this (and correct me if I'm wrong)

The server keeps track of the exact moment that you opened your MD account. Each day, at the exact time you opened the account, your total day counter updates itself.

However your active day counter updates whenever you log in on a given day. If you don't log in on that day, you miss a day. So for the first few days you'll gain two active days before 48 hours has elapsed.


Link to comment
Share on other sites

  • Root Admin

And in many cases before 24 hours have elapsed. But we DID have this conversation on the forum, and i just found it using the magic SEARCH!


[url="http://magicduel.invisionzone.com/topic/9008-activity-days/page__view__findpost__p__78287"]Murs Reply[/url]

Link to comment
Share on other sites

  • 4 months later...
This topic is now closed to further replies.
  • Forum Statistics

    Total Topics
    Total Posts
  • Recently Browsing

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
  • Recent Event Reviews

  • Create New...