#16553 - 01/30/08 05:29 PM
small problem
|
Jestar
Grape Nuts
Registered: 01/30/08
Posts: 25
|
Offline
|
|
on the login page i get a small error at the top, it does not stop me from playing but it is there.
Error: Warning: Division by zero in /home/www/dragonknight3.freehostia.com/lib.php on line 208
Warning: Division by zero in /home/www/dragonknight3.freehostia.com/lib.php on line 210
This is what i have on those lines:
Line 208: $stathp = ceil($userrow["currenthp"] / $userrow["maxhp"] * 100);
Line 210: $stattp = ceil($userrow["currenttp"] / $userrow["maxtp"] * 100);
Im new to php so bear with me if its a simple fix.
Thanks in advance.
|
|
Top
|
|
|
#16554 - 01/30/08 05:35 PM
Re: small problem
[Re: Jestar]
|
AnmanIndustries
Cookie Crisp
   
Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth
|
Offline
|
|
it means exactly what it means. Some number somewhere is trying to divide by 0. Since its happening when you have a devide by symbol ( / ) its safe to assume one of those $variables there is a 0. Which it shouldnt be. Neither of those variables can ever be 0 when the page loads.
|
|
Top
|
|
|
#16555 - 01/30/08 05:40 PM
Re: small problem
[Re: AnmanIndustries]
|
Jestar
Grape Nuts
Registered: 01/30/08
Posts: 25
|
Offline
|
|
how come it only happens on the log in page? and not on evrey page then?
|
|
Top
|
|
|
#16556 - 01/30/08 05:43 PM
Re: small problem
[Re: Jestar]
|
AnmanIndustries
Cookie Crisp
   
Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth
|
Offline
|
|
? It shouldnt show up on the log in page. Why would it show a users hp bars on the log in page? Particularly when no user is logged in? Thus, why those variables are 0. Sounds like youve been messing with some code.
|
|
Top
|
|
|
#16558 - 01/30/08 05:52 PM
Re: small problem
[Re: Jestar]
|
AnmanIndustries
Cookie Crisp
   
Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth
|
Offline
|
|
For starters, youre using Vista. That is your number one problem.
Seccond, you are using Internet Explorer, that is your number two problem.
Third, most mods suck. Try a fresh install and see what happens. It will probably work.
|
|
Top
|
|
|
#16559 - 01/30/08 05:53 PM
Re: small problem
[Re: AnmanIndustries]
|
Jestar
Grape Nuts
Registered: 01/30/08
Posts: 25
|
Offline
|
|
haha, i dont mind vista, and i have had no issues with IE7 so far. AS for the fresh start, it will work, because i never had the error before i installed the mods, so do you have any idea were i should look for the variable thats being divided by 0? or should i just go thru the mods i added till i have found it?
|
|
Top
|
|
|
#16560 - 01/30/08 05:57 PM
Re: small problem
[Re: Jestar]
|
AnmanIndustries
Cookie Crisp
   
Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth
|
Offline
|
|
Ill tell you right now, Vista is the bane of windows users and is converting more and more people to Apple.... Seriously.... I hate Vista more than a mac... mrrr. And IE7 is shit.. FUll stop. I use both at work heaps and it is worse than IE6.
Obviously, one of the mods you installed DOESNT work properly. Becasue its processing the hp bars for some reason when it shouldnt be. All the values in your userrow are not set when you arent logged in, so the code will treat them as 0. So you might have just installed them wrong or accidently deleted something you werent suppose to. LIke a check to see if youre logged in before the hap bar code.
|
|
Top
|
|
|
#16561 - 01/30/08 06:05 PM
Re: small problem
[Re: AnmanIndustries]
|
Jestar
Grape Nuts
Registered: 01/30/08
Posts: 25
|
Offline
|
|
Ok, thank you for your help, i will begin searching, and what do you suggest other than IE7? firefox?
|
|
Top
|
|
|
#16562 - 01/30/08 06:13 PM
Re: small problem
[Re: Jestar]
|
AnmanIndustries
Cookie Crisp
   
Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth
|
Offline
|
|
...
Duh.
|
|
Top
|
|
|
#16563 - 01/30/08 06:30 PM
Re: small problem
[Re: AnmanIndustries]
|
Jestar
Grape Nuts
Registered: 01/30/08
Posts: 25
|
Offline
|
|
hmm ok so i took your advice and started fresh, and i found out which mod was creating the problem, i installed the game mail mod first and i got the error i was getting before, but i am not sure what i am suppose to look for, help?
k so i narrowed it down to when i add this peice of code to lib.php and then upload it. I am unable to find anything wrong though.
///////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////// Checking mail //////////////////////////////////////////
$link = opendb();
include('config.php');
$table=$dbsettings["prefix"] . "_mail";
$result = @ mysql_query("SELECT * FROM $table WHERE UserTo='$userrow[id]' AND STATUS='unread'", $link);
$num_rows = mysql_num_rows($result);
if ( $num_rows > "0")
{
$userrow["check_mail"] = "<a href=\"mail.php\">Mail [".$num_rows."]</a><br />";
}
else
{
$userrow["check_mail"] = "<a href=\"mail.php\">Mail</a><br />";
}
////////////////////////////// End Checking mail //////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
|
|
Top
|
|
|
#16564 - 01/30/08 07:40 PM
Re: small problem
[Re: Jestar]
|
AnmanIndustries
Cookie Crisp
   
Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth
|
Offline
|
|
i once installed this mod with my DK game years ago. There hsouldnt be any issues with it.
|
|
Top
|
|
|
#16565 - 01/30/08 07:55 PM
Re: small problem
[Re: AnmanIndustries]
|
Jestar
Grape Nuts
Registered: 01/30/08
Posts: 25
|
Offline
|
|
well as soon as i remove the mod the error is gone, and when i add it, its there.
|
|
Top
|
|
|
#16566 - 01/30/08 08:06 PM
Re: small problem
[Re: Jestar]
|
AnmanIndustries
Cookie Crisp
   
Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth
|
Offline
|
|
Then either you arnt installing it properly or its conflicting with another mod.
|
|
Top
|
|
|
#16567 - 01/30/08 08:27 PM
Re: small problem
[Re: AnmanIndustries]
|
Jestar
Grape Nuts
Registered: 01/30/08
Posts: 25
|
Offline
|
|
maybe im installing it wrong, ill go through it again, it is not conflicting with another mod for sure though, i have a fresh copy of DK istalled and the tried to install the mod, and i would get the errors, the mod still works thouugh, like the errors dont stop me from playing the game or using the mail, they are just kinda there.
|
|
Top
|
|
|
|
|