Mudrock 326 Posted May 14, 2015 Share Posted May 14, 2015 (edited) Tutorial Em /layout/widgets/loggedin.php Procure por <li> <a href='myaccount.php'>My Account</a> </li> Adicione logo abaixo <li> <a href='friends.php'>My Friends</a> </li> Crie um arquivo .php com o nome friends <?php # TFS 0.3 VIP Friends for ZnoteAAC # By cbrm @ otland.net require_once 'engine/init.php'; protect_page(); include 'layout/overall/header.php'; echo'<h1>VIP Friends</h1>'; $vip = mysql_query('SELECT p.name AS name, p.id AS id, p.online AS online, player_id FROM account_viplist LEFT JOIN players p ON account_viplist.player_id = p.id WHERE account_viplist.account_id = '.$user_data['id'].' ORDER BY name, online ASC LIMIT 0,100'); while ($row = mysql_fetch_assoc($vip)) {$data[] = $row;} if (empty($data)) {echo 'You VIP list is empty.'; return include 'layout/overall/footer.php';} ?> <table><tr class="yellow"><td width="60%"><strong>Name</strong></td><td width="40%"><strong>Status</strong></td></tr> <?php foreach($data as $friend) { echo '<tr><td><a href="characterprofile.php?name='.$friend['name'].'">'.$friend['name'].'</a></td>'; echo '<td><span style="color:'.($friend['online'] == 0 ? 'red;">Offline':'green;">Online').'</span></td></tr>'; } echo'</table>'; include 'layout/overall/footer.php'; ?> Créditos cbrm Edited May 14, 2015 by MudrocK Link to comment Share on other sites More sharing options...
PrinceBR 0 Posted March 15, 2019 Share Posted March 15, 2019 Em 14/05/2015 em 12:11, Mudrock disse: Tutorial Em /layout/widgets/loggedin.php Procure por <li> <a href='myaccount.php'>My Account</a> </li> Adicione logo abaixo <li> <a href='friends.php'>My Friends</a> </li> Crie um arquivo .php com o nome friends <?php # TFS 0.3 VIP Friends for ZnoteAAC # By cbrm @ otland.net require_once 'engine/init.php'; protect_page(); include 'layout/overall/header.php'; echo'<h1>VIP Friends</h1>'; $vip = mysql_query('SELECT p.name AS name, p.id AS id, p.online AS online, player_id FROM account_viplist LEFT JOIN players p ON account_viplist.player_id = p.id WHERE account_viplist.account_id = '.$user_data['id'].' ORDER BY name, online ASC LIMIT 0,100'); while ($row = mysql_fetch_assoc($vip)) {$data[] = $row;} if (empty($data)) {echo 'You VIP list is empty.'; return include 'layout/overall/footer.php';} ?> <table><tr class="yellow"><td width="60%"><strong>Name</strong></td><td width="40%"><strong>Status</strong></td></tr> <?php foreach($data as $friend) { echo '<tr><td><a href="characterprofile.php?name='.$friend['name'].'">'.$friend['name'].'</a></td>'; echo '<td><span style="color:'.($friend['online'] == 0 ? 'red;">Offline':'green;">Online').'</span></td></tr>'; } echo'</table>'; include 'layout/overall/footer.php'; ?> Créditos cbrm deu esse erro > Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\Program Files (x86)\EasyPHP-Devserver-17\eds-www\friends.php on line 19Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\Program Files (x86)\EasyPHP-Devserver-17\eds-www\friends.php on line 20You VIP list is empty. Link to comment Share on other sites More sharing options...
Recommended Posts