Jump to content
MakeWebGames

PHPStudent

Members
  • Posts

    135
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by PHPStudent

  1. A critical error has occurred, and page execution has stopped. Below are the details: 1136: Column count doesn't match value count at row 1 Action taken: Attempted to execute query: INSERT INTO vote VALUES('', 'test', '', 'test', '1', 'none.png', '1', '1', '1000', 'money') Same error
  2. Thanks for the mod. But I get this error: A critical error has occurred, and page execution has stopped. Below are the details: 1136: Column count doesn't match value count at row 1 Action taken: Attempted to execute query: INSERT INTO vote VALUES(NULL, 'test', '', 'test', '1', 'none.png', '1', '1', '1000', 'money') Any help would be appreciated
  3. @ags_cs4Definetly meant polls. πŸ˜… In his defence, he has stated before english is not his first language if I recall correctly.
  4. Just wondering, how did they gain access to the codes if there were no purchases?
  5. I see what you mean now. I think😯
  6. I mean it couldve been "restart" instead but NO it just had to be suicide. Lol πŸ˜†
  7. So dark πŸ˜›
  8. Looks amazing.
  9. You're the man Dave 😌
  10. Nope nothing Edit: I got this working
  11. Yup, thanks for providing it! An update on my nearly final version:
  12. Thanks for the help. I ran the SQL and put in the missing colon. Few errors, still: - Trades log doesnt update with recent trades - When I put a through a trade with another player, while it still shows up on the main page, I get this: "Test Site - Critical Error A critical error has occurred, and this page cannot be displayed. Please try again later. Query failed" - Can't update a trade: atal error: Uncaught Error: Call to undefined function trade_add() in C:\xampp\htdocs\trade.php:345 Stack trace: #0 C:\xampp\htdocs\trade.php(48): add() #1 {main} thrown in C:\xampp\htdocs\trade.php on line 345
  13. It works! Still making small changes but here's what I've got so far: Thank you!
  14. Looks good but it throws errors for me. Is that because of the PHP update? If it is, can someone tell me how to convert it to make it compatitble with latest version of PHP? In trade.php?action=create when I create a trade, it does however still show up on the main page Test Site - Critical Error A critical error has occurred, and page execution has stopped. Below are the details: 1054: Unknown column 'trMONEY' in 'field list' Action taken: Attempted to execute query: INSERT INTO `trades_logs` (`trID`, `trFROM`, `trUSER`, `trMONEY`, `trITEM`, `trQTY`, `trTAK`, `trACC`, `trRMONEY`, `trRITEM`, `trRQTY`, `trRTAK`, `trRACC`) VALUES (NULL,1,03,100,'2','1','::1',0,0,0,0,'',0) and when I try to update a trade: Fatal error: Uncaught Error: Call to undefined function trade_add() in C:\xampp\htdocs\trade.php:362 Stack trace: #0 C:\xampp\htdocs\trade.php(65): add() #1 {main} thrown in C:\xampp\htdocs\trade.php on line 362 and in staff logs: Parse error: syntax error, unexpected 'view_trade_logs' (T_STRING) in C:\xampp\htdocs\staff_logs.php on line 36 staff_logs.php <?php require_once('sglobals.php'); if (!in_array($ir['user_level'], array(2, 3, 5))) { echo 'You cannot access this area.<br /> &gt; <a href="staff.php">Go Back</a>'; die($h->endpage()); } //This contains log stuffs if (!isset($_GET['action'])) { $_GET['action'] = ''; } switch ($_GET['action']) { case 'atklogs': view_attack_logs(); break; case 'itmlogs': view_itm_logs(); break; case 'cashlogs': view_cash_logs(); break; case 'cryslogs': view_crys_logs(); break; case 'banklogs': view_bank_logs(); break; case 'maillogs': view_mail_logs(); break; case 'tradelogs' view_trade_logs(); break; case 'stafflogs': view_staff_logs(); break; default: echo "Error: This script requires an action."; break; } function view_trade_logs() { global $db, $ir, $c, $h, $userid; echo '<h3>Trade Logs</h3><hr />'; if (!$_GET['st']) { $_GET['st'] = 0; } $st = abs((int) $_GET['st']); $app = 50; $q = $db->query('SELECT * FROM trades_logs'); $trades = $db->num_rows($q); $pages = ceil($trades / $app); echo 'Pages:&nbsp;'; for ($i = 1; $i <= $pages; ++$i) { $s = ($i - 1) * $app; if ($s == $st) { echo "<b>$i</b>&nbsp;"; } else { echo "<a href='staff_logs.php?action=tradelogs&st=$s'>$i</a>&nbsp;"; } if (0 == $i % 25) { echo '<br />'; } } echo "<br /> <table width='100%' cellspacing=1 class='table'><th>ID</th><th>User</th><th>Money</th><th>Items</th><th>Qty</th><th>ACP</th><th>IP</th></tr>"; $q = $db->query("SELECT t.*,u1.username as trader, u2.username as tradee FROM trades_logs t LEFT JOIN users u1 ON t.trFROM=u1.userid LEFT JOIN users u2 ON t.trUSER=u2.userid ORDER BY t.trID DESC LIMIT $st,$app"); while ($r = $db->fetch_row($q)) { echo "<tr><td width=5%>{$r['trID']}</td><td width=15%>[<a href='viewuser.php?u={$r['trFROM']}'>{$r['trader']}</a>]</td><td>$".$db->escape($r['trMONEY']).'</td>'; $ex = explode(',', $r['trITEM']); $qty = explode(',', $r['trQTY']); $n = 0; $items_needed=''; $qty_needed=''; foreach ($ex as $i) { $item = $db->query("SELECT `itmname` FROM `items` WHERE `itmid`={$i}"); $t = $db->fetch_row($item); if (0 == $qty[$n]) { $items_needed = 'None'; } $items_needed .= $t['itmname'].'<br />'; $qty_needed .= $qty[$n].'<br/>'; ++$n; } unset($n); echo '<td>'.$items_needed.'</td> <td>'.$qty_needed.'</td>'; if (0 == $r['trACC']) { $ac = 'No'; } elseif (1 == $r['trRCC']) { $ac = 'Yes'; } elseif (2 == $r['trACC']) { $ac = 'Canc'; } echo '<td>'.$ac."</td> <td>{$r['trTAK']}</td></tr> <tr><td width=5%>{$r['trID']}</td><td width=15%>[<a href='viewuser.php?u={$r['trUSER']}'>{$r['tradee']}</a>]</td><td>$".$db->escape($r['trRMONEY']).'</td>'; $ex = explode(',', $r['trRITEM']); $qty = explode(',', $r['trRQTY']); $n = 0; $qty_needed1=''; $items_needed1=''; foreach ($ex as $i) { $item = $db->query("SELECT `itmname` FROM `items` WHERE `itmid`={$i}"); $t = $db->fetch_row($item); if (0 == $qty[$n]) { $items_needed1 = 'None'; } $items_needed1 .= $t['itmname'].'<br />'; $qty_needed1 .= $qty[$n].'<br/>'; ++$n; } unset($n); echo '<td>'.$items_needed1.'</td> <td>'.$qty_needed1.'</td>'; if (0 == $r['trRACC']) { $acc = 'No'; } elseif (1 == $r['trRACC']) { $acc = 'Yes'; } elseif (2 == $r['trRACC']) { $acc = 'Canc'; } echo '<td>'.$acc."</td> <td>{$r['trRTAK']}</td> </tr>"; } echo '</table><br />'; $mypage = floor($_GET['st'] / $app) + 1; echo 'Pages:&nbsp;'; for ($i = 1; $i <= $pages; ++$i) { $s = ($i - 1) * $app; if ($s == $st) { echo "<b>$i</b>&nbsp;"; } else { echo "<a href='staff_logs.php?action=tradelogs&st=$s'>$i</a>&nbsp;"; } if (0 == $i % 25) { echo '<br />'; } } stafflog_add("Looked at the Trade Logs(Page $mypage)"); } function view_attack_logs() { global $db, $ir, $c, $h, $userid; echo " <h3>Attack Logs</h3> <hr /> "; if (!isset($_GET['st'])) { $_GET['st'] = 0; } $st = abs(intval($_GET['st'])); $app = 100; $q = $db->query("SELECT COUNT(`attacker`) FROM `attacklogs`"); $attacks = $db->fetch_single($q); $db->free_result($q); if ($attacks == 0) { echo 'There have been no attacks yet.'; return; } $pages = ceil($attacks / $app); echo 'Pages:&nbsp;'; for ($i = 1; $i <= $pages; $i++) { $s = ($i - 1) * $app; echo ($s == $st) ? '<b>' . $i . '</b>&nbsp;' : '<a href="staff_logs.php?action=atklogs&st=' . $s . '">' . $i . '</a>&nbsp;'; echo ($i % 25 == 0) ? '<br />' : ''; } echo " <br /> <table width='100%' cellspacing='1' cellpadding='1' class='table'> <tr> <th>Time</th> <th>Who Attacked</th> <th>Who Was Attacked</th> <th>Who Won</th> <th>What Happened</th> </tr> "; $q = $db->query( "SELECT `stole`, `result`, `attacked`, `attacker`, `time`, `u1`.`username` AS `un_attacker`, `u2`.`username` AS `un_attacked` FROM `attacklogs` AS `a` INNER JOIN `users` AS `u1` ON `a`.`attacker` = `u1`.`userid` INNER JOIN `users` AS `u2` ON `a`.`attacked` = `u2`.`userid` ORDER BY `a`.`time` DESC LIMIT $st, $app"); while ($r = $db->fetch_row($q)) { echo " <tr> <td>" . date('F j, Y, g:i:s a', $r['time']) . "</td> <td>{$r['un_attacker']} [{$r['attacker']}]</td> <td>{$r['un_attacked']} [{$r['attacked']}]</td> "; if ($r['result'] == "won") { echo " <td>{$r['un_attacker']}</td> <td> "; if ($r['stole'] == -1) { echo "{$r['un_attacker']} hospitalized {$r['un_attacked']}"; } else if ($r['stole'] == -2) { echo "{$r['un_attacker']} attacked {$r['un_attacked']} and left them"; } else { echo "{$r['un_attacker']} mugged " . money_formatter($r['stole']) . " from {$r['un_attacked']}"; } echo '</td>'; } else { echo " <td>{$r['un_attacked']}</td> <td>Nothing</td> "; } echo '</tr>'; } $db->free_result($q); echo " </table> <br /> Pages:&nbsp; "; for ($i = 1; $i <= $pages; $i++) { $s = ($i - 1) * $app; echo ($s == $st) ? '<b>' . $i . '</b>&nbsp;' : '<a href="staff_logs.php?action=atklogs&st=' . $s . '">' . $i . '</a>&nbsp;'; echo ($i % 25 == 0) ? '<br />' : ''; } $mypage = floor($_GET['st'] / 100) + 1; stafflog_add("Looked at the attack logs (Page $mypage)"); } function view_itm_logs() { global $db, $ir, $c, $h, $userid; echo "<h3>Item Xfer Logs</h3><hr />"; if (!isset($_GET['st'])) { $_GET['st'] = 0; } $st = abs(intval($_GET['st'])); $app = 100; $q = $db->query("SELECT COUNT(`ixFROM`) FROM `itemxferlogs`"); $attacks = $db->fetch_single($q); $db->free_result($q); if ($attacks == 0) { echo 'There have been no item transfers yet.'; return; } $pages = ceil($attacks / $app); echo 'Pages:&nbsp;'; for ($i = 1; $i <= $pages; $i++) { $s = ($i - 1) * $app; echo ($s == $st) ? '<b>' . $i . '</b>&nbsp;' : '<a href="staff_logs.php?action=atklogs&st=' . $s . '">' . $i . '</a>&nbsp;'; echo ($i % 25 == 0) ? '<br />' : ''; } echo " <br /> <table width='100%' cellspacing='1' cellpadding='1' class='table'> <tr> <th>Time</th> <th>Who Sent</th> <th>Who Received</th> <th>Sender's IP</th> <th>Receiver's IP</th> <th>Same IP?</th> <th>Item</th> </tr> "; $q = $db->query( "SELECT `ixTO`, `ixFROM`, `ixQTY`, `ixTIME`, `ixTOIP`, `ixFROMIP`, `u1`.`username` AS `sender`, `u2`.`username` AS `sent`, `i`.`itmname` AS `item` FROM `itemxferlogs` AS `ix` INNER JOIN `users` AS `u1` ON `ix`.`ixFROM` = `u1`.`userid` INNER JOIN `users` AS `u2` ON `ix`.`ixTO` = `u2`.`userid` INNER JOIN `items` AS `i` ON `i`.`itmid` = `ix`.`ixITEM` ORDER BY `ix`.`ixTIME` DESC LIMIT $st, $app"); while ($r = $db->fetch_row($q)) { $same = ($r['ixFROMIP'] == $r['ixTOIP']) ? '<span style="color: red;">Yes</span>' : '<span style="color: green;">No</span>'; echo " <tr> <td>" . date('F j Y, g:i:s a', $r['ixTIME']) . "</td> <td>{$r['sender']} [{$r['ixFROM']}]</td> <td>{$r['sent']} [{$r['ixTO']}]</td> <td>{$r['ixFROMIP']}</td> <td>{$r['ixTOIP']}</td> <td>$same</td> <td>{$r['item']} x{$r['ixQTY']}</td> </tr> "; } $db->free_result($q); echo " </table> <br /> Pages:&nbsp; "; for ($i = 1; $i <= $pages; $i++) { $s = ($i - 1) * $app; echo ($s == $st) ? '<b>' . $i . '</b>&nbsp;' : '<a href="staff_logs.php?action=itmlogs&st=' . $s . '">' . $i . '</a>&nbsp;'; echo ($i % 25 == 0) ? '<br />' : ''; } $mypage = floor($_GET['st'] / 100) + 1; stafflog_add("Looked at the Item Xfer Logs (Page $mypage)"); } function view_cash_logs() { global $db, $ir, $c, $h, $userid; echo "<h3>Cash Xfer Logs</h3>"; if (!isset($_GET['st'])) { $_GET['st'] = 0; } $st = abs(intval($_GET['st'])); $app = 100; $q = $db->query("SELECT COUNT(`cxFROM`) FROM `cashxferlogs`"); $attacks = $db->fetch_single($q); $db->free_result($q); if ($attacks == 0) { echo 'There have been no cash transfers yet.'; return; } $pages = ceil($attacks / $app); echo 'Pages:&nbsp;'; for ($i = 1; $i <= $pages; $i++) { $s = ($i - 1) * $app; echo ($s == $st) ? '<b>' . $i . '</b>&nbsp;' : '<a href="staff_logs.php?action=cashlogs&st=' . $s . '">' . $i . '</a>&nbsp;'; echo ($i % 25 == 0) ? '<br />' : ''; } echo " <br /> <table width='100%' cellspacing='1' cellpadding='1' class='table'> <tr> <th>ID</th> <th>Time</th> <th>User From</th> <th>User To</th> <th>Multi?</th> <th>Amount</th> <th>&nbsp;</th> </tr> "; $q = $db->query( "SELECT `cxAMOUNT`, `cxTO`, `cxFROM`, `cxTIME`, `cxID`, `cxTOIP`, `cxFROMIP`, `u1`.`username` AS `sender`, `u2`.`username` AS `sent` FROM `cashxferlogs` AS `cx` INNER JOIN `users` AS `u1` ON `cx`.`cxFROM` = `u1`.`userid` INNER JOIN `users` AS `u2` ON `cx`.`cxTO` = `u2`.`userid` ORDER BY `cx`.`cxTIME` DESC LIMIT $st, $app"); while ($r = $db->fetch_row($q)) { $m = ($r['cxFROMIP'] == $r['cxTOIP']) ? '<span style="color: red; font-weight: bold;">MULTI</span>' : ''; echo " <tr> <td>{$r['cxID']}</td> <td>" . date("F j, Y, g:i:s a", $r['cxTIME']) . "</td> <td> <a href='viewuser.php?u={$r['cxFROM']}'>{$r['sender']}</a> [{$r['cxFROM']}] (IP: {$r['cxFROMIP']}) </td> <td> <a href='viewuser.php?u={$r['cxTO']}'>{$r['sent']}</a> [{$r['cxTO']}] (IP: {$r['cxTOIP']}) </td> <td>$m</td> <td> " . money_formatter($r['cxAMOUNT']) . "</td> <td> [<a href='staff_punit.php?action=fedform&amp;XID={$r['cxFROM']}'>Jail Sender</a>] [<a href='staff_punit.php?action=fedform&amp;XID={$r['cxTO']}'>Jail Receiver</a>] </td> </tr> "; } $db->free_result($q); echo " </table> <br /> Pages:&nbsp; "; for ($i = 1; $i <= $pages; $i++) { $s = ($i - 1) * $app; echo ($s == $st) ? '<b>' . $i . '</b>&nbsp;' : '<a href="staff_logs.php?action=atklogs&st=' . $s . '">' . $i . '</a>&nbsp;'; echo ($i % 25 == 0) ? '<br />' : ''; } $mypage = floor($_GET['st'] / 100) + 1; stafflog_add("Viewed the Cash Xfer Logs (Page $mypage)"); } function view_bank_logs() { global $db, $ir, $c, $h, $userid; echo "<h3>Bank Xfer Logs</h3>"; if (!isset($_GET['st'])) { $_GET['st'] = 0; } $st = abs(intval($_GET['st'])); $app = 100; $q = $db->query("SELECT COUNT(`cxFROM`) FROM `bankxferlogs`"); $attacks = $db->fetch_single($q); $db->free_result($q); if ($attacks == 0) { echo 'There have been no bank transfers yet.'; return; } $pages = ceil($attacks / $app); echo 'Pages:&nbsp;'; for ($i = 1; $i <= $pages; $i++) { $s = ($i - 1) * $app; echo ($s == $st) ? '<b>' . $i . '</b>&nbsp;' : '<a href="staff_logs.php?action=banklogs&st=' . $s . '">' . $i . '</a>&nbsp;'; echo ($i % 25 == 0) ? '<br />' : ''; } echo " <table width='100%' cellspacing='1' cellpadding='1' class='table'> <tr> <th>ID</th> <th>Time</th> <th>User From</th> <th>User To</th> <th>Multi?</th> <th>Amount</th> <th>Bank Type</th> <th>&nbsp;</th> </tr> "; $q = $db->query( "SELECT `cxAMOUNT`, `cxTO`, `cxFROM`, `cxTIME`, `cxID`, `cxTOIP`, `cxFROMIP`, `cxBANK`, `u1`.`username` AS `sender`, `u2`.`username` AS `sent` FROM `bankxferlogs` AS `cx` INNER JOIN `users` AS `u1` ON `cx`.`cxFROM` = `u1`.`userid` INNER JOIN `users` AS `u2` ON `cx`.`cxTO` = `u2`.`userid` ORDER BY `cx`.`cxTIME` DESC LIMIT $st, $app"); $banks = array('bank' => 'City Bank', 'cyber' => 'Cyber Bank'); while ($r = $db->fetch_row($q)) { $mb = $banks[$r['cxBANK']]; $m = ($r['cxFROMIP'] == $r['cxTOIP']) ? '<span style="color: red; font-weight: bold;">MULTI</span>' : ''; echo " <tr> <td>{$r['cxID']}</td> <td>" . date("F j, Y, g:i:s a", $r['cxTIME']) . "</td> <td> <a href='viewuser.php?u={$r['cxFROM']}'>{$r['sender']}</a> [{$r['cxFROM']}] (IP: {$r['cxFROMIP']}) </td> <td> <a href='viewuser.php?u={$r['cxTO']}'>{$r['sent']}</a> [{$r['cxTO']}] (IP: {$r['cxTOIP']}) </td> <td>$m</td> <td> " . money_formatter($r['cxAMOUNT']) . "</td> <td>$mb</td> <td> [<a href='staff_punit.php?action=fedform&amp;XID={$r['cxFROM']}'>Jail Sender</a>] [<a href='staff_punit.php?action=fedform&amp;XID={$r['cxTO']}'>Jail Receiver</a>] </td> </tr> "; } $db->free_result($q); echo " </table> <br /> Pages:&nbsp; "; for ($i = 1; $i <= $pages; $i++) { $s = ($i - 1) * $app; echo ($s == $st) ? '<b>' . $i . '</b>&nbsp;' : '<a href="staff_logs.php?action=banklogs&st=' . $s . '">' . $i . '</a>&nbsp;'; echo ($i % 25 == 0) ? '<br />' : ''; } $mypage = floor($_GET['st'] / 100) + 1; stafflog_add("Viewed the Bank Xfer Logs (Page $mypage)"); } function view_crys_logs() { global $db, $ir, $c, $h, $userid; echo "<h3>Crystal Xfer Logs</h3>"; if (!isset($_GET['st'])) { $_GET['st'] = 0; } $st = abs(intval($_GET['st'])); $app = 100; $q = $db->query( "SELECT COUNT(`cxFROM`) FROM `crystalxferlogs`"); $attacks = $db->fetch_single($q); $db->free_result($q); if ($attacks == 0) { echo 'There have been no crystal transfers yet.'; return; } $pages = ceil($attacks / $app); echo 'Pages:&nbsp;'; for ($i = 1; $i <= $pages; $i++) { $s = ($i - 1) * $app; echo ($s == $st) ? '<b>' . $i . '</b>&nbsp;' : '<a href="staff_logs.php?action=cryslogs&st=' . $s . '">' . $i . '</a>&nbsp;'; echo ($i % 25 == 0) ? '<br />' : ''; } echo " <table width='100%' cellspacing='1' cellpadding='1' class='table'> <tr> <th>ID</th> <th>Time</th> <th>User From</th> <th>User To</th> <th>Multi?</th> <th>Amount</th> <th>&nbsp;</th> </tr> "; $q = $db->query( "SELECT `cxAMOUNT`, `cxTO`, `cxFROM`, `cxTIME`, `cxID`, `cxTOIP`, `cxFROMIP`, `u1`.`username` AS `sender`, `u2`.`username` AS `sent` FROM `crystalxferlogs` AS `cx` INNER JOIN `users` AS `u1` ON `cx`.`cxFROM` = `u1`.`userid` INNER JOIN `users` AS `u2` ON `cx`.`cxTO` = `u2`.`userid` ORDER BY `cx`.`cxTIME` DESC LIMIT $st, $app"); while ($r = $db->fetch_row($q)) { $m = ($r['cxFROMIP'] == $r['cxTOIP']) ? '<span style="color: red; font-weight: bold;">MULTI</span>' : ''; echo " <tr> <td>{$r['cxID']}</td> <td>" . date("F j, Y, g:i:s a", $r['cxTIME']) . "</td> <td> <a href='viewuser.php?u={$r['cxFROM']}'>{$r['sender']}</a> [{$r['cxFROM']}] (IP: {$r['cxFROMIP']}) </td> <td> <a href='viewuser.php?u={$r['cxTO']}'>{$r['sent']}</a> [{$r['cxTO']}] (IP: {$r['cxTOIP']}) </td> <td>$m</td> <td>{$r['cxAMOUNT']} crystals</td> <td> [<a href='staff_punit.php?action=fedform&amp;XID={$r['cxFROM']}'>Jail Sender</a>] [<a href='staff_punit.php?action=fedform&amp;XID={$r['cxTO']}'>Jail Receiver</a>] </td> </tr> "; } $db->free_result($q); echo " </table> <br /> Pages:&nbsp; "; for ($i = 1; $i <= $pages; $i++) { $s = ($i - 1) * $app; echo ($s == $st) ? '<b>' . $i . '</b>&nbsp;' : '<a href="staff_logs.php?action=cryslogs&st=' . $s . '">' . $i . '</a>&nbsp;'; echo ($i % 25 == 0) ? '<br />' : ''; } $mypage = floor($_GET['st'] / 100) + 1; stafflog_add("Viewed the Crystal Xfer Logs (Page $mypage)"); } function view_mail_logs() { global $db, $ir, $c, $h, $userid; echo "<h3>Mail Logs</h3>"; if (!isset($_GET['st'])) { $_GET['st'] = 0; } $st = abs(intval($_GET['st'])); $app = 100; $q = $db->query("SELECT COUNT(`mail_from`) FROM `mail`"); $attacks = $db->fetch_single($q); if ($attacks == 0) { echo 'There have been no mails sent yet.'; return; } $pages = ceil($attacks / $app); echo 'Pages:&nbsp;'; for ($i = 1; $i <= $pages; $i++) { $s = ($i - 1) * $app; echo ($s == $st) ? '<b>' . $i . '</b>&nbsp;' : '<a href="staff_logs.php?action=maillogs&st=' . $s . '">' . $i . '</a>&nbsp;'; echo ($i % 25 == 0) ? '<br />' : ''; } echo " <table width='100%' cellspacing='1' cellpadding='1' class='table'> <tr> <th>ID</th> <th>Time</th> <th>User From</th> <th>User To</th> <th width>Subj</th> <th width='30%'>Msg</th> <th>&nbsp;</th> </tr> "; $q = $db->query( "SELECT `mail_text`, `mail_subject`, `mail_to`, `mail_from`, `mail_time`, `mail_id`, `u1`.`username` AS `sender`, `u2`.`username` AS `sent` FROM `mail` AS `m` INNER JOIN `users` AS `u1` ON `m`.`mail_from` = `u1`.`userid` INNER JOIN `users` AS `u2` ON `m`.`mail_to` = `u2`.`userid` WHERE `m`.`mail_from` != 0 ORDER BY `m`.`mail_time` DESC LIMIT $st, $app"); while ($r = $db->fetch_row($q)) { echo " <tr> <td>{$r['mail_id']}</td> <td>" . date("F j, Y, g:i:s a", $r['mail_time']) . "</td> <td>{$r['sender']} [{$r['mail_from']}]</td> <td>{$r['sent']} [{$r['mail_to']}]</td> <td>{$r['mail_subject']}</td> <td>" . strip_tags($r['mail_text']) . "</td> <td> [<a href='staff_punit.php?action=mailform&amp;XID={$r['mail_from']}'>MailBan Sender</a>] [<a href='staff_punit.php?action=mailform&amp;XID={$r['mail_to']}'>MailBan Receiver</a>] </td> </tr> "; } $db->free_result($q); echo " </table> <br /> Pages:&nbsp; "; for ($i = 1; $i <= $pages; $i++) { $s = ($i - 1) * $app; echo ($s == $st) ? '<b>' . $i . '</b>&nbsp;' : '<a href="staff_logs.php?action=maillogs&st=' . $s . '">' . $i . '</a>&nbsp;'; echo ($i % 25 == 0) ? '<br />' : ''; } $mypage = floor($_GET['st'] / 100) + 1; stafflog_add("Viewed the Mail Logs (Page $mypage)"); } function view_staff_logs() { global $db, $ir, $c, $h, $userid; if ($ir['user_level'] != 2) { echo 'Page cannot be accessed.'; die($h->endpage()); } echo "<h3>Staff Logs</h3>"; if (!isset($_GET['st'])) { $_GET['st'] = 0; } $st = abs(intval($_GET['st'])); $app = 100; $q = $db->query("SELECT COUNT(`user`) FROM `stafflog`"); $attacks = $db->fetch_single($q); if ($attacks == 0) { echo 'There have been no staff actions yet.'; return; } $pages = ceil($attacks / $app); echo 'Pages:&nbsp;'; for ($i = 1; $i <= $pages; $i++) { $s = ($i - 1) * $app; echo ($s == $st) ? '<b>' . $i . '</b>&nbsp;' : '<a href="staff_logs.php?action=stafflogs&st=' . $s . '">' . $i . '</a>&nbsp;'; echo ($i % 25 == 0) ? '<br />' : ''; } echo " <table width='100%' cellspacing='1' cellpadding='1' class='table'> <tr> <th>Staff</th> <th>Action</th> <th>Time</th> <th>IP</th> </tr> "; $q = $db->query( "SELECT `ip`, `time`, `action`, `user`, `u`.`username` FROM `stafflog` AS `s` INNER JOIN `users` AS `u` ON `s`.`user` = u.`userid` ORDER BY `s`.`time` DESC LIMIT $st, $app"); while ($r = $db->fetch_row($q)) { echo " <tr> <td>{$r['username']} [{$r['user']}]</td> <td>{$r['action']}</td> <td>" . date('F j Y g:i:s a', $r['time']) . "</td> <td>{$r['ip']}</td> </tr> "; } $db->free_result($q); echo " </table> <br /> Pages:&nbsp; "; for ($i = 1; $i <= $pages; $i++) { $s = ($i - 1) * $app; echo ($s == $st) ? '<b>' . $i . '</b>&nbsp;' : '<a href="staff_logs.php?action=stafflogs&st=' . $s . '">' . $i . '</a>&nbsp;'; echo ($i % 25 == 0) ? '<br />' : ''; } } $h->endpage();
  15. Nice thank you, but when I put the code in header file, I get this instead: default mccodes header: <?php /** * MCCodes Version 2.0.5b * Copyright (C) 2005-2012 Dabomstew * All rights reserved. * * Redistribution of this code in any form is prohibited, except in * the specific cases set out in the MCCodes Customer License. * * This code license may be used to run one (1) game. * A game is defined as the set of users and other game database data, * so you are permitted to create alternative clients for your game. * * If you did not obtain this code from MCCodes.com, you are in all likelihood * using it illegally. Please contact MCCodes to discuss licensing options * in this case. * * File: header.php * Signature: 52c201ce2e8c549ae70d2936473022f0 * Date: Fri, 20 Apr 12 08:50:30 +0000 */ class headers { function startheaders() { global $ir, $set; echo <<<EOF <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="css/game.css" type="text/css" rel="stylesheet" /> <title>{$set['game_name']}</title> </head> <body> <center> <table width="970" border="0" cellpadding="0" cellspacing="0" class="table2"> <tr> <td class="lgrad"></td> <td class="center"> EOF; } function userdata($ir, $lv, $fm, $cm, $dosessh = 1) { global $db, $c, $userid, $set; $IP = $db->escape($_SERVER['REMOTE_ADDR']); $db->query( "UPDATE `users` SET `laston` = {$_SERVER['REQUEST_TIME']}, `lastip` = '$IP' WHERE `userid` = $userid"); if (!$ir['email']) { global $domain; die( "<body>Your account may be broken. Please mail help@{$domain} stating your username and player ID."); } if (!isset($_SESSION['attacking'])) { $_SESSION['attacking'] = 0; } if ($dosessh && ($_SESSION['attacking'] || $ir['attacking'])) { echo "You lost all your EXP for running from the fight."; $db->query( "UPDATE `users` SET `exp` = 0, `attacking` = 0 WHERE `userid` = $userid"); $_SESSION['attacking'] = 0; } $enperc = min((int) ($ir['energy'] / $ir['maxenergy'] * 100), 100); $wiperc = min((int) ($ir['will'] / $ir['maxwill'] * 100), 100); $experc = min((int) ($ir['exp'] / $ir['exp_needed'] * 100), 100); $brperc = min((int) ($ir['brave'] / $ir['maxbrave'] * 100), 100); $hpperc = min((int) ($ir['hp'] / $ir['maxhp'] * 100), 100); $enopp = 100 - $enperc; $wiopp = 100 - $wiperc; $exopp = 100 - $experc; $bropp = 100 - $brperc; $hpopp = 100 - $hpperc; $d = ""; $u = $ir['username']; if ($ir['donatordays']) { $u = "<span style='color: red;'>{$ir['username']}</span>"; $d = "<img src='donator.gif' alt='Donator: {$ir['donatordays']} Days Left' title='Donator: {$ir['donatordays']} Days Left' />"; } $gn = ""; global $staffpage; $bgcolor = 'FFFFFF'; print <<<OUT <img src="title.jpg" alt="Mccodes Version 2" /><br /> <!-- Begin Main Content --> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="20%" bgcolor="#$bgcolor" valign="top"> <!-- Side Panel --> <b>Name:</b> $gn{$u} [{$ir['userid']}] $d<br /> <b>Money:</b> {$fm}<br /> <b>Level:</b> {$ir['level']}<br /> <b>Crystals:</b> {$ir['crystals']}<br /> [<a href='logout.php'>Emergency Logout</a>] <hr /> <b>Energy:</b> {$enperc}%<br /> <img src='greenbar.png' width='$enperc' height='10' /><img src='redbar.png' width='$enopp' height='10' /><br /> <b>Will:</b> {$wiperc}%<br /> <img src='bluebar.png' width='$wiperc' height='10' /><img src='redbar.png' width='$wiopp' height='10' /><br /> <b>Brave:</b> {$ir['brave']}/{$ir['maxbrave']}<br /> <img src='yellowbar.png' width='$brperc' height='10' /><img src='redbar.png' width='$bropp' height='10' /><br /> <b>EXP:</b> {$experc}%<br /> <img src='navybar.png' width='$experc' height='10' /><img src='redbar.png' width='$exopp' height='10' /><br /> <b>Health:</b> {$hpperc}%<br /> <img src='greenbar.png' width='$hpperc' height='10' /><img src='redbar.png' width='$hpopp' height='10' /><br /><hr /> <!-- Links --> OUT; if ($ir['fedjail'] > 0) { $q = $db->query( "SELECT * FROM `fedjail` WHERE `fed_userid` = $userid"); $r = $db->fetch_row($q); die( "<span style='font-weight: bold; color:red;'> You have been put in the {$set['game_name']} Federal Jail for {$r['fed_days']} day(s).<br /> Reason: {$r['fed_reason']} </span></body></html>"); } if (file_exists('ipbans/' . $IP)) { die( "<span style='font-weight: bold; color:red;'> Your IP has been banned from {$set['game_name']}, there is no way around this. </span></body></html>"); } } function menuarea() { define('jdsf45tji', true, true); include 'mainmenu.php'; global $ir, $c; $bgcolor = 'FFFFFF'; print '</td><td width="2" class="linegrad" bgcolor="#' . $bgcolor . '">&nbsp;</td><td width="80%" bgcolor="#' . $bgcolor . '" valign="top"><br /><center>'; if ($ir['hospital']) { echo "<b>NB:</b> You are currently in hospital for {$ir['hospital']} minutes.<br />"; } if ($ir['jail']) { echo "<b>NB:</b> You are currently in jail for {$ir['jail']} minutes.<br />"; } echo "<a href='donator.php'><b>Donate to {$set['game_name']} now for game benefits!</b></a><br />"; } function smenuarea() { define('jdsf45tji', true, true); include 'smenu.php'; global $ir, $c; $bgcolor = 'FFFFFF'; print '</td><td width="2" class="linegrad" bgcolor="#' . $bgcolor . '">&nbsp;</td><td width="80%" bgcolor="#' . $bgcolor . '" valign="top"><center>'; } function endpage() { global $db, $ir; $query_extra = ''; if (isset($_GET['mysqldebug']) && $ir['user_level'] == 2) { $query_extra = '<br />' . implode('<br />', $db->queries); } print <<<OUT </center> </td> </tr> </table></td> <td class="rgrad"></td> </tr> <tr> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="dgradl">&nbsp;</td> <td class="dgrad">&nbsp;</td> <td class="dgradr">&nbsp;</td> </tr> </table> </td> </tr> </table> {$db->num_queries} queries{$query_extra}</body> </html> OUT; } }
  16. Thanks, I'm going for simplicity so I'm hoping it won't be a difficult job!
  17. Ok, I need something like this but obviously with borders and colour scheme: And I need it to be easily customisable (colours etc) from the code.
  18. Hi, like the title suggests - I need a simple and clear layout made with CSS. Please quote me a price though private messages and I'll see if I can meet it, and then I will provide further details on what I'm looking for. Thank you πŸ™‚
  19. Nvm..
  20. This version somewhat works for me, except for these errors and the page cuts off at the end for me, so I can't complete the trade. Theres no submit button. Any help would be appreciated
  21. Yh sorry πŸ˜… I edited my original post
  22. I can't view threads, instead I get this A critical error has occurred, and page execution has stopped. Below are the details: PHP Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead (2) Action taken: Line executed: C:\xampp\htdocs\bbcode_engine.php:181 bbcode_engine.php file line 180 - 183 $text = preg_replace($this->parsings[$i], $this->htmls[$i], $text); $i++; }
  23. Ah ok, thanks for clearing that up
×
×
  • Create New...