当前位置: 首页>>代码示例>>PHP>>正文


PHP connect::connectToRealmDB方法代码示例

本文整理汇总了PHP中connect::connectToRealmDB方法的典型用法代码示例。如果您正苦于以下问题:PHP connect::connectToRealmDB方法的具体用法?PHP connect::connectToRealmDB怎么用?PHP connect::connectToRealmDB使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在connect的用法示例。


在下文中一共展示了connect::connectToRealmDB方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mysql_result

         <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;">
开发者ID:nero08,项目名称:CraftedWeb,代码行数:31,代码来源:playersonline.php

示例2: getAccountIDFromCharId

 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'];
 }
开发者ID:nero08,项目名称:CraftedWeb,代码行数:10,代码来源:account.php

示例3: serverStatus

    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>';
    }
开发者ID:nero08,项目名称:CraftedWeb,代码行数:95,代码来源:server.php

示例4: getCharName

 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'];
 }
开发者ID:Kheros,项目名称:CraftedWeb,代码行数:8,代码来源:character.php

示例5: elseif

        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'];
开发者ID:nero08,项目名称:CraftedWeb,代码行数:31,代码来源:confirmservice.php


注:本文中的connect::connectToRealmDB方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。