WarcraftReamls.com
  FAQFAQ    SearchSearch    MemberlistMemberlist    UsergroupsUsergroups   RegisterRegister 
  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Log inLog in 
Help on division by zero

 
Post new topic   Reply to topic    WarcraftRealms.com Forum Index -> WarcraftRealms Developers
View previous topic :: View next topic  
Author Message
nekromant



Joined: 07 Jul 2005
Posts: 21
Location: Galiza
WR Updates: 234,980
nekromant WR Profile

PostPosted: Mon Nov 27, 2006 4:47 am    Post subject: Help on division by zero Reply with quote

I have used a data export script some time ago, but on a new hosting, now it says "Warning: Division by zero", I have inspected the code but I can see where the error is, can you help me, please? I'm a PHP newbie...


http://www.prioratodedarnassus.com/census/index.php


Code:
<DOCTYPE>
<html>
<head>
<title>WoW Server - Census - patrocinado por WarcraftRealms.com</title>
<meta>
<meta>
</head>



<style>td.bar0{  font-family: Verdana; color: #000000;   font-size: 10px;  vertical-align:bottom;text-align:center;padding-left: 2px;padding-right: 2px; width:40px;}
img.raceimg0{ width:40px;}</style>
<style>td.bar1{ font-family: Verdana; color: #000000;   font-size: 10px; vertical-align:bottom;text-align:center;padding-left: 2px;padding-right: 2px; width:40px;}
img.raceimg1{ width:40px;}</style>
<style>td.bar2{ font-family: Verdana; color: #000000;   font-size: 10px; vertical-align:bottom;text-align:center;padding-left: 2px;padding-right: 2px; width:40px;}
img.raceimg2{ width:40px;}</style>
<style>td.bar3{ font-family: Verdana; color: #000000;   font-size: 10px; vertical-align:bottom;text-align:center;padding-left: 2px;padding-right: 2px; width:40px;}
img.raceimg3{ width:40px;}</style>
<style>td.bar4{ font-family: Verdana; color: #000000;   font-size: 10px; vertical-align:bottom;text-align:center;padding-left: 2px;padding-right: 2px; width:40px;}
img.raceimg4{ width:40px;}</style>
<style>td.bar5{ font-family: Verdana; color: #000000;   font-size: 10px; vertical-align:bottom;text-align:center;padding-left: 2px;padding-right: 2px; width:40px;}
img.raceimg5{ width:40px;}</style>
<style>td.bar6{ font-family: Verdana; color: #000000;   font-size: 10px; vertical-align:bottom;text-align:center;padding-left: 2px;padding-right: 2px; width:40px;}
img.raceimg6{ width:40px;}</style>
<style>td.bar7{ font-family: Verdana; color: #000000;   font-size: 10px; vertical-align:bottom;text-align:center;padding-left: 2px;padding-right: 2px; width:40px;}
img.raceimg7{ width:40px;}</style>
<style>td.class_bar0{ font-family: Verdana; color: #000000;   font-size: 10px; vertical-align:bottom;text-align:center;padding-left: 2px;padding-right: 2px; width:40px;}
img.class_img0{ width:40px;}</style>
<style>td.class_bar1{ font-family: Verdana; color: #000000;   font-size: 10px; vertical-align:bottom;text-align:center;padding-left: 2px;padding-right: 2px; width:40px;}
img.class_img1{ width:40px;}</style>
<style>td.class_bar2{ font-family: Verdana; color: #000000;   font-size: 10px; vertical-align:bottom;text-align:center;padding-left: 2px;padding-right: 2px; width:40px;}
img.class_img2{ width:40px;}</style>
<style>td.class_bar3{ font-family: Verdana; color: #000000;   font-size: 10px; vertical-align:bottom;text-align:center;padding-left: 2px;padding-right: 2px; width:40px;}
img.class_img3{ width:40px;}</style>
<style>td.class_bar4{ font-family: Verdana; color: #000000;   font-size: 10px; vertical-align:bottom;text-align:center;padding-left: 2px;padding-right: 2px; width:40px;}
img.class_img4{ width:40px;}</style>
<style>td.class_bar5{ font-family: Verdana; color: #000000;   font-size: 10px; vertical-align:bottom;text-align:center;padding-left: 2px;padding-right: 2px; width:40px;}
img.class_img5{ width:40px;}</style>
<style>td.class_bar6{ font-family: Verdana; color: #000000;   font-size: 10px; vertical-align:bottom;text-align:center;padding-left: 2px;padding-right: 2px; width:40px;}
img.class_img6{ width:40px;}</style>
<style>td.class_bar7{ font-family: Verdana; color: #000000;   font-size: 10px; vertical-align:bottom;text-align:center;padding-left: 2px;padding-right: 2px; width:40px;}
img.class_img7{ width:40px;}</style>
<style>td.class_bar8{ font-family: Verdana; color: #000000;   font-size: 10px; vertical-align:bottom;text-align:center;padding-left: 2px;padding-right: 2px; width:40px;}
img.class_img8{ width:40px;}</style>

<style>td.innertopleft{background-image: url(images/census/inner-top-left.gif); width: 20px;}</style>
<style>td.innertop{background-image: url(images/census/inner-top.gif); height: 20px;}</style>
<style>td.innertopright{background-image: url(images/census/inner-top-right.gif);   width: 20px;}</style>

<style>td.innerleft{background-image: url(images/census/inner-left.gif); width: 20px;}</style>
<style>td.innerright{background-image: url(images/census/inner-right.gif); width: 20px;}</style>

<style>td.innerbottomleft{background-image: url(images/census/inner-bottom-left.gif); width: 20px;}</style>
<style>td.innerbottom{background-image: url(images/census/inner-bottom.gif); height: 20px;}</style>
<style>td.innerbottomright{background-image: url(images/census/inner-bottom-right.gif);   width: 20px;}</style>

<style>table.censusinfo{background-image: url(images/census/newsback.gif);}</style>
<style>td.levelbar{vertical-align: bottom; padding: 1px;}</style>

<style>td.category{font-family: Verdana; color: #000000;   font-size: 10px;}</style>
<style>body{ background-image:url(images/census/hintergrund.jpg); font-family: Verdana; color: #000000;   font-size: 10px; }</style>

<body>

</p> 86400 ) //  1 day = 60*60*24
    {
        //
        //  We can do a full get
        //

        //  write our new status file
        $outfilename = "status.txt";
        $outfile = fopen($outfilename, "w");
        if( !$outfile )
        {
            echo "<p>Unable to open save file => " . $outfilename . "<br>";
            exit;
        }

        fputs($outfile, $buffer);
        fclose($outfile);


        //
        //  Now get our guild roster file
        //

      //  -------------------------------------------------------------------------------
      //    REPLACE THE URL FOR YOUR REALM FILE
        $filename = "http://www.warcraftrealms.com/exports/download.php?fname=EU-Los%20Errantes.csv.gz";
      //  -------------------------------------------------------------------------------

        $infile = gzopen ($filename, "r");

        if (!$infile)
        {
            echo "<p>Unable to open remote file.<br>\n";
            exit;
        }

        $outfilename = "roster.csv";    // Local filename for downloaded Census Data - Normaly no need to change
        $outfile = fopen($outfilename, "w");
        if( !$outfile )
        {
            echo "<p>Unable to open save file => " . $outfilename . "<br>\n";
            exit;
        }

        while (!feof ($infile))
        {
            $buffer = fgets($infile, 4096);
            fputs($outfile, $buffer);
        }

        fclose($outfile);
        fclose($infile);
    }


//  -------------------------------------------------------------------------------
//  Data download and checking is now done. Now the Data-Processing can begin.
//  -------------------------------------------------------------------------------





    $filename = "roster.csv";
    $infile = fopen ($filename, "r");
    if (!$infile)
    {
        echo "<p>Unable to open local roster file.<br>";
        exit;
    }
    //  do one read to get the header
    $buffer = fgets($infile, 4096);
   $lines = 0;
    //  read the entries
    while (!feof ($infile))
    {
        $buffer = fgets($infile, 4096);
        list( $name, $race, $class, $level, $last_seen, $rank ) = explode(",",$buffer);
         $lines = $lines + 1;
    }

   //-------------DANS SCRIPT --------------------------------
   
   // declaring main vars
   $horde = 0;
   $alliance = 0;
   $allianceprozent = 0;
   $hordeprozent = 0;
   $allianceratio = 0;
   $horderatio = 0;
   $druid = 0;
   $hunter = 0;
   $mage = 0;
   $paladin = 0;
   $priest = 0;
   $rogue = 0;
   $shaman = 0;
   $warlock = 0;
   $warrior = 0;
   
   // declaring sub-vars and vars with Strings of the Races and classes
   $rasse = array(dwarf, gnome, human, nightelf, orc, tauren, troll, undead);
   $rassecaps = array("Dwarf", "Gnome", "Human", "Night Elf", "Orc", "Tauren", "Troll", "Undead");
   $rassedeutsch = array(Zwergen, Gnomen, Menschen, Nachtelfen, Ork, Tauren, Troll, Untoten);
   $klasse = array(druid, hunter, mage, paladin, priest, rogue, shaman, warlock, warrior);
   
   for ($i = 0; $i <= 7; $i++) {
      ${$rasse[$i]} = 0;
      ${$rasse[$i].druid} = 0;
      ${$rasse[$i].hunter} = 0;
      ${$rasse[$i].mage} = 0;
      ${$rasse[$i].paladin} = 0;
      ${$rasse[$i].priest} = 0;
      ${$rasse[$i].rogue} = 0;
      ${$rasse[$i].shaman} = 0;
      ${$rasse[$i].warlock} = 0;
      ${$rasse[$i].warrior} = 0;
      ${$rasse[$i].unknown} = 0;
      ${$rasse[$i].prozent} = 0;
   }
   
   $csv = file_get_contents("roster.csv");
   $csv = explode("\n",$csv);



   $count = 0 ;   // Z?hlt durch bis Ende Hauptarray
   while ($count <= $lines)
    {
      $csv[$count] = explode(",",$csv[$count]); 

//-----------Allianz Horde---------------
      if ($csv[$count][1] == "Alliance") {
             $alliance = $alliance + $csv[$count][5];
      } else {
             $horde = $horde + $csv[$count][5];
      }
//---------------------------------------

      for ($i = 0; $i <= 7; $i++) {

      // cycle through all races
      if ($csv[$count][2] == $rassecaps[$i]) {
      
            // cycle through all classes of a race and add the number of class-race-chars to the class-racespecific countervar
             ${$rasse[$i]} = ${$rasse[$i]} + $csv[$count][5];
                                     
            if ($csv[$count][3] == "Druid") {
                 ${$rasse[$i].druid} = ${$rasse[$i].druid} + $csv[$count][5];
            } elseif ($csv[$count][3] == "Hunter") {
                 ${$rasse[$i]."hunter"} = ${$rasse[$i]."hunter"} + $csv[$count][5];
              } elseif ($csv[$count][3] == "Mage") {
                   ${$rasse[$i].mage} = ${$rasse[$i].mage} + $csv[$count][5];
              } elseif ($csv[$count][3] == "Paladin") {
                   ${$rasse[$i].paladin} = ${$rasse[$i].paladin} + $csv[$count][5];
            } elseif ($csv[$count][3] == "Priest") {
                   ${$rasse[$i].priest} = ${$rasse[$i].priest} + $csv[$count][5];
            } elseif ($csv[$count][3] == "Rogue") {
                   ${$rasse[$i].rogue} = ${$rasse[$i].rogue} + $csv[$count][5];
            } elseif ($csv[$count][3] == "Shaman") {
                   ${$rasse[$i].shaman} = ${$rasse[$i].shaman} + $csv[$count][5];
            } elseif ($csv[$count][3] == "Warlock") {
                   ${$rasse[$i].warlock} = ${$rasse[$i].warlock} + $csv[$count][5];
            } elseif ($csv[$count][3] == "Warrior") {
                   ${$rasse[$i].warrior} = ${$rasse[$i].warrior} + $csv[$count][5];
            } else {
                   ${$rasse[$i].unknown} = ${$rasse[$i].unknown} + $csv[$count][5];
            }
      
            // add the levels of a race to a race-level array
            $levelhelper = $csv[$count][4];
            ${$rasse[$i].level}[$levelhelper] = ${$rasse[$i].level}[$levelhelper] + $csv[$count][5];

      } else {
      }
      }
      $count = $count + 1;
   }

   // sum all race-class-chars to a single race variable
   for ($i = 0; $i <= 7; $i++) {
         $druid = $druid + ${$rasse[$i].druid};
         $hunter = $hunter + ${$rasse[$i].hunter};
         $mage = $mage + ${$rasse[$i].mage};
         $paladin = $paladin + ${$rasse[$i].paladin};
         $priest = $priest + ${$rasse[$i].priest};
         $rogue = $rogue + ${$rasse[$i].rogue};
         $shaman = $shaman + ${$rasse[$i].shaman};
         $warlock = $warlock + ${$rasse[$i].warlock};
         $warrior = $warrior + ${$rasse[$i].warrior};
      }
      
// End of Data reading and writing main arrays.



//  -------------------------------------------------------------------------------
//  mathematics
//  -------------------------------------------------------------------------------

   // count all palyers an get the A-H-Ratio
   $player = $alliance + $horde;
   $allianceprozent = round($alliance / $player * 100);
   $hordeprozent = 100 - $allianceprozent;
   $allianceratio = round($allianceprozent / $hordeprozent,1);
   $horderatio = 1;
   
//  Get all race-Percantages and make a race-multiplier for adequate Ber-Height in the Output-Table   
//  z.B. dwarfprozent
   $rasseprozentmax = 0;
   for ($i = 0; $i <7> $rasseprozentmax) {
          $rasseprozentmax = ${$rasse[$i].prozent};
      }
   }
   $rasseprozentmulti = floor(100 / $rasseprozentmax);
   
   
// Sum all Classes from Race-Class-counter
   for ($j = 0; $j <= 8; $j++) {   
      ${$klasse[$j].prozent} = 0;
      for ($i = 0; $i <= 7; $i++) {
         ${$klasse[$j]} = ${$klasse[$j]} + ${$rasse[$i].$klasse[$j]};
      }
   }

//  Get all Class-Percantages and make a Class-multiplier for adequate Ber-Height in the Output-Table   
//  z.B. druidprozent
   $klasseprozentmax = 0;
   for ($i = 0; $i <8> $klasseprozentmax) {
          $klasseprozentmax = ${$klasse[$i].prozent};
      }
   }
   $klasseprozentmulti = floor(100 / $klasseprozentmax);


//  Get all race-class-Percantages and make a race-class-multiplier for adequate Ber-Height in the Output-Table   
//  z.B. drwarfdruidprozent
   for ($i = 0; $i <= 7; $i++) {
   ${$rasse[$i].klasseprozentmax} = 0;
   for ($j = 0; $j <8> ${$rasse[$i].klasseprozentmax}) {
          ${$rasse[$i].klasseprozentmax} = ${$rasse[$i].$klasse[$j].prozent};
      }
   }
   ${$rasse[$i].klasseprozentmulti} = floor(100 / ${$rasse[$i].klasseprozentmax});
   }
   
//  get all Race-level-percentages and its multiplier
//  rassenlevelprozent
   for ($j = 0; $j <= 7; $j++) {

   ${$rasse[$j].levelprozentmax} = 0;
   for ($i = 10; $i <60> ${$rasse[$j].levelprozentmax}) {
          ${$rasse[$j].levelprozentmax} = ${$rasse[$j].levelprozent}[$i];
      }
   }
   ${$rasse[$j].levelprozentmulti} = floor(50 / ${$rasse[$j].levelprozentmax});
   
   }
   

//  get all levels from race-levels
   for ($j = 10; $j <= 60; $j++) {
      $level[$j] = 0;
      for ($i = 0; $i <= 7; $i++) {
      $level[$j] = $level[$j] + ${$rasse[$i].level}[$j];
      }
   //   echo "  Level " . $j . " = " . $level[$j] . " !";
   }
   
   
//  get all level percentages
   $levelprozentmax = 0;
   for ($i = 10; $i <60> $levelprozentmax) {
          $levelprozentmax = $levelprozent[$i];
      }
   }
   $levelprozentmulti = floor(50 / $levelprozentmax);
//  --------------------------------------------------------------------------------------------
//  End of Mathematics part. Now all Vars are written an can be used f?r output
//  --------------------------------------------------------------------------------------------




//  --------------------------------------------------------------------------------------------
//  --------------------------------------------------------------------------------------------
//   GRAPHICAL OUTPUT BEGINGS.
//  --------------------------------------------------------------------------------------------
//  --------------------------------------------------------------------------------------------


//  --------------------------------------------------------------------------------------------
//  First Table with general Stats and Race and class overview, as well as all-chars-levels
//  --------------------------------------------------------------------------------------------
echo "<center>
<p>&nbsp;</p>
<table class="censusinfo\">
<tr>
    <td class="innertopleft\"></td><td class="innertop\"></td><td class="innertopright\"></td>
</tr>
<tr>
<td class="innerleft\"></td>
<td> <img src="images/census/kgcensuslogo.jpg\"> &nbsp;    </td>
<td>
    <table align="right\" class="censusinfo\">
        <tr>
            <td class="category\">Total Personajes:</td>
            <td class="category\"><b>$player</b></td>
        </tr>
        <tr>
            <td class="category\">Total Alianza:</td>
            <td class="category\"><b>$alliance - $allianceprozent %</b></td>
        </tr>
        <tr>
            <td class="category\">Total Horda:</td>
            <td class="category\"><b>$horde - $hordeprozent %</b></td>
        </tr>
        <tr>
            <td class="category\">Ratio Alianza: Horda:</td>
            <td class="category\"><b>$allianceratio : $horderatio</b></td>
        </tr>
           </table>
</td>
<td class="innerright\"></td>
</tr>
<tr>
    <td class="innerleft\"></td>
    <td align="center\">
        <table class="censusinfo\"><tr><td align="center\">
        <table class="censusinfo\">
            <tr>
                <td class="innertopleft\"></td><td class="innertop\"></td><td class="innertopright\"></td>
            </tr>
<!--            <tr>
                <td class="innerleft\"></td>
                <td align="center\">Alliance</td>
                <td align="center\">Horde</td>
                <td class="innerright\"></td>
            </tr>
-->            <tr>
                <td class="innerleft\"></td>
            ";
           
            for ($i = 0; $i <= 7; $i++) {
               echo "<td class="bar"><img class="raceimg" src='images/census/Census_Bar.jpg' height="" alt=""></td>";
            }            
            
            echo "
             <td class="innerright\"></td>
            </tr>
            <tr>
                <td class="innerleft\"></td>
            ";

            for ($i = 0; $i <= 7; $i++) {
               echo "<td class="bar">" . ${$rasse[$i]} . "<BR>" . ${$rasse[$i].prozent} . "%</td>";
            }      


      echo "
                <td class="innerright\"></td>
            </tr>
            <tr>
                <td class="innerbottomleft\"></td><td class="innerbottom\"></td><td class="innerbottomright\"></td>
            </tr>
            <tr>
                <td></td>
                <td class="bar0\" align="center\"><img src='images/census/Census_Dwarf.jpg' alt="Dwarf\"><br>Dwarf</td>
                <td class="bar1\" align="center\"><img src='images/census/Census_Gnome.jpg' alt="Gnome\"><br>Gnome</td>
                <td class="bar2\" align="center\"><img src='images/census/Census_Human.jpg' alt="Human\"><br>Human</td>
                <td class="bar3\" align="center\"><img src='images/census/Census_NightElf.jpg' alt="Night Elf\"><br>Elf</td>
                <td class="bar4\" align="center\"><img src='images/census/Census_Orc.jpg' alt="Orc\"><br>Orc</td>
                <td class="bar5\" align="center\"><img src='images/census/Census_Tauren.jpg' alt="Tauren\"><br>Tauren</td>
                <td class="bar6\" align="center\"><img src='images/census/Census_Troll.jpg' alt="Troll\"><br>Troll</td>
                <td class="bar7\" align="center\"><img src='images/census/Census_Undead.jpg' alt="Undead\"><br>Undead</td>
                <td></td>
            </tr>
         <tr><td>&nbsp;</td></tr>
        </table>
        </td>
            <td rowspan='2' height='100%'>&nbsp;</td>
        </tr><tr>
        <td align="center\">
        <table class="censusinfo\">
            <tr>
                <td class="innertopleft\"></td><td class="innertop\"></td><td class="innertopright\"></td>
            </tr>
            <tr>
                <td class="innerleft\"></td>
            ";

            for ($i = 0; $i <= 8; $i++) {
               echo "<td class="class_bar"><img class="class_img" src='images/census/Census_Bar.jpg' height="" alt=""></td>";
            }      

         echo "
                <td class="innerright\"></td>
            </tr>
            <tr>
                <td class="innerleft\"></td>
            ";

         for ($i = 0; $i <= 8; $i++) {
            echo "<td class="class_bar">" . ${$klasse[$i]} . "<BR>" . ${$klasse[$i].prozent} . "%</td>";
            }

         echo "
                <td class="innerright\"></td>
            </tr>
            <tr>
                <td class="innerbottomleft\"></td><td class="innerbottom\"></td><td class="innerbottomright\"></td>
            </tr>
            <tr>
                <td></td>
                <td class="class_bar0\" align="center\"><img src='images/census/Census_Druid.jpg' alt="Druid\"><br>Druid</td>
                <td class="class_bar1\" align="center\"><img src='images/census/Census_Hunter.jpg' alt="Hunter\"><br>Hunter</td>
                <td class="class_bar2\" align="center\"><img src='images/census/Census_Mage.jpg' alt="Mage\"><br>Mage</td>
                <td class="class_bar3\" align="center\"><img src='images/census/Census_Paladin.jpg' alt="Paladin\"><br>Paladin</td>
                <td class="class_bar4\" align="center\"><img src='images/census/Census_Priest.jpg' alt="Priest\"><br>Priest</td>
                <td class="class_bar5\" align="center\"><img src='images/census/Census_Rogue.jpg' alt="Rogue\"><br>Rogue</td>
                <td class="class_bar6\" align="center\"><img src='images/census/Census_Shaman.jpg' alt="Shaman\"><br>Shaman</td>
                <td class="class_bar7\" align="center\"><img src='images/census/Census_Warlock.jpg' alt="Warlock\"><br>Warlock</td>
                <td class="class_bar8\" align="center\"><img src='images/census/Census_Warrior.jpg' alt="Warrior\"><br>Warrior</td>
                <td></td>
            </tr>
        </table>
        </td>
        </tr>
        </table>
        </td>
    <td class="innerright\"></td>
</tr>
<tr>
    <td class="innerleft\"></td>
    <td>
    </td>
    <td class="innerright\"></td>
</tr>
<tr>
    <td class="innerleft\"></td>
    <td align="center\">
    <table class="censusinfo\">
        <tr>
            <td class="innertopleft\"></td><td class="innertop\"></td><td class="innertopright\"></td>
        </tr>
        <tr>
            <td class="innerleft\"></td>
         ";
         
         
   for ($j = 10; $j <= 60; $j++) {
      echo "<td class='levelbar'> <img src='images/census/Census_LevelBar.jpg' height=" . $levelprozent[$j] * $levelprozentmulti  . " alt=""> </td>";
   }


echo "
<td class='innerright'></td></tr><tr><td class='innerleft'></td><td class="category\" align='left'>10</td><td></td><td class='category'>15</td><td></td><td class='category'>20</td><td></td><td class='category'>25</td><td></td><td class='category'>30</td><td></td><td class='category'>35</td><td></td><td class='category'>40</td><td></td><td class='category'>45</td><td></td><td class='category'>50</td><td></td><td class='category'>55</td><td></td><td class='category' align='right'>60</td>
            <td class="innerright\"></td>
        </tr>
        <tr>
            <td class="innerbottomleft\"></td><td class="innerbottom\"></td><td class="innerbottomright\"></td>
        </tr>
    </table>       
    </td>
    <td class="innerright\"></td>
</tr>
<tr>
    <td class="innerbottomleft\"></td><td class="innerbottom\" colspan="2\"></td><td class="innerbottomright\"></td>
</tr>
</table>
<p>&nbsp;</p>
</center>";



//  --------------------------------------------------------------------------------------------
//  The 8 Tables with Race-Specific data. Only 1 Code, but repeated 8 times by the "For"-Code
//  --------------------------------------------------------------------------------------------
for ($j = 0; $j <= 7; $j++) {

echo "<center>
<p>&nbsp;</p>
<table class="censusinfo\">
<tr>
    <td class="innertopleft\"></td><td class="innertop\"></td><td class="innertopright\"></td>
</tr>
<tr>
<td class="innerleft\"></td>
";

echo "<td> <img src='images/census/". $rasse[$j] . ".jpg '> </td><td>&nbsp;</td>";




echo "
<td class="innerright\"></td>
</tr>
<tr>
    <td class="innerleft\"></td>
    <td align="center\">
        <table class="censusinfo\">
      <tr>
        <td align="center\">
        <table class="censusinfo\">
            <tr>
                <td class="innertopleft\"></td><td class="innertop\"></td><td class="innertopright\"></td>
            </tr>
            <tr>
                <td class="innerleft\"></td>
            ";

            for ($i = 0; $i <= 8; $i++) {
               echo "<td class="class_bar"><img class="class_img" src='images/census/Census_Bar.jpg' height="" alt=""></td>";
            }      

         echo "
                <td class="innerright\"></td>
            </tr>
            <tr>
                <td class="innerleft\"></td>
            ";

         for ($i = 0; $i <= 8; $i++) {
            echo "<td class="class_bar">" . ${$rasse[$j].$klasse[$i]} . "<BR>" . ${$rasse[$j].$klasse[$i].prozent} . "%</td>";
            }

         echo "
                <td class="innerright\"></td>
            </tr>
            <tr>
                <td class="innerbottomleft\"></td><td class="innerbottom\"></td><td class="innerbottomright\"></td>
            </tr>
            <tr>
                <td></td>
                <td class="class_bar0\" align="center\"><img src='images/census/Census_Druid.jpg' alt="Druid\"><br>Druid</td>
                <td class="class_bar1\" align="center\"><img src='images/census/Census_Hunter.jpg' alt="Hunter\"><br>Hunter</td>
                <td class="class_bar2\" align="center\"><img src='images/census/Census_Mage.jpg' alt="Mage\"><br>Mage</td>
                <td class="class_bar3\" align="center\"><img src='images/census/Census_Paladin.jpg' alt="Paladin\"><br>Paladin</td>
                <td class="class_bar4\" align="center\"><img src='images/census/Census_Priest.jpg' alt="Priest\"><br>Priest</td>
                <td class="class_bar5\" align="center\"><img src='images/census/Census_Rogue.jpg' alt="Rogue\"><br>Rogue</td>
                <td class="class_bar6\" align="center\"><img src='images/census/Census_Shaman.jpg' alt="Shaman\"><br>Shaman</td>
                <td class="class_bar7\" align="center\"><img src='images/census/Census_Warlock.jpg' alt="Warlock\"><br>Warlock</td>
                <td class="class_bar8\" align="center\"><img src='images/census/Census_Warrior.jpg' alt="Warrior\"><br>Warrior</td>
                <td></td>
            </tr>
        </table>
        </td>
        </tr>
        </table>
        </td>
    <td class="innerright\"></td>
</tr>
<tr>
    <td class="innerleft\"></td>
    <td>
    </td>
    <td class="innerright\"></td>
</tr>
<tr>
    <td class="innerleft\"></td>
    <td align="center\">
    <table class="censusinfo\">
        <tr>
            <td class="innertopleft\"></td><td class="innertop\"></td><td class="innertopright\"></td>
        </tr>
        <tr>
            <td class="innerleft\"></td>
         ";
         
         
   for ($k = 10; $k <= 60; $k++) {
      echo "<td class='levelbar'> <img src='images/census/Census_LevelBar.jpg' height=" . ${$rasse[$j].levelprozent}[$k] * $levelprozentmulti  . " alt=""> </td>";
   }


echo "
<td class='innerright'></td></tr><tr><td class='innerleft'></td><td class="category\" align='left'>10</td><td></td><td class='category'>15</td><td></td><td class='category'>20</td><td></td><td class='category'>25</td><td></td><td class='category'>30</td><td></td><td class='category'>35</td><td></td><td class='category'>40</td><td></td><td class='category'>45</td><td></td><td class='category'>50</td><td></td><td class='category'>55</td><td></td><td class='category' align='right'>60</td>
            <td class="innerright\"></td>
        </tr>
        <tr>
            <td class="innerbottomleft\"></td><td class="innerbottom\"></td><td class="innerbottomright\"></td>
        </tr>
    </table>       
    </td>
    <td class="innerright\"></td>
</tr>
<tr>
    <td class="innerbottomleft\"></td><td class="innerbottom\" colspan="2\"></td><td class="innerbottomright\"></td>
</tr>
</table>
<p>&nbsp;</p>
</center>";

}
    //  don't forget our credit link =)
   echo "<center>";
    echo "Estad?sticas proporcionadas por <a href='http://www.warcraftrealms.com/'>WarcraftRealms.com</a>.";
    echo "C?digo proporcionado por <a href='http://www.beat-solutions.de/'>D.Cron Beat-Solutions</a>.";
   echo "</center>";

?>
</body>
</html>

_________________
Back to top
View user's profile Send private message Visit poster's website
Rollie
Site Admin


Joined: 28 Nov 2004
Posts: 5374
Location: Austin, TX
WR Updates: 480,131
Rollie WR Profile

PostPosted: Mon Nov 27, 2006 11:00 am    Post subject: Reply with quote

That's some strange code:

Code:

   for ($j = 0; $j <= 7; $j++) {

   ${$rasse[$j].levelprozentmax} = 0;
   for ($i = 10; $i <60> ${$rasse[$j].levelprozentmax}) {
          ${$rasse[$j].levelprozentmax} = ${$rasse[$j].levelprozent}[$i];
      }
   }
   ${$rasse[$j].levelprozentmulti} = floor(50 / ${$rasse[$j].levelprozentmax});
   
   }


Sadly, I don't even know wtf is going on with that... Some strange syntax that I'm not familiar with =/
Back to top
View user's profile Send private message Visit poster's website
nekromant



Joined: 07 Jul 2005
Posts: 21
Location: Galiza
WR Updates: 234,980
nekromant WR Profile

PostPosted: Mon Nov 27, 2006 12:48 pm    Post subject: Reply with quote

German variables, but I can't figure why it doesn't work...

It has worked on another hosting without problems, new hosting and the problems have started.

At first the fopen isn't allowed, I put a custom php.ini on my account and then the division by zero...
_________________
Back to top
View user's profile Send private message Visit poster's website
Ceto
Shady Dealer


Joined: 16 Oct 2005
Posts: 350
Location: Plymouth, NH
WR Updates: 193,167
Ceto WR Profile

PostPosted: Tue Nov 28, 2006 3:29 pm    Post subject: Reply with quote

Rollie wrote:
Sadly, I don't even know wtf is going on with that... Some strange syntax that I'm not familiar with =/


http://www.php.net/manual/en/language.variables.variable.php
_________________
Back to top
View user's profile Send private message Visit poster's website
Ceto
Shady Dealer


Joined: 16 Oct 2005
Posts: 350
Location: Plymouth, NH
WR Updates: 193,167
Ceto WR Profile

PostPosted: Tue Nov 28, 2006 3:56 pm    Post subject: Reply with quote

Your page is giving you specific lines where it's hitting errors, but those lines don't correspond to any division when I paste them into an editor. Could you possibly post links to the raw .php script and your data file?

At this point I would assume that your script has always generated these errors, but your other host had inline error display disabled.
_________________
Back to top
View user's profile Send private message Visit poster's website
nekromant



Joined: 07 Jul 2005
Posts: 21
Location: Galiza
WR Updates: 234,980
nekromant WR Profile

PostPosted: Tue Nov 28, 2006 6:51 pm    Post subject: Reply with quote

I have tried to hide these errors, but it doesn't show correctly...

http://www.prioratodedarnassus.com/census/census.rar
_________________
Back to top
View user's profile Send private message Visit poster's website
Rollie
Site Admin


Joined: 28 Nov 2004
Posts: 5374
Location: Austin, TX
WR Updates: 480,131
Rollie WR Profile

PostPosted: Tue Nov 28, 2006 9:15 pm    Post subject: Reply with quote

Ceto wrote:
Rollie wrote:
Sadly, I don't even know wtf is going on with that... Some strange syntax that I'm not familiar with =/


http://www.php.net/manual/en/language.variables.variable.php


Can't say that I've ever used that, and at first glance can't really see any reason to either =x
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    WarcraftRealms.com Forum Index -> WarcraftRealms Developers All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
WarcraftRealms.com  


Powered by phpBB © 2001, 2005 phpBB Group