Postado Março 24, 2017 8 anos Quando acesso a página de cast do meu OT, não aparece os players com cast ligado e tenho a seguinte mensagem de erro: Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\pages\castsystem.php on line 56 Lembro que já havia fixado isso em outro gesior, mas perdi os arquivos. Alguém pode me ajudar? Aqui está o código da página: Spoiler <img id="ContentBoxHeadline" class="Title" src="layouts/tibiacom/images/header/cast.png" alt="Contentbox headline"> <?php if(!defined('INITIALIZED')) exit; $order = $_REQUEST['order']; if($order == 'name') { $orderby = 'name'; } if($order == 'level') { $orderby = 'level'; } if($order == 'vocation') { $orderby = 'vocation'; } if(empty($orderby)) { $orderby = 'name'; } if(count($config['site']['worlds']) > 1) { $worlds .= '<i>Select world:</i> '; foreach($config['site']['worlds'] as $idd => $world_n) { if($idd == (int) $_GET['world']) { $world_id = $idd; $world_name = $world_n; } } } if($idd == (int) $_GET['world']) { $world_id = $idd; $world_name = $world_n; } if(!isset($world_id)) { $world_id = 0; $world_name = $config['server']['serverName']; } if(count($config['site']['worlds']) > 1) { $main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD> <FORM ACTION="?subtopic=whoisonline" METHOD=get><INPUT TYPE=hidden NAME=subtopic VALUE=whoisonline><INPUT TYPE=hidden NAME=list VALUE=experience> <TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>World Selection</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['lightborder'].'"> <TABLE BORDER=0 CELLPADDING=1><TR><TD>World: </TD><TD><SELECT SIZE="1" NAME="world"><OPTION VALUE="" SELECTED>(choose world)</OPTION>'; foreach($config['site']['worlds'] as $id => $world_n) { $main_content .= '<OPTION VALUE="'.$id.'">'.$world_n.'</OPTION>'; } $main_content .= '</SELECT> </TD><TD><INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18> </TD></TR></TABLE></TABLE></FORM></TABLE><br>'; } $playercast = $SQL->query('SELECT cast_name FROM live_casts WHERE player_id > 0 ORDER BY '.$orderby); $player_online_data = $SQL->query('SELECT * FROM players WHERE id= '.$playercast['player_id'].' ORDER BY '.$orderby); $number_of_players_online = 0; foreach($player_online_data as $player) { $number_of_players_online++; if($config['site']['show_flag']) { $account = $SQL->query('SELECT account_id FROM players WHERE id = '.$playercast['player_id'].'')->fetch(); $flag = '<image src="images/flags/'.$account['flag'].'.png"/> '; } if(is_int($number_of_players_online / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $players_rows .= ' <TR BGCOLOR='.$bgcolor.'> <TD WIDTH=40%>'.$flag.'<A HREF="index.php?subtopic=characters&name='.urlencode($playercast['name']).'">'.$playercast['name'].'</A><br/>'.$player['level'].' '.$vocation_name[$player['world_id']][$player['promotion']][$player['vocation']].'</TD> <TD WIDTH=20%><font color="#008000">ONLINE</font></TD> </TR>'; } if($number_of_players_online == 0) { //server status - server empty $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently there are no active casts on '.$config['server']['serverName'].'.</TD></TR></TABLE></TD></TR></TABLE><BR>'; } else { //server status - someone is online $main_content .= ' <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%> <TR BGCOLOR="'.$config['site']['vdarkborder'].'"> <TD CLASS=white><B>Server Status</B></TD> </TR> <TR BGCOLOR='.$config['site']['darkborder'].'> <TD>'; $main_content .= 'Currently there are '.$number_of_players_online.' active live casts'; $main_content .= ' on '.$world_name.'.<br> </TD> </TR> </TABLE><BR>'; //list of players $main_content .= ' <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%> <TR BGCOLOR="'.$config['site']['vdarkborder'].'"> <TD><A HREF="index.php?subtopic=whoisonline&order=name" CLASS=white>Name</A></TD> <TD><A HREF="index.php?subtopic=whoisonline&order=vocation" CLASS=white>Status</TD> </TR> '.$players_rows.'</TABLE>'; //search bar //$main_content .= '<BR><FORM ACTION="index.php?subtopic=characters" METHOD=post> <TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>'; } $main_content .= '<BR><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Description</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><h4 style="margin: 0px;">Commands (owner):</h4><i>!cast {on/off}</i> - Create or close your own cast<br/><i>!cast password, |password|</i> - Sets a password for the cast<br/><i>!cast,desc, |description|</i> - Set a description for the cast<br/><i>!cast status</i> - Information about your cast (viewer amount, description, password)<br/><i>!cast viewers</i> - Displays the name of all viewers<br/><i>!cast {ban/unban},"name"</i> - Bans a viewer from joining your cast/Removes the ban<br/><i>!cast {mute/unmute} "name"</i> - Mutes a viewer on your cast/Removes the mute<br/><i>!cast bans</i> - Displays a list of banned viewers<br/><i>!cast mutes</i> - Displays a list of muted viewers<br/><i>!cast update</i> - Updates the description and status on the website<br/><br/><h4 style="margin: 0px;">Commands (viewer):</h4><i>!nick newNick</i> - Changes the viewer\'s name<br><i>!info</i> - Displays a list of all viewers</TD></TR></TABLE>'; Editado Março 24, 2017 8 anos por Rockersz (veja o histórico de edições)
Postado Março 24, 2017 8 anos Esta é uma mensagem automática! Este tópico foi movido para a área correta.Pedimos que você leia as regras do fórum. Spoiler This is an automated message! This topic has been moved to the correct area.Please read the forum rules.
Postado Março 24, 2017 8 anos $orderby = 'name'; if(isset($_REQUEST['order'])) { if($_REQUEST['order']== 'level') $orderby = 'level'; elseif($_REQUEST['order'] == 'vocation') $orderby = 'vocation'; } $players_online_data = $SQL->query('SELECT ' . $SQL->tableName('accounts') . '.' . $SQL->fieldName('flag') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('vocation') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('promotion') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('level') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('skull') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('looktype') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookaddons') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookhead') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookbody') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('looklegs') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookfeet') . ' FROM ' . $SQL->tableName('accounts') . ', ' . $SQL->tableName('players') . ' WHERE ' . $SQL->tableName('players') . '.' . $SQL->fieldName('world_id') . ' = ' . $SQL->quote($world_id) . ' AND ' . $SQL->tableName('players') . '.' . $SQL->fieldName('online') . ' = ' . $SQL->quote(1) . ' AND ' . $SQL->tableName('accounts') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('players') . '.' . $SQL->fieldName('account_id') . ' ORDER BY ' . $SQL->fieldName($orderby))->fetchAll();
Postado Março 24, 2017 8 anos Autor 9 minutos atrás, buchal disse: $orderby = 'name'; if(isset($_REQUEST['order'])) { if($_REQUEST['order']== 'level') $orderby = 'level'; elseif($_REQUEST['order'] == 'vocation') $orderby = 'vocation'; } $players_online_data = $SQL->query('SELECT ' . $SQL->tableName('accounts') . '.' . $SQL->fieldName('flag') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('vocation') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('promotion') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('level') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('skull') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('looktype') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookaddons') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookhead') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookbody') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('looklegs') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookfeet') . ' FROM ' . $SQL->tableName('accounts') . ', ' . $SQL->tableName('players') . ' WHERE ' . $SQL->tableName('players') . '.' . $SQL->fieldName('world_id') . ' = ' . $SQL->quote($world_id) . ' AND ' . $SQL->tableName('players') . '.' . $SQL->fieldName('online') . ' = ' . $SQL->quote(1) . ' AND ' . $SQL->tableName('accounts') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('players') . '.' . $SQL->fieldName('account_id') . ' ORDER BY ' . $SQL->fieldName($orderby))->fetchAll(); onde coloco isso? pode me passar já inserido no código que deixei em spoiler, por favor? tentei colocar ele aqui e deu o erro na mesma linha
Postado Abril 5, 2017 8 anos @buchal Terceiro tópico que vejo você "ajudando" assim, de forma porca. Sobre o tópico: Bom acredito que você já tenha o cast system na distro, pode passar o seu cast.lua que está na talkactions? acredito que ele não ta setando no banco de dados por isso não aparece no site... __________________ EDIT _________________________________ PARA TFS 0.4 você nao falou para qual era... mas... Ou melhor...mude seu talkaction do cast para este, este ja esta setando no banco de dados... espero que ja tenha coluna "broadcasting" se não tiver é facil de achar pelo forum, mas acredito que tenha. Spoiler function onSay(cid, words, param, channel) local tmp = param:explode(" ") if not(tmp[1]) then return doPlayerSendCancel(cid, "Parameters needed") end if tmp[1] == "on" then db.executeQuery("UPDATE `players` SET `broadcasting` = 1 WHERE `id` = " .. getPlayerGUID(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cast has started.") doPlayerSetCastState(cid, true) doPlayerSave(cid) elseif getPlayerCast(cid).status == false then return doPlayerSendCancel(cid, "Your cast has to be running for this action.") elseif tmp[1] == "off" then db.executeQuery("UPDATE `players` SET `broadcasting` = 0, `viewers` = 0 WHERE `id` = " .. getPlayerGUID(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cast has ended.") doPlayerSetCastState(cid, false) doPlayerSave(cid) elseif isInArray({"pass", "password", "p"}, tmp[1]) then if not(tmp[2]) then return doPlayerSendCancel(cid, "You need to set a password") end if tmp[2]:len() > 10 then return doPlayerSendCancel(cid, "The password is too long. (Max.: 10 letters)") end if tmp[2] == "off" then doPlayerSetCastPassword(cid, "") db.executeQuery("UPDATE `players` SET `broadcasting` = `broadcasting` - 2 WHERE `id` = " .. getPlayerGUID(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cast password has been removed.") else doPlayerSetCastPassword(cid, tmp[2]) db.executeQuery("UPDATE `players` SET `broadcasting` = `broadcasting` + 2 WHERE `id` = " .. getPlayerGUID(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cast password was set to: " .. tmp[2]) end elseif isInArray({"desc", "description", "d"}, tmp[1]) then local d = param:gsub(tmp[1]..(tmp[2] and " " or ""), "") if not(d) or d:len() == 0 then return doPlayerSendCancel(cid, "You need to specify a description.") end if d:len() > 50 then return doPlayerSendCancel(cid, "The description is too long. (Max.: 50 letters)") end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cast description was set to: ") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, d) doPlayerSetCastDescription(cid, d) elseif tmp[1] == "ban" then if not(tmp[2]) then return doPlayerSendCancel(cid, "Specify a spectator that you want to ban.") end if doPlayerAddCastBan(cid, tmp[2]) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' has been banned.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' could not be banned.") end elseif tmp[1] == "unban" then if not(tmp[2]) then return doPlayerSendCancel(cid, "Specify the person you want to unban.") end if doPlayerRemoveCastBan(cid, tmp[2]) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' has been unbanned.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' could not be unbanned.") end elseif param == "bans" then local t = getCastBans(cid) local text = "Cast Bans:\n\n" for k, v in pairs(t) do text = text .. "*" .. v.name .. "\n" end if text == "Cast Bans:\n\n" then text = text .. "No bans." end doShowTextDialog(cid, 5958, text) elseif tmp[1] == "mute" then if not(tmp[2]) then return doPlayerSendCancel(cid, "Specify a spectator that you want to mute.") end if doPlayerAddCastMute(cid, tmp[2]) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' has been muted.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' could not be muted.") end elseif tmp[1] == "unmute" then if not(tmp[2]) then return doPlayerSendCancel(cid, "Specify the person you want to unmute.") end if doPlayerRemoveCastMute(cid, tmp[2]) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' has been unmuted.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' could not be unmuted.") end elseif param == "mutes" then local t = getCastMutes(cid) local text = "Cast Mutes:\n\n" for k, v in pairs(t) do text = text .. "*" .. v.name .. "\n" end if text == "Cast Bans:\n\n" then text = text .. "No mutes." end doShowTextDialog(cid, 5958, text) elseif param == "viewers" then local t = getCastViewers(cid) local text, count = "Cast Viewers:\n#Viewers: |COUNT|\n\n", 0 for _,v in pairs(t) do count = count + 1 text = text .. "*" .. v.name .."\n" end if text == "Cast Viewers:\n#Viewers: |COUNT|\n\n" then text = "Cast Viewers:\n\nNo viewers." end text = text:gsub("|COUNT|", count) doShowTextDialog(cid, 5958, text) elseif param == "status" then local t, c = getCastViewers(cid), getPlayerCast(cid) local count = 0 for _,v in pairs(t) do count = count + 1 end doShowTextDialog(cid, 5958, "Cast Status:\n\n*Viewers:\n " .. count .. "\n*Description:\n "..(c.description == "" and "Not set" or c.description).."\n*Password:\n " .. (c.password == "" and "Not set" or "Set - '"..c.password.."'")) elseif param == "update" then if getPlayerStorageValue(cid, 656544) > os.time() then return doPlayerSendCancel(cid, "You used this command lately. Wait: " .. (getPlayerStorageValue(cid, 656544)-os.time()) .. " sec.") end doPlayerSave(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The cast settings have been updated.") doPlayerSetStorageValue(cid, 656544, os.time()+60) end return true end e cria arquivo .lua em creaturesscript <event type="logout" name="cast-log-out" event="script" value="cast.lua"/> cast.lua Spoiler function onLogout(cid, forceLogout) db.executeQuery("UPDATE `players` SET `broadcasting` = 0, `viewers` = 0 WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1") return true end ou seja, caso player sair do game sem desligar o cast ele vai desligar sozinho. e por fim, vou te passar minha pagina php cast, acho que é um pouco mais elaborada... que a sua. (obs: tem uma coluna outfit, porque eu uso com imagens dentro do htdocs, não sei se vc usa.. mas é facil de editar o php e tirar essa partezinha, você consegue pagina... Spoiler <?php $cache_sec = 10; $info = array( 0 => array('Mexico', '04/03/2014') ); $id=0; $text1 = ' <p>Currently This Server is the only with a unique system of broadcasting game in the current time. System is based on an official TibiaCast.</p> <p>You can enter a live stream by login into the game without entering any account number and password. Just don\'t write anything in those 2 fields and just press enter. A list of all available casts will appear shortly and you choose the one you would like to watch. After login into the cast, you can talk with other audiences and a person that is broadcasting.</p> <p>To make your own broadcast, you must login to your account and use a command <strong>/cast on</strong>. </p> <p>Full command list can be found below.</p> '; $text2 = ' <p><strong>Currently available commands for spectators:</strong><br /> /show - display the amount of currently active spectators<br /> /name - change your name on chat with player and other spectators<br /> /auth - authenticate to an exisiting cast (required with chat proctetion)</p> <p><strong>Available commands for streaming players:</strong><br /> /cast on - enables the stream<br /> /cast off - disables the stream<br /> /cast password {password} - sets a password on the stream<br /> /cast password off - disables the password protection<br /> /cast auth on - enables requirement of authentication on chat<br /> /cast auth off - disables requirement of authentication on chat<br /> /cast kick {name} - kick a spectator from your stream<br /> /cast ban {name} - locks spectator IP from joining your stream<br /> /cast unban {name} - removes banishment lock<br /> /cast bans - shows banished spectators list<br /><br /> /cast mute {name} - mutes selected spectator from chat<br /> /cast unmute {name} - removes mute<br /> /cast mutes - shows muted spectators list<br /> /cast show - displays the amount and nicknames of current spectators<br /> /cast status - displays stream status</p> '; if(isset($_POST['world'])) { $f = null; foreach($config['site']['worlds'] as $k => $v) if($v == $_POST['world']) { $f = true; $id = $k; break; } if(!$f) $_POST['world'] = $config['site']['worlds'][0]; } else $_POST['world'] = $config['site']['worlds'][0]; $order = 'name_asc'; if(isset($_REQUEST['order']) && in_array($_REQUEST['order'], array('name_desc', 'level_asc','level_desc','vocation_asc','vocation_desc'))) $order = $_REQUEST['order']; if(count($config['site']['worlds']) > 1) { $main_content = '<form action="?subtopic=whoislive" method="post"> <div class="TableContainer"> <table class="Table1" cellpadding="0" cellspacing="0"> <div class="CaptionContainer"> <div class="CaptionInnerContainer"> <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span> <div class="Text">World Selection</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> </div> </div> <tr> <td> <div class="InnerTableContainer"> <table width="100%"> <tr> <td style="vertical-align:middle" class="LabelV150">World Name:</td> <td style="width:170px"> <select size="1" name="world" style="width:165px">'; foreach($config['site']['worlds'] as $v) $main_content .= '<option value="'.$v.'"'.($v == $_POST['world'] ? ' selected="selected"' : '').'>'.$v.'</option>'; $main_content .= ' </select> </td> <td style="text-align:left"> <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)"> <div onmouseover="MouseOverBigButton(this)" onmouseout="MouseOutBigButton(this)"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif)"></div> <input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif"/> </div> </div> </td> </tr> </table> </div> </td> </tr> </table> </div> </form><br/> '; } $main_content .= '<div class="TableContainer"> <table class="Table1" cellpadding="0" cellspacing="0"> <div class="CaptionContainer"> <div class="CaptionInnerContainer"> <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span> <div class="Text">World Information</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> </div> </div> <tr> <td> <div class="InnerTableContainer"> <table width="100%"> <tr> <td class="LabelV150">Status:</td> <td>O'.($config['status']['serverStatus_online'] == 1 ? 'n' : 'ff').'line</td> </tr> <tr> <td class="LabelV150">Players Casting:</td> <td>'; $f = 'cache/whoislive-'.$_POST['world'].'-'.$order.'.tmp'; if(file_exists($f) && filemtime($f) > (time() - $cache_sec)) { $cp = file_get_contents($f); } else { $cp = ''; $n = 0; $q = 'SELECT name,level,vocation,promotion,viewers, looktype, lookbody, looklegs, lookhead, lookfeet, lookaddons FROM players WHERE world_id='.$id.' AND broadcasting=1'; if(in_array($order, array('name_asc','name_desc','level_asc','level_desc'))) $q .= ' ORDER BY '.str_replace('_', ' ', $order); if(in_array($order, array('vocation_asc','vocation_desc'))) { $a = array(); $q .= ' ORDER BY level desc'; foreach($SQL->query($q)->fetchAll() as $p) $a[] = array($p['name'], $p['level'], $vocation_name[$p['promotion']][$p['vocation']], $p['looktype'], $p['lookhead'], $p['lookbody'], $p['looklegs'], $p['lookfeet'], $p['lookaddons'], $p['viewers']); function cmp($a, $b) { return $a[2][0] == $b[2][0] ? 0 : $GLOBALS['order'] == 'vocation_asc' ? ($a[2][0] < $b[2][0] ? -1 : 1) : ($a[2][0] > $b[2][0] ? -1 : 1); } usort($a, 'cmp'); foreach($a as $p) { $n++; $cp .= '<tr class="'.(is_int($n/2)?'Even':'Odd').'" style="text-align:right"><td><img src="images/outfit.php?id='.$p[3].'&addons='.$p[8].'&head='.$p[4].'&body='.$p[5].'&legs='.$p[6].'&feet='.$p[7].'" width="64" height="64"/></td><td style="width:70%;text-align:left"><a href="?subtopic=characters&name='.urlencode($p[0]).'">'.$p[0].'</a></td><td style="width:10%">'.$p[1].'</td><td style="width:20%">'.$p[2].'</td><td>'.$p[9].'/50</td></tr>'; } } else { $l = array(); foreach($SQL->query($q)->fetchAll() as $p) { $n++; $cp .= '<tr class="'.(is_int($n/2)?'Even':'Odd').'" style="text-align:right"><td><img src="images/outfit.php?id='.$p['looktype'].'&addons='.$p['lookaddons'].'&head='.$p['lookhead'].'&body='.$p['lookbody'].'&legs='.$p['looklegs'].'&feet='.$p['lookfeet'].'" width="64" height="64"/></td><td style="width:70%;text-align:left">'; if($order == 'name_asc') { $tmp = strtoupper($p['name'][0]); if(!in_array($tmp, $l)) { $l[] = $tmp; $cp .= '<a name="'.$tmp.'"></a>'; } } $cp .= '<a href="?subtopic=characters&name='.urlencode($p['name']).'">'.$p['name'].'</a></td><td style="width:10%">'.$p['level'].'</td><td style="width:20%">'.$vocation_name[$p['promotion']][$p['vocation']].'</td><td>'.$p['viewers'].'/50</td></tr>'; } } file_put_contents($f, $cp); } $main_content .= $n.'</td> </tr> </table> </div> </td> </tr> </table> </div><br/> '.$text1.' <div class="TableContainer"> <table class="Table2" cellpadding="0" cellspacing="0"> <div class="CaptionContainer"> <div class="CaptionInnerContainer"> <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span> <div class="Text">Players Casting'; if($order == 'name_asc') $main_content .= '<span class="TableHeadlineNavigation"> [ <a href="#A">A</a> <a href="#B">B</a> <a href="#C">C</a> <a href="#D">D</a> <a href="#E">E</a> <a href="#F">F</a> <a href="#G">G</a> <a href="#H">H</a> <a href="#I">I</a> <a href="#J">J</a> <a href="#K">K</a> <a href="#L">L</a> <a href="#M">M</a> <a href="#N">N</a> <a href="#O">O</a> <a href="#P">P</a> <a href="#Q">Q</a> <a href="#R">R</a> <a href="#S">S</a> <a href="#T">T</a> <a href="#U">U</a> <a href="#V">V</a> <a href="#W">W</a> <a href="#X">X</a> <a href="#Y">Y</a> <a href="#Z">Z</a> ]</span>'; $main_content .= '</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> </div> </div> <tr> <td> <div class="InnerTableContainer"> <table width="100%"><tr class="LabelH"><td>Outfit</td><td style="text-align:left;width:90%">Name<small style="font-weight:normal">[<a href="?subtopic=whoislive&world='.$_POST['world'].'&order=name_'.($order == 'name_asc' ? 'desc' : 'asc').'">sort</a>]</small> <img class="sortarrow" src="'.$layout_name.'/images/'.($order == 'name_asc' ? 'content/order_desc' : ($order == 'name_desc' ? 'content/order_asc' : 'news/blank')).'.gif"/></td><td>Level<small style="font-weight:normal">[<a href="?subtopic=whoislive&world='.$_POST['world'].'&order=level_'.($order == 'level_asc' ? 'desc' : 'asc').'">sort</a>]</small> <img class="sortarrow" src="'.$layout_name.'/images/'.($order == 'level_asc' ? 'content/order_desc' : ($order == 'level_desc' ? 'content/order_asc' : 'news/blank')).'.gif"/></td><td>Vocation<small style="font-weight:normal">[<a href="?subtopic=whoislive&world='.$_POST['world'].'&order=vocation_'.($order == 'vocation_asc' ? 'desc' : 'asc').'">sort</a>]</small> <img class="sortarrow" src="'.$layout_name.'/images/'.($order == 'vocation_asc' ? 'content/order_desc' : ($order == 'vocation_desc' ? 'content/order_asc' : 'news/blank')).'.gif"/></td><td>Spectators</td></tr>'.(strlen($cp) ? $cp : '<tr><td colspan="4" class="Even">There are no players streaming right now.</td></tr>').' </table> </div> </table></div></td></tr>'.$text2.'<br/><form action="?subtopic=characters" method="post"><div class="TableContainer"> <table class="Table1" cellpadding="0" cellspacing="0"> <div class="CaptionContainer"> <div class="CaptionInnerContainer"> <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span> <div class="Text">Search Character</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span> </div> </div> <tr> <td> <div class="InnerTableContainer"> <table width="100%"><tr><td style="vertical-align:middle" class="LabelV150">Character Name:</td><td style="width:170px"><input style="width:165px" name="name" value="" size="29" maxlength="29"/></td><td><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)"><div onmouseover="MouseOverBigButton(this)" onmouseout="MouseOutBigButton(this)"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif)"></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif"></div></div></td></tr> </table> </div> </table></div></td></tr></form></center>'; ?> Boa Sorte com seu projeto. Editado Abril 5, 2017 8 anos por pablobion (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.