php site fails....

Results 1 to 1 of 1
  1. #1
    Member vikkman is offline
    MemberRank
    Jul 2007 Join Date
    86Posts

    php site fails....

    im using djravine's site updated.. for fansite.. and at players online i have this code

    Code:
    <?php
    if (INCLUDED!==true) exit('Dieee !!!');
    if ($site['show_online_for_users'] !== true && $user[gmlevel]==0) exit('Dieee !!!');
    $page[title] = "$lang[players_online]";
    include('inc/site.defines.php');
    include('inc/page.header.php');
    ?>
    <div class='blogbody'>
    <center>
    <table border='0' cellpadding='0' cellspacing='0' width='90%'>
    <tbody>
    <tr>
     <td colspan='2'>
    <table border='0' cellpadding='0' cellspacing='0' width='100%'>
    <div style='cursor: auto;' id='dataElement'>
    <span>
    <table border='0' cellpadding='0' cellspacing='0' width='100%'>
     <tbody>
     <tr>
      <td width='12'><img src='img/metalborder-top-left.gif' height='12' width='12'></td>
      <td background='img/metalborder-top.gif'></td>
      <td width='12'><img src='img/metalborder-top-right.gif' height='12' width='12'></td>
     </tr>
     <tr>
      <td background='img/metalborder-left.gif'></td>
      <td>
       <table cellpadding='3' cellspacing='0' width='100%'>
        <tbody>
        <tr>
         <td class='rankingHeader' align='left' nowrap='nowrap'>#</td>
         <td class='rankingHeader' align='left' nowrap='nowrap'><?php echo$lang['online_name']; ?>&nbsp;</td>
         <td class='rankingHeader' align='left' nowrap='nowrap'><?php echo$lang['online_race']; ?>&nbsp;</td>
         <td class='rankingHeader' align='left' nowrap='nowrap'><?php echo$lang['online_class']; ?>&nbsp;</td>
         <td class='rankingHeader' align='left' nowrap='nowrap'><?php echo$lang['online_level']; ?>&nbsp;</td>
         <td class='rankingHeader' align='left' nowrap='nowrap'><?php echo$lang['online_location']; ?>&nbsp;</td>
        </tr>
    <?php
    $realms_arr = get_allrealms();
    foreach($realms_arr as $realm_param)
    {
     $result_str = "    <tr>
         <td class='rankingHeader' align='center' colspan='6' nowrap='nowrap'>$realm_param[name]</td>
        </tr>";
     $mangosd_database = parse_worlddb_info($realm_param['dbinfo']);
     $mangos_db = new DBLayer($mangosd_database['host'], $mangosd_database['user'], $mangosd_database['password'], $mangosd_database['db']);
     $mangos_db->query("SET NAMES $database_encoding");
     
     $query = $mangos_db->query("SELECT * FROM `character` WHERE `online`='0' ORDER BY `name`");
     while($result = $mangos_db->fetch_assoc($query))
     {
      if($res_color==1)$res_color=2;else$res_color=1;
      $cc++;
      $res_acc = get_user_stats($result['account']);
      $res_race = $site_defines['character_race'][$result['race']];
      $res_class = $site_defines['character_class'][$result['class']];
      $res_map = $site_defines['map'][$result['map']];
      $res_zone = get_zone_name($result['map'], $result[position_x], $result[position_y]);
      $char_data = explode(' ',$result['data']);
      $char_gender = dechex($char_data[36]);
      $char_gender = str_pad($char_gender,8, 0, STR_PAD_LEFT);
      $char_gender = $char_gender{3};
      $result_str .= "
        <tr>
         <td class='serverStatus$res_color' align='center'><small>$cc</small></td>
         <td class='serverStatus$res_color'><b class='smallBold' style='color: rgb(35, 67, 3);'>$result[name]</b></td>
         <td class='serverStatus$res_color' align='center'><small style='color: rgb(102, 13, 2);'><img onmouseover=\"ddrivetip('$lang[$res_race]')\" onmouseout=\"hideddrivetip()\" src='img/$result[race]-$char_gender.gif' height='18' width='18'></small></td>
         <td class='serverStatus$res_color' align='center'><small style='color: rgb(35, 67, 3);'><img onmouseover=\"ddrivetip('$lang[$res_class]')\" onmouseout=\"hideddrivetip()\" src='img/$result[class].gif' height='18' width='18'></small></td>
         <td class='serverStatus$res_color' align='center'><small style='color: rgb(102, 13, 2);'>$char_data[34]</small></td>
         <td class='serverStatus$res_color'><small style='color: rgb(35, 67, 3);'>$res_map - $res_zone</small></td>
        </tr>";
     }
     
     $mangos_db->close();
     unset($mangos_db);
     echo $result_str;
    }
    ?>
        </tbody>
       </table>
      </td>
      <td background='img/metalborder-right.gif'></td>
     </tr>
     <tr>
      <td><img src='img/metalborder-bot-left.gif' height='11' width='12'></td>
      <td background='img/metalborder-bot.gif'></td>
      <td><img src='img/metalborder-bot-right.gif' height='11' width='12'></td>
     </tr>
     </tbody>
    </table>
    </span>
    </div>
    </td>
    </tr>
    </tbody></table>
    </center>
    </div>
    <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
    <?php
    include('inc/page.footer.php');
    ?>
    the problem is that this code isn't working.. i mean it isnt showing the players online.. can you plz figure out where's the error cauze i searched alot.. didnt find it..

    FIXED IT :X
    Last edited by vikkman; 01-02-08 at 10:00 AM. Reason: FIXED THE CODE THX :D:D:D




Advertisement