|
|
Модератор форума: Dimitro |
Форум ArcEmu ArcEmu Полезные скрипты для сайта. |
Полезные скрипты для сайта. |
Чистый скрипт, показывающий игроков онлайн. Для новичков. Code <?php /******************************/ /* Copyright © Velenor <img src="http://s8.ucoz.net/sm/1/biggrin.gif" border="0" align="absmiddle" alt="biggrin" /> */ /******************************/ $host='localhost'; // хост $user='root'; // юзер бд $pass=''; // пароль к бд $db='characters'; // база с чарами $conn = @mysql_connect($host,$user,$pass); @mysql_select_db($db); $plronline = @mysql_num_rows(mysql_query("SELECT `online` FROM `characters` WHERE `online`='1'")); ?> Топ самых богатых игроков. Code $host = 'localhost'; $user = 'login'; $pass = ''; $db = 'characters'; $con = mysql_connect($host,$user,$pass) or die(mysql_error()); mysql_select_db($db) or die(mysql_error()); $resurs = mysql_query(" SELECT * FROM `characters` ORDER BY `gold` DESC LIMIT 0 , 10 "); echo "<table>"; while($rows = mysql_fetch_object($resurs)) { $i++; $name = $rows->name; $level = $rows->level; $class = $rows->class; $race = $rows->race; $gold = $rows->gold; echo "<tr><td>",$i,"</td><td>",$name,"</td><td>",$level,"</td><td>",$class,"</td><td>",$race,"</td><td>",$gold,"</td></tr>"; } echo "</tabl[/size]e>"; Топ PvP/ Code $host = 'localhost'; $user = 'login'; $pass = ''; $db = 'characters'; $con = mysql_connect($host,$user,$pass) or die(mysql_error()); mysql_select_db($db) or die(mysql_error()); $resurs = mysql_query(" SELECT * FROM `characters` ORDER BY `killsLifeTime` DESC LIMIT 0 , 10 "); echo "<table>"; while($rows = mysql_fetch_object($resurs)) { $i++; $name = $rows->name; $level = $rows->level; $class = $rows->class; $race = $rows->race; $killsLifeTime = $rows->killsLifeTime; echo "<tr><td>",$i,"</td><td>",$name,"</td><td>",$level,"</td><td>",$class,"</td><td>",$race,"</td><td>",$killsLifeTime,"</td></tr>"; } echo "</tabl[/size]e>"; |
| |||
| |||