Beispiel #1
0
         <th>Hk's</th>
         <th>Level</th>
     </tr>
     <?php 
 if ($GLOBALS['playersOnline']['moduleResults'] > 0) {
     $count = mysql_result($count, 0);
     if ($count > 10) {
         $count = $count - 10;
     }
     $rand = rand(1, $count);
     $result = mysql_query("SELECT guid, name, totalKills, level, race, class, gender, account FROM characters WHERE name!='' \r\n\t\t\t\t\t\t\t\tAND online=1 LIMIT " . $rand . "," . $GLOBALS['playersOnline']['moduleResults']);
 } else {
     $result = mysql_query("SELECT guid, name, totalKills, level, race, class, gender, account FROM characters WHERE name!='' \r\n\t\t\t\t\t\t\t\t  AND online=1");
 }
 while ($row = mysql_fetch_assoc($result)) {
     connect::connectToRealmDB($rid);
     $getGuild = mysql_query("SELECT guildid FROM guild_member WHERE guid='" . $row['guid'] . "'");
     if (mysql_num_rows($getGuild) == 0) {
         $guild = "None";
     } else {
         $g = mysql_fetch_assoc($getGuild);
         $getGName = mysql_query("SELECT name FROM guild WHERE guildid='" . $g['guildid'] . "'");
         $x = mysql_fetch_assoc($getGName);
         $guild = '&lt; ' . $x['name'] . ' &gt;';
     }
     if ($GLOBALS['playersOnline']['display_GMS'] == false) {
         //Check if GM.
         connect::selectDB('logondb');
         $checkGM = mysql_query("SELECT COUNT(*) FROM account_access WHERE id='" . $row['account'] . "' AND gmlevel >0");
         if (mysql_result($checkGM, 0) == 0) {
             echo '<tr style="text-align: center;">
Beispiel #2
0
 public static function getAccountIDFromCharId($char_id, $realm_id)
 {
     $char_id = (int) $char_id;
     $realm_id = (int) $realm_id;
     connect::selectDB('webdb');
     connect::connectToRealmDB($realm_id);
     $result = mysql_query("SELECT account FROM characters WHERE guid='" . $char_id . "'");
     $row = mysql_fetch_assoc($result);
     return $row['account'];
 }
Beispiel #3
0
    public static function serverStatus($realm_id)
    {
        //Get status
        $fp = fsockopen($GLOBALS['realms'][$realm_id]['host'], $GLOBALS['realms'][$realm_id]['port'], $errno, $errstr, 1);
        if (!$fp) {
            echo $status = '<h4 class="realm_status_title_offline">' . $GLOBALS['realms'][$realm_id]['name'] . ' -  Offline</h4>';
        } else {
            echo $status = '<h4 class="realm_status_title_online">' . $GLOBALS['realms'][$realm_id]['name'] . ' - Online</h4>';
            echo '<span class="realm_status_text">';
            /* Players online bar */
            if ($GLOBALS['serverStatus']['factionBar'] == TRUE) {
                connect::connectToRealmDB($realm_id);
                $getChars = mysql_query("SELECT COUNT(online) FROM characters WHERE online=1");
                $total_online = mysql_result($getChars, 0);
                $getAlliance = mysql_query("SELECT COUNT(online) FROM characters WHERE online=1 AND race IN('3','4','7','11','1','22')");
                $alliance = mysql_result($getAlliance, 0);
                $getHorde = mysql_query("SELECT COUNT(online) FROM characters WHERE online=1 AND race IN('2','5','6','8','10','9')");
                $horde = mysql_result($getHorde, 0);
                if ($total_online == 0) {
                    $per_alliance = 50;
                    $per_horde = 50;
                } else {
                    if ($alliance == 0) {
                        $per_alliance = 0;
                    } else {
                        $per_alliance = round($alliance / $total_online * 100);
                    }
                    if ($horde == 0) {
                        $per_horde = 0;
                    } else {
                        $per_horde = round($horde / $total_online * 100);
                    }
                }
                if ($per_alliance + $per_horde > 100) {
                    $per_horde = $per_horde - 1;
                }
                ?>
           <div class='srv_status_po'>
                  <div class='srv_status_po_alliance' style="width: <?php 
                echo $per_alliance;
                ?>
%;"></div>
                  <div class='srv_status_po_horde' style="width: <?php 
                echo $per_horde;
                ?>
%;"></div>
                  <div class='srv_status_text'>Alliance: <?php 
                echo $alliance;
                ?>
 &nbsp;  Horde: <?php 
                echo $horde;
                ?>
</div>
           </div>
	   <?php 
            }
            echo '<table width="100%"><tr>';
            //Get players online
            if ($GLOBALS['serverStatus']['playersOnline'] == TRUE) {
                connect::connectToRealmDB($realm_id);
                $getChars = mysql_query("SELECT COUNT(online) FROM characters WHERE online=1");
                $pOnline = mysql_result($getChars, 0);
                echo '<td>
					<b>', $pOnline, '</b> Players online
				  </td>';
            }
            //Get uptime
            if ($GLOBALS['serverStatus']['uptime'] == TRUE) {
                connect::selectDB('logondb');
                $getUp = mysql_query("SELECT starttime FROM uptime WHERE realmid='" . $realm_id . "' ORDER BY starttime DESC LIMIT 1");
                $row = mysql_fetch_assoc($getUp);
                $time = time();
                $uptime = $time - $row['starttime'];
                echo '
			       <td>
			       	   <b>' . convTime($uptime) . '</b> uptime
				   </td>
			       </tr>';
            }
        }
        if ($GLOBALS['serverStatus']['nextArenaFlush'] == TRUE) {
            //Arena flush
            connect::connectToRealmDB($realm_id);
            $getFlush = mysql_query("SELECT value FROM worldstates WHERE comment='NextArenaPointDistributionTime'");
            $row = mysql_fetch_assoc($getFlush);
            $flush = date('d M H:i', $row['value']);
            echo '<tr>
		 	   <td>
			   	   Next arena flush: <b>' . $flush . '</b>
			   </td>';
        }
        echo '</tr>
	      </table>
		  </span>';
    }
Beispiel #4
0
 public static function getCharName($id, $realm_id)
 {
     $id = (int) $id;
     connect::connectToRealmDB($realm_id);
     $result = mysql_query("SELECT name FROM characters WHERE guid='" . $id . "'");
     $row = mysql_fetch_assoc($result);
     return $row['name'];
 }
Beispiel #5
0
        echo $GLOBALS['service'][$service]['price'] . ' ' . website::convertCurrency($GLOBALS['service'][$service]['currency']);
        ?>
</span>
<?php 
        if ($GLOBALS['service'][$service]['currency'] == "vp") {
            echo "<span class='currency'>Vote Points: " . account::loadVP($_SESSION['cw_user']) . "</span>";
        } elseif ($GLOBALS['service'][$service]['currency'] == "dp") {
            echo "<span class='currency'>" . $GLOBALS['donation']['coins_name'] . ": " . account::loadDP($_SESSION['cw_user']) . "</span>";
        }
    }
    account::isNotLoggedIn();
    connect::selectDB('webdb');
    $result = mysql_query("SELECT name FROM realms WHERE id='" . $realm_id . "'");
    $row = mysql_fetch_assoc($result);
    $realm = $row['name'];
    connect::connectToRealmDB($realm_id);
    $result = mysql_query("SELECT name,guid,gender,class,race,level,online FROM characters WHERE guid='" . $guid . "'");
    $row = mysql_fetch_assoc($result);
    ?>
    <h4>Selected character:</h4>
    <div class='charBox'>
    <table width="100%">
	        <tr>
                <td width="73">
                <?php 
    if (!file_exists('styles/global/images/portraits/' . $row['gender'] . '-' . $row['race'] . '-' . $row['class'] . '.gif')) {
        echo '<img src="styles/' . $GLOBALS['template']['path'] . '/images/unknown.png" />';
    } else {
        ?>
                <img src="styles/global/images/portraits/<?php 
        echo $row['gender'] . '-' . $row['race'] . '-' . $row['class'];