Samurai Legend
Members-
Posts
483 -
Joined
-
Last visited
-
Days Won
5
Content Type
Profiles
Forums
Events
Everything posted by Samurai Legend
-
I want to code the top 5 players for my game. However I don't know how to implant it to the html...? I coded the top 5 players..But I need help implanting it. Code - $_SESSION['top_username'] = ' '; $query = $db->query("SELECT `userid`, `username`, `laston` FROM `users` WHERE `user_level` != '0' && `fedjail` = '0' ORDER BY `level` DESC LIMIT 5"); while($r=$db->fetch_row($query)) { $length = 18; $text = "{$r['username']}" ; $display = substr($text, 0, $length) ; $_SESSION['top_username'].= "$display [{$r['userid']}]<br />"; } $_SESSION['top_userlevel'] = ' '; $query = $db->query("SELECT `level` FROM `users` WHERE `user_level` != '0' && `fedjail` = '0' ORDER BY `level` DESC LIMIT 5"); while($r=$db->fetch_row($query)) { $length = 18; $text = "{$r['level']}" ; $display = substr($text, 0, $length) ; $_SESSION['top_userlevel'].= "$display<br />"; } This is how I want it - [ATTACH=CONFIG]1469[/ATTACH] HTML - echo<<<EOF <div class="well"> <div class="sbox-head">Top 5 Players</div> <div class="sbox-content"> <ul style="list-style: none; margin: 0; font-size: 11px;"> <li style="box-shadow: 0 1px 0 #0b0a0a, 0 2px 0 rgba(255,255,255,.03);"> <h5 style="font-size: 12px; color: #B09E8F; font-weight: bold; margin: 0; padding: 0;">1. Hattori Hanzo</h5> <p style="margin: 0; padding: 0"><b>Clan:</b> <i>Rogue Ninjaz</i> </p> <p style="margin: 0; padding: 0"><b>Status:</b> <span style="color: green">Online now!</span> </p> </li> <li style="box-shadow: 0 1px 0 #0b0a0a, 0 2px 0 rgba(255,255,255,.03);"> <h5 style="font-size: 12px; color: #B09E8F; font-weight: bold; margin: 0; padding: 0;">2. Date Masamune</h5> <p style="margin: 0; padding: 0"><b>Clan:</b> <i>N/A</i> </p> <p style="margin: 0; padding: 0"><b>Status:</b> <span style="color: red">Offline!</span> </p> </li> <li style="box-shadow: 0 1px 0 #0b0a0a, 0 2px 0 rgba(255,255,255,.03);"> <h5 style="font-size: 12px; color: #B09E8F; font-weight: bold; margin: 0; padding: 0;">3. Xu Wei</h5> <p style="margin: 0; padding: 0"><b>Clan:</b> <i>The Dynasty Warriors</i> </p> <p style="margin: 0; padding: 0"><b>Status:</b> <span style="color: green">Online now!</span> </p> </li> <li style="box-shadow: 0 1px 0 #0b0a0a, 0 2px 0 rgba(255,255,255,.03);"> <h5 style="font-size: 12px; color: #B09E8F; font-weight: bold; margin: 0; padding: 0;">4. Death_Ronin</h5> <p style="margin: 0; padding: 0"><b>Clan:</b> <i>Rogue Ninjaz</i> </p> <p style="margin: 0; padding: 0"><b>Status:</b> <span style="color: red">Offline!</span> </p> </li> <li style="box-shadow: 0 1px 0 #0b0a0a, 0 2px 0 rgba(255,255,255,.03);"> <h5 style="font-size: 12px; color: #B09E8F; font-weight: bold; margin: 0; padding: 0;">5. Kimu Hasabe</h5> <p style="margin: 0; padding: 0"><b>Clan:</b> <i>The Imperial Samurai</i> </p> <p style="margin: 0; padding: 0"><b>Status:</b> <span style="color: red">Offline!</span> </p> </li> </ul> </div> </div> </div> EOF;
-
I am trying to make a staff file where I can change peoples passwords just incase. function change_pass() { global $db, $ir, $c, $h, $userid; if ($ir['user_level'] != 2) { echo 'You cannot access this area.<br /> > <a href="staff.php">Go Back</a>'; die($h->endpage()); } $_POST['userid'] = (isset($_POST['userid']) && is_numeric($_POST['userid'])) ? abs(intval($_POST['userid'])) : 0; if (!empty($_POST['userid'])) { staff_csrf_stdverify('staff_password', 'staff_users.php?action=password'); $d = $db->query("SELECT `userid`,`username`,`user_level`,`pass_salt` FROM `users` WHERE `userid` = '{$_POST['userid']}' LIMIT 1"); $r = $db->fetch_row($d); $newpw = stripslashes($_POST['password']); $new_psw = $db->escape(encode_password($newpw, $r['pass_salt'])); $db->query( "UPDATE `users` SET `userpass` = '{$new_psw}' WHERE `userid` = {$r['userid']}"); stafflog_add('Changed password for ' . $r['username'] . ' [' . $r['userid'] . ']'); echo ' Password change for ' . $r['username'] . '. <br /> > <a href="staff.php">Go Staff Page</a> '; } else { $csrf = request_csrf_html('staff_password'); echo " <h3>Change Password</h3> <hr /> Change user password. <form action='staff_users.php?action=password' method='post'> User: " . user_dropdown(NULL, 'userid') . " <br /> Password: <input type='text' name='password' /><br /> {$csrf} <input type='submit' value='Change' /> </form> "; } } However I get no errors...But it doesn't change the password to what I want? No worries! I got it fixed.
-
That works great! Shows no errors! Thanks man! Much appreciated :)
-
function craft() { global $ir, $h, $db, $userid; $already_crafting = $db->query("SELECT `userid`,`item_given` FROM `craft_inprogress` WHERE `userid`={$userid}"); if($db->num_rows($already_crafting)) { echo "<div class='error'>You are already crafting!</div>"; exit($h->endpage()); } if(!$_GET['id']) { index(); exit($h->endpage()); } $_GET['id'] = filter_var($_GET['id'], FILTER_VALIDATE_INT) ? abs( (int) $_GET['id']) : 0; $exist = $db->query("SELECT * FROM `craft_mod` WHERE `id`={$_GET['id']}"); if($db->num_rows($exist) == 0) { echo "<div class='error'>We couldn't find the blueprints for the item you wanted to craft!</div>"; exit($h->endpage()); } $r = $db->fetch_row($exist); if($r['donator'] AND $ir['donatordays'] == 0) { echo "<div class='error'>You cannot craft this item!</div>"; exit($h->endpage()); } $item_given = $db->fetch_row($db->query("SELECT `itmname` FROM `items` WHERE `itmid`={$r['item_given']}")); ?> <h3>Crafting; <?php echo $item_given['itmname']; ?></h3> <?php $can_craft = TRUE; $ex = explode(",", $r['items_needed']); $qty = explode(",", $r['qty_needed']); $n = 0; foreach($ex as $i) { $get_items_needed = $db->query("SELECT `itmname` FROM `items` WHERE `itmid`={$i}"); $t = $db->fetch_row($get_items_needed); $do_they_have = $db->query("SELECT `inv_itemid` FROM `inventory` WHERE `inv_userid`={$userid} AND `inv_itemid`={$i} AND `inv_qty`>={$qty[$n]}"); if($db->num_rows($do_they_have) == 0) { $needs = $t['itmname']." x ". $qty[$n]; $can_craft = FALSE; } $items_needed .= $needs .","; $n++; } if(isset($items_needed)) { $criteria = "You need the following items;<br />".$items_needed."<br />"; } unset($n); if($r['level_needed'] > $ir['level']) { $criteria .= "You need to advance in level before you can craft this item<br />"; $can_craft = FALSE; } if($r['money_needed'] > $ir['money']) { $criteria .= "You need more money before you can craft this item<br />"; $can_craft = FALSE; } if($r['coins_needed'] > $ir['coins']) { $criteria .= "You need more coins before you can craft this item<br />"; $can_craft = FALSE; } if($r['minimum_days'] > $ir['daysold']) { $criteria .= "You need to wait ". $ir['minimum_days'] - $ir['daysold'] ." days before you can craft this item<br />"; $can_craft = FALSE; } if($r['course_needed']) { $get_course = $db->query("SELECT `name` FROM `education_courses` WHERE `ID`={$r['course_needed']}"); $co = $db->fetch_row($get_course); $have_i_completed = $db->query("SELECT `userid` FROM `education_coursesdone` WHERE `userid`={$userid} AND `courseid`={$r['course_needed']}"); if($db->num_rows($have_i_completed) == 0) { $criteria .= "You need to complete the ".$co['name']." course before you can craft this item<br />"; $can_craft = FALSE; } } if($can_craft) { if($r['time_to_complete'] > 0) { ?> <div class='notice'>The <?php echo $item_given['itmname']; ?> is in progress of crafting!</div> <?php $time = time() + $r['time_to_complete']; $db->query("INSERT INTO `craft_inprogress` (`userid`,`item_given`,`endtime`) VALUES ({$userid}, {$r['item_given']}, {$time})"); } else { ?> <div class='notice'>You have successfully crafted <?php echo $item_given['itmname']; ?>. You put it in your inventory!</div> <?php item_add($userid, $r['item_given'], 1); } $ex = explode(",", $r['items_needed']); $qty = explode(",", $r['qty_needed']); $n = 0; foreach($ex as $i) { item_remove($userid, $i, $qty[$n]); $n++; } unset($n); unset($ex); unset($qty); if($r['money_needed']) { $db->query("UPDATE `users` SET `money`=`money`-{$r['money_needed']} WHERE `userid`={$userid}"); } if($r['coins_needed']) { $db->query("UPDATE `users` SET `coins`=`coins`-{$r['coins_needed']} WHERE `userid`={$userid}"); } exit($h->endpage()); } else { echo "<div class='error'><strong>You cannot craft this item, for the following reasons;</strong><br />".$criteria."</div>"; exit($h->endpage()); } }
-
function craft() { global $ir, $h, $db, $userid; $already_crafting = $db->query("SELECT `userid`,`item_given` FROM `craft_inprogress` WHERE `userid`={$userid}"); if($db->num_rows($already_crafting)) { echo "<div class='error'>You are already crafting!</div>"; exit($h->endpage()); } if(!$_GET['id']) { index(); exit($h->endpage()); } $_GET['id'] = filter_var($_GET['id'], FILTER_VALIDATE_INT) ? abs( (int) $_GET['id']) : 0; $exist = $db->query("SELECT * FROM `craft_mod` WHERE `id`={$_GET['id']}"); if($db->num_rows($exist) == 0) { echo "<div class='error'>We couldn't find the blueprints for the item you wanted to craft!</div>"; exit($h->endpage()); } $r = $db->fetch_row($exist); if($r['donator'] AND $ir['donatordays'] == 0) { echo "<div class='error'>You cannot craft this item!</div>"; exit($h->endpage()); } $item_given = $db->fetch_row($db->query("SELECT `itmname` FROM `items` WHERE `itmid`={$r['item_given']}")); ?> <h3>Crafting; <?php echo $item_given['itmname']; ?></h3> <?php $can_craft = TRUE; $ex = explode(",", $r['items_needed']); $qty = explode(",", $r['qty_needed']); $n = 0; foreach($ex as $i) { $get_items_needed = $db->query("SELECT `itmname` FROM `items` WHERE `itmid`={$i}"); $t = $db->fetch_row($get_items_needed); $do_they_have = $db->query("SELECT `inv_itemid` FROM `inventory` WHERE `inv_userid`={$userid} AND `inv_itemid`={$i} AND `inv_qty`>={$qty[$n]}"); if($db->num_rows($do_they_have) == 0) { $needs = $t['itmname']." x ". $qty[$n]; $can_craft = FALSE; } $items_needed = ''; foreach ( $n as $n => $n ) { //code $items_needed .= $needs . ","; //code } $n++; } if(isset($items_needed)) { $criteria = "You need the following items;<br />".$items_needed."<br />"; } unset($n); if($r['level_needed'] > $ir['level']) { $criteria .= "You need to advance in level before you can craft this item<br />"; $can_craft = FALSE; } if($r['money_needed'] > $ir['money']) { $criteria .= "You need more money before you can craft this item<br />"; $can_craft = FALSE; } if($r['coins_needed'] > $ir['coins']) { $criteria .= "You need more coins before you can craft this item<br />"; $can_craft = FALSE; } if($r['minimum_days'] > $ir['daysold']) { $criteria .= "You need to wait ". $ir['minimum_days'] - $ir['daysold'] ." days before you can craft this item<br />"; $can_craft = FALSE; } if($r['course_needed']) { $get_course = $db->query("SELECT `name` FROM `education_courses` WHERE `ID`={$r['course_needed']}"); $co = $db->fetch_row($get_course); $have_i_completed = $db->query("SELECT `userid` FROM `education_coursesdone` WHERE `userid`={$userid} AND `courseid`={$r['course_needed']}"); if($db->num_rows($have_i_completed) == 0) { $criteria .= "You need to complete the ".$co['name']." course before you can craft this item<br />"; $can_craft = FALSE; } } if($can_craft) { if($r['time_to_complete'] > 0) { ?> <div class='notice'>The <?php echo $item_given['itmname']; ?> is in progress of crafting!</div> <?php $time = time() + $r['time_to_complete']; $db->query("INSERT INTO `craft_inprogress` (`userid`,`item_given`,`endtime`) VALUES ({$userid}, {$r['item_given']}, {$time})"); } else { ?> <div class='notice'>You have successfully crafted <?php echo $item_given['itmname']; ?>. You put it in your inventory!</div> <?php item_add($userid, $r['item_given'], 1); } $ex = explode(",", $r['items_needed']); $qty = explode(",", $r['qty_needed']); $n = 0; foreach($ex as $i) { item_remove($userid, $i, $qty[$n]); $n++; } unset($n); unset($ex); unset($qty); if($r['money_needed']) { $db->query("UPDATE `users` SET `money`=`money`-{$r['money_needed']} WHERE `userid`={$userid}"); } if($r['coins_needed']) { $db->query("UPDATE `users` SET `coins`=`coins`-{$r['coins_needed']} WHERE `userid`={$userid}"); } exit($h->endpage()); } else { echo "<div class='error'><strong>You cannot craft this item, for the following reasons;</strong><br />".$criteria."</div>"; exit($h->endpage()); } } Something like that? Sorry I don't understand...But I am trying xD
-
Well I heard it's free? I didn't say it is free. And I swear Grant released it free under GPU license or whatever.
-
It's MCCodes error handler which shows every error. If I turn it off, then it will not show the errors. However I want every error to be gone xD Everything working fine too.
-
Here is the error - A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined variable: needs (8) Line executed: /home/samurai/public_html/craft.php:178 A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined variable: items_needed (8) Line executed: /home/samurai/public_html/craft.php:178 Line 178 - $items_needed .= $needs .","; I tried everything to fix, however I cannot!
-
Which Mobile operating system do you prefer?
Samurai Legend replied to Jan Kaufmann's topic in Tech News
Compare to Apple IOS. A lot. -
Which Mobile operating system do you prefer?
Samurai Legend replied to Jan Kaufmann's topic in Tech News
I have a Nexus 5. It's probably one of the best phones you can get. My two older brothers have an Iphone 5. And my whole family share an IPad. To be honest I don't like it at all. Android is probably best OS you will every get. With android you can do many things. -
I can't stand him. His just an ignorant little brat. Also tried to scam me but failed.
-
Might check this out later :p
-
Template for sale! *Samurai Theme*
Samurai Legend replied to Samurai Legend's topic in Art and Content
$60 last price! Free installation to any MCCodes game. -
Yes I understand. Thanks for the feedback. This is my first game I have ever made...So this is why it's quite hard for me. Other people once they just think it's a good game they have created. They will just release it straight away. I am taking my time on the game. I will probably release the game within 2-3 months. I don't know to be honest. How ever my game is not unique yet. But however I am willing to do anything to make it different.
-
As most of you probably know, I am still developing Samurai Assault. I ran out of ideas and I need help! I need to know what will be the best thing to add to my game. How to make sure the economy is smooth! And make sure I am a great Admin! I also need to know what is the best place to advertise my game! I want to spend around $60 a month on advertising. Then probably later on when I open my game I will invest more money! I need good competition ideas to for the game. I also want my game to be unique. Bits of the game other people have in their game which I do not want. I want to be different. But since I got into another accident. Thing have turned down on me a bit. However I am recovering and trying my best to get Samurai Assault up and running! So I need big help! I need new unique ideas for the game. So please help me out!
-
I also eat tea.
-
I like this idea! I can't wait for it!
-
Thank you very much, I just want to thanks Florian too for providing me the template for the game. Been working my arse off. Thanks again!
-
Screen shot added. PHP Formatted. - - - Updated - - - Yes, "clan" just need to be replaced with the word "gang". If you do that then it should be able to work. Unless your database is called something else.
-
I was just going to say that xD However this is great! Found out how to work it out! And it works great. However I need the CSS image of the bar to be changed to? Any ways I can do that?
-
I am really confused. Where do I add what?
-
I found a users online script on my computer. I then decided to re-code it. The coding may be terrible but I tried my best! Add this somewhere in your global_func.php - $goback = "<a onclick='window.history.go(-1);' style='cursor: pointer;'>>Go Back</a>"; Make a new php file called usersonline.php and add - <?php require('globals.php'); $records = $db->query("SELECT `recid`,`rec15`,`rec30`,`rec24`,`rec60` FROM `records` WHERE recid = 1", $c); $v = $db->fetch_row($records); $query = $db->query("SELECT `username` FROM `users` WHERE `laston` > unix_timestamp()-200*720 ORDER BY `laston` DESC", $c); $day = $db->num_rows($query); $query = $db->query("SELECT `username` FROM `users` WHERE `laston` > unix_timestamp()-60*60 ORDER BY `laston` DESC", $c); $sixty = $db->num_rows($query); $query = $db->query("SELECT `username` FROM `users` WHERE `laston` > unix_timestamp()-30*60 ORDER BY `laston` DESC", $c); $thirty = $db->num_rows($query); $query = $db->query("SELECT `username` FROM `users` WHERE `laston` > unix_timestamp()-15*60 ORDER BY `laston` DESC", $c); $fifteen = $db->num_rows($query); if ($v['rec15'] < $fifteen) { $db->query("UPDATE `records` SET `rec15`='$fifteen' WHERE `recid` = 1", $c); } if ($v['rec30'] < $thirty) { $db->query("UPDATE `records` SET `rec30`='$thirty' WHERE `recid` = 1", $c); } if ($v['rec24'] < $day) { $db->query("UPDATE `records` SET `rec24`='$day' WHERE `recid` = 1", $c); } if ($v['rec60'] < $sixty) { $db->query("UPDATE `records` SET `rec60`='$sixty' WHERE `recid` = 1", $c); } echo "<h3 align='center'>Users Online</h3> <hr width='100%'> <table width='100%' class='table'> <tr><th colspan='4'>Time Changer</th></tr> <tr align='center'> <td>[<a href='usersonline.php?view=fifteen'>15 Mins</a>]</td> <td>[<a href='usersonline.php?view=thirty'>30 Mins</a>]</td> <td>[<a href='usersonline.php?view=hour'>1 Hour</a>]</td> <td>[<a href='usersonline.php?view=today'>Today</a>]</td> </tr></table> <table width='100%' class='table'> <tr> <th>Statistics</th> <th>Record</th> <th>Name Legend</th> </tr> <td>"; $q = $db->query("SELECT COUNT(*) as `cnt` FROM `users` WHERE `laston` > unix_timestamp()-15*60 ORDER BY `laston` DESC", $c); while ($r = $db->fetch_row($q)) echo "Users online in the last 15 mins <font color='white'>$r[cnt]</font><br />"; $q = $db->query("SELECT COUNT(*) as `cnt` FROM `users` WHERE `laston` > unix_timestamp()-30*60 ORDER BY `laston` DESC", $c); while ($r = $db->fetch_row($q)) echo "Users online in the last 30 mins <font color='white'>$r[cnt]</font><br />"; $q = $db->query("SELECT COUNT(*) as `cnt` FROM `users` WHERE `laston` > unix_timestamp()-60*60 ORDER BY `laston` DESC", $c); while ($r = $db->fetch_row($q)) echo "Users online in the last 1 Hour <font color='white'>$r[cnt]</font><br />"; $q = $db->query("SELECT COUNT(*) as `cnt` FROM `users` WHERE `laston` > unix_timestamp()-200*720 ORDER BY `laston` DESC", $c); while ($r = $db->fetch_row($q)) echo "Users online in the last 24 Hours <font color='white'>$r[cnt]</font>"; echo "</td> <td>"; echo " Record online in the last 15 mins <font color='white'>{$v['rec15']}</font><br /> Record online in the last 30 mins <font color='white'>{$v['rec30']}</font><br /> Record online in the last 1 Hour <font color='white'>{$v['rec60']}</font><br /> Record online in the last 24 Hours <font color='white'>{$v['rec24']}</font><br />"; echo "</td> <td> <img src='images/staff.gif' width='15'/>Staff Icon <br /> <font color='red'>Red</font> Names are Admin <br /> <font color='#1E90FF'>Dodger Blue</font> Names are Developer <br /> <font color='blue'>Blue</font> Names are Secretary <br /> <font color='green'>Green</font> Names are Moderator <br /> <font color='cyan'>Cyan</font> Names are Assistant <br /> <font color='#008B8B'>Dark Cyan</font> Names are Donator <br /> <img src='images/donator.gif' width='15'/> Donator Star <br /> </td></tr></table>"; if (!isset($_GET['view'])) { $_GET['view'] = ''; } switch ($_GET['view']) { case 'fifteen': fifteen(); break; case 'thirty': thirty(); break; case 'hour': hour(); break; case 'today': today(); break; default: fifteen(); break; } function fifteen() { global $ir, $c, $userid, $db, $h; echo "<table width = '100%' class = 'table'><tr align ='center'><th>Users On In The Last 15 Mins</th></tr></table>"; $q = $db->query("SELECT COUNT(*) as `cnt` FROM `users` WHERE `laston` > unix_timestamp()-15*60 ORDER BY `laston` DESC", $c); while ($r = $db->fetch_row($q)) echo "<table width = '100%' class='table'><tr> <th>&nsbp;</th> <th>Users</th> <th>Last Hit</th> <th>Time Online</th> <th>Level</th> <th>Mail</th> <th>Attack</th> </tr>"; $cn = 0; $q = $db->query("SELECT `u`.*,`g`.* FROM `users` `u` LEFT JOIN `clans` `g` ON `g`.`clanID`=`u`.`clan` WHERE `u`.`laston` > unix_timestamp()-15*60 ORDER BY `laston` DESC", $c); while ($r = $db->fetch_row($q)) { $lon = date('F j, Y g:i:s a', $r['laston']); $la = time() - $r['laston']; $unit = "secs"; if ($la >= 60) { $la = (int) ($la / 60); $unit = "mins"; } if ($la >= 60) { $la = (int) ($la / 60); $unit = "hours"; if ($la >= 24) { $la = (int) ($la / 24); $unit = "days"; } } $lb = time() - $r['last_login']; $units = "secs"; if ($lb >= 60) { $lb = (int) ($lb / 60); $units = "mins"; } if ($lb >= 60) { $lb = (int) ($lb / 60); $units = "hours"; if ($lb >= 24) { $lb = (int) ($lb / 24); $units = "days"; } } if ($r['laston'] <= time() - 15 * 60) { $lb = "offline"; $units = ""; } if ($r['donatordays']) { $d = "<img src='/images/donator.gif' width='15' alt='Donator: {$r['donatordays']} Days Left' title='Donator: {$r['donatordays']} Days Left' />"; } else { $d = ""; } if ($r['user_level'] > 1) { $staff = "<img src='images/staff.gif 'width='15' alt='Staff' title='Staff' />"; } else { $staff = ""; } if ($r['clan']) { $qg = $db->query("SELECT clanPREF FROM `clans` WHERE `clanID` = {$r['clan']}", $c); $rr = $db->fetch_row($qg); $gn = "[" . $rr['clanPREF'] . "]"; } else { $gn = ""; } $cn++; if ($r['user_level'] == 2) { $user = "<font color='red'>{$r['username']}</font>"; } else if ($r['user_level'] == 3) { $user = "<font color='blue'>{$r['username']}</font>"; } else if ($r['user_level'] == 4) { $user = "<font color='green'>{$r['username']}</font>"; } else if ($r['user_level'] == 5) { $user = "<font color='cyan'>{$r['username']}</font>"; } else if ($r['user_level'] == 6) { $user = "<font color='#1E90FF'>{$r['username']}</font>"; } else if ($r['donatordays']) { $user = "<font color='#008B8B'>{$r['username']}</font>"; } else { $user = "{$r['username']}"; } echo "<tr><td>$cn. </td><td>$gn <a href='viewuser.php?u={$r['userid']}'>$user</a> $d $staff</td><td>($la $unit)</td><td>({$lb} {$units})</td><td>{$r['level']}</td><td><a href='mailbox.php?action=compose&ID={$r['userid']}'>Mail</a></td><td><a href='attack.php?ID={$r['userid']}'>Attack</a></td></tr>"; } echo "</table>"; } function thirty() { global $ir, $c, $userid, $db, $h; echo "<table width = '100%' class = 'table'><tr align ='center'><th>Users On In The Last 30 Mins</th></tr></table>"; $q = $db->query("SELECT COUNT(*) as `cnt` FROM `users` WHERE `laston` > unix_timestamp()-30*60 ORDER BY `laston` DESC", $c); while ($r = $db->fetch_row($q)) echo "<table width = '100%' class='table'><tr> <th>&nsbp;</th> <th>Users</th> <th>Last Hit</th> <th>Time Online</th> <th>Level</th> <th>Mail</th> <th>Attack</th> </tr>"; $cn = 0; $q = $db->query("SELECT `u`.*,`g`.* FROM `users` `u` LEFT JOIN `clans` `g` ON `g`.`clanID`=`u`.`clan` WHERE `u`.`laston` > unix_timestamp()-30*60 ORDER BY `laston` DESC", $c); while ($r = $db->fetch_row($q)) { $lon = date('F j, Y g:i:s a', $r['laston']); $la = time() - $r['laston']; $unit = "secs"; if ($la >= 60) { $la = (int) ($la / 60); $unit = "mins"; } if ($la >= 60) { $la = (int) ($la / 60); $unit = "hours"; if ($la >= 24) { $la = (int) ($la / 24); $unit = "days"; } } $lb = time() - $r['last_login']; $units = "secs"; if ($lb >= 60) { $lb = (int) ($lb / 60); $units = "mins"; } if ($lb >= 60) { $lb = (int) ($lb / 60); $units = "hours"; if ($lb >= 24) { $lb = (int) ($lb / 24); $units = "days"; } } if ($r['laston'] <= time() - 30 * 60) { $lb = "offline"; $units = ""; } if ($r['donatordays']) { $d = "<img src='/images/donator.gif' width='15' alt='Donator: {$r['donatordays']} Days Left' title='Donator: {$r['donatordays']} Days Left' />"; } else { $d = ""; } if ($r['user_level'] > 1) { $staff = "<img src='images/staff.gif 'width='15' alt='Staff' title='Staff' />"; } else { $staff = ""; } if ($r['clan']) { $qg = $db->query("SELECT clanPREF FROM `clans` WHERE `clanID` = {$r['clan']}", $c); $rr = $db->fetch_row($qg); $gn = "[" . $rr['clanPREF'] . "]"; } else { $gn = ""; } $cn++; if ($r['user_level'] == 2) { $user = "<font color='red'>{$r['username']}</font>"; } else if ($r['user_level'] == 3) { $user = "<font color='blue'>{$r['username']}</font>"; } else if ($r['user_level'] == 4) { $user = "<font color='green'>{$r['username']}</font>"; } else if ($r['user_level'] == 5) { $user = "<font color='cyan'>{$r['username']}</font>"; } else if ($r['user_level'] == 6) { $user = "<font color='#1E90FF'>{$r['username']}</font>"; } else if ($r['donatordays']) { $user = "<font color='#008B8B'>{$r['username']}</font>"; } else { $user = "{$r['username']}"; } echo "<tr><td>$cn. </td><td>$gn <a href='viewuser.php?u={$r['userid']}'>$user</a> $d $staff</td><td>($la $unit)</td><td>({$lb} {$units})</td><td>{$r['level']}</td><td><a href='mailbox.php?action=compose&ID={$r['userid']}'>Mail</a></td><td><a href='attack.php?ID={$r['userid']}'>Attack</a></td></tr>"; } echo "</table>"; } function hour() { global $ir, $c, $userid, $db, $h; echo "<table width = '100%' class = 'table'><tr align ='center'><th>Users On In The Last 60 Mins</th></tr></table>"; $q = $db->query("SELECT COUNT(*) as `cnt` FROM `users` WHERE `laston` > unix_timestamp()-60*60 ORDER BY `laston` DESC", $c); while ($r = $db->fetch_row($q)) echo "<table width = '100%' class='table'><tr> <th>&nsbp;</th> <th>Users</th> <th>Last Hit</th> <th>Time Online</th> <th>Level</th> <th>Mail</th> <th>Attack</th> </tr>"; $cn = 0; $q = $db->query("SELECT `u`.*,`g`.* FROM `users` `u` LEFT JOIN `clans` `g` ON `g`.`clanID`=`u`.`clan` WHERE `u`.`laston` > unix_timestamp()-60*60 ORDER BY `laston` DESC", $c); while ($r = $db->fetch_row($q)) { $lon = date('F j, Y g:i:s a', $r['laston']); $la = time() - $r['laston']; $unit = "secs"; if ($la >= 60) { $la = (int) ($la / 60); $unit = "mins"; } if ($la >= 60) { $la = (int) ($la / 60); $unit = "hours"; if ($la >= 24) { $la = (int) ($la / 24); $unit = "days"; } } $lb = time() - $r['last_login']; $units = "secs"; if ($lb >= 60) { $lb = (int) ($lb / 60); $units = "mins"; } if ($lb >= 60) { $lb = (int) ($lb / 60); $units = "hours"; if ($lb >= 24) { $lb = (int) ($lb / 24); $units = "days"; } } if ($r['laston'] <= time() - 60 * 60) { $lb = "offline"; $units = ""; } if ($r['donatordays']) { $d = "<img src='/images/donator.gif' width='15' alt='Donator: {$r['donatordays']} Days Left' title='Donator: {$r['donatordays']} Days Left' />"; } else { $d = ""; } if ($r['user_level'] > 1) { $staff = "<img src='images/staff.gif 'width='15' alt='Staff' title='Staff' />"; } else { $staff = ""; } if ($r['clan']) { $qg = $db->query("SELECT clanPREF FROM `clans` WHERE `clanID` = {$r['clan']}", $c); $rr = $db->fetch_row($qg); $gn = "[" . $rr['clanPREF'] . "]"; } else { $gn = ""; } $cn++; if ($r['user_level'] == 2) { $user = "<font color='red'>{$r['username']}</font>"; } else if ($r['user_level'] == 3) { $user = "<font color='blue'>{$r['username']}</font>"; } else if ($r['user_level'] == 4) { $user = "<font color='green'>{$r['username']}</font>"; } else if ($r['user_level'] == 5) { $user = "<font color='cyan'>{$r['username']}</font>"; } else if ($r['user_level'] == 6) { $user = "<font color='#1E90FF'>{$r['username']}</font>"; } else if ($r['donatordays']) { $user = "<font color='#008B8B'>{$r['username']}</font>"; } else { $user = "{$r['username']}"; } echo "<tr><td>$cn. </td><td>$gn <a href='viewuser.php?u={$r['userid']}'>$user</a> $d $staff</td><td>($la $unit)</td><td>({$lb} {$units})</td><td>{$r['level']}</td><td><a href='mailbox.php?action=compose&ID={$r['userid']}'>Mail</a></td><td><a href='attack.php?ID={$r['userid']}'>Attack</a></td></tr>"; } echo "</table>"; } function today() { global $ir, $c, $userid, $db, $h; echo "<table width = '100%' class = 'table'><tr align ='center'><th>Users On In The Last 24 Hours</th></tr></table>"; $q = $db->query("SELECT COUNT(*) as `cnt` FROM `users` WHERE `laston` > unix_timestamp()-200*720 ORDER BY `laston` DESC", $c); while ($r = $db->fetch_row($q)) echo "<table width = '100%' class='table'><tr> <th>&nsbp;</th> <th>Users</th> <th>Last Hit</th> <th>Time Online</th> <th>Level</th> <th>Mail</th> <th>Attack</th> </tr>"; $cn = 0; $q = $db->query("SELECT `u`.*,`g`.* FROM `users` `u` LEFT JOIN `clans` `g` ON `g`.`clanID`=`u`.`clan` WHERE `u`.`laston` > unix_timestamp()-200*720 ORDER BY `laston` DESC", $c); while ($r = $db->fetch_row($q)) { $lon = date('F j, Y g:i:s a', $r['laston']); $la = time() - $r['laston']; $unit = "secs"; if ($la >= 60) { $la = (int) ($la / 60); $unit = "mins"; } if ($la >= 60) { $la = (int) ($la / 60); $unit = "hours"; if ($la >= 24) { $la = (int) ($la / 24); $unit = "days"; } } $lb = time() - $r['last_login']; $units = "secs"; if ($lb >= 60) { $lb = (int) ($lb / 60); $units = "mins"; } if ($lb >= 60) { $lb = (int) ($lb / 60); $units = "hours"; if ($lb >= 24) { $lb = (int) ($lb / 24); $units = "days"; } } if ($r['laston'] <= time() - 200 * 720) { $lb = "offline"; $units = ""; } if ($r['donatordays']) { $d = "<img src='/images/donator.gif' width='15' alt='Donator: {$r['donatordays']} Days Left' title='Donator: {$r['donatordays']} Days Left' />"; } else { $d = ""; } if ($r['user_level'] > 1) { $staff = "<img src='images/staff.gif 'width='15' alt='Staff' title='Staff' />"; } else { $staff = ""; } if ($r['clan']) { $qg = $db->query("SELECT clanPREF FROM `clans` WHERE `clanID` = {$r['clan']}", $c); $rr = $db->fetch_row($qg); $gn = "[" . $rr['clanPREF'] . "]"; } else { $gn = ""; } $cn++; if ($r['user_level'] == 2) { $user = "<font color='red'>{$r['username']}</font>"; } else if ($r['user_level'] == 3) { $user = "<font color='blue'>{$r['username']}</font>"; } else if ($r['user_level'] == 4) { $user = "<font color='green'>{$r['username']}</font>"; } else if ($r['user_level'] == 5) { $user = "<font color='cyan'>{$r['username']}</font>"; } else if ($r['user_level'] == 6) { $user = "<font color='#1E90FF'>{$r['username']}</font>"; } else if ($r['donatordays']) { $user = "<font color='#008B8B'>{$r['username']}</font>"; } else { $user = "{$r['username']}"; } echo "<tr><td>$cn. </td><td>$gn <a href='viewuser.php?u={$r['userid']}'>$user</a> $d $staff</td><td>($la $unit)</td><td>({$lb} {$units})</td><td>{$r['level']}</td><td><a href='mailbox.php?action=compose&ID={$r['userid']}'>Mail</a></td><td><a href='attack.php?ID={$r['userid']}'>Attack</a></td></tr>"; } echo "</table>"; } echo "<hr width='100%'><a href='index.php'>$goback</a><hr width='100%'>"; $h->endpage(); ?> CREATE TABLE IF NOT EXISTS `records` ( `rec15` int(11) NOT NULL DEFAULT '1', `rec24` int(11) NOT NULL DEFAULT '1', `rec30` int(11) NOT NULL DEFAULT '1', `rec60` int(11) NOT NULL DEFAULT '1', `recID` int(11) NOT NULL DEFAULT '1' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `records` (`rec15`, `rec24`, `rec30`, `rec60`, `recID`) VALUES (1, 1, 1, 1, 1); Screen Shot - [ATTACH=CONFIG]1457[/ATTACH]