Zero-Affect Posted May 17, 2008 Posted May 17, 2008 Re: TownView [$5] my users online does similar to this :-P Quote
Tezza` Posted May 17, 2008 Posted May 17, 2008 Re: TownView [$5] omg. once again stop arguing and being gay Killah, where all aloud an opinion. Quote
Isomerizer Posted May 17, 2008 Posted May 17, 2008 Re: TownView [$5] Updated LostOnes post. <?php require("globals.php"); $query = mysql_query( sprintf("SELECT `userid` FROM `users` WHERE (`location` = %u)", $ir['location'])); $p = mysql_num_row($query); $pages= abs(@intval(( ($p / 10) + 1 )); if ($p % 10 == 0) { $pages--; } echo ' <center> <form action="'.$_SERVER['PHP_SELF'].'" method="POST">Page:<select name="page">'; // Pages while ($pages = mysql_fetch_object($query)) { for($i=1; $i <= $pages; $i++) { $pa = ($i-1) * 10; echo '<option value="'.$pa.'">'.$pa.'</option>'; } } echo '</select><input type="submit" name="submit" value="Go To!" /></form> </center><table width="80%"> <tr> <th width="33%">Name</th> <th>Level</th> <th>Money</th> <th>Gender</th> <th>Online?</th> <th>In Jail?</th> <th>In Hosp?</th> <th width="33%">Attack?</th> </tr>'; $pag = abs(@intval($_POST['page'])); $limit_a = 0; $limit_b = 10; if (isset($_POST['page'])) { $limit_a = $_POST['page'] * 10; $limit_b = $limit_a + 10; } $this_q = sprintf('SELECT username,userid,level,money,gender,laston,hospital,jail FROM `users` WHERE `location` = ("%u") ORDER BY userid ASC LIMIT %u , %u', $ir['location'], $limit_a, $limit_b); $this_qu = mysql_query($this_q) or die (mysql_error()); if(!mysql_num_rows($this_qu)) { echo 'You are the only person in this location'; } else { while($ud = mysql_fetch_object($this_qu)) { if ($ud->laston > unix_timestamp()-15*60) { $status = 'Online'; } else { $status = 'Offline'; } if ($ud->jail > 0) { $jail = 'Yes'; } else { $jail = 'No'; } if ($ud->hospital > 0) { $hosp = 'Yes'; } else { $hosp = 'No'; } echo ' <tr> <td>' . $ud->username . ' [' . $ud->userid . ']</td> <td>' . number_format($ud->level, "") . '</td> <td>'. money_formatter($ud->money) .'</td> <td>'. $ud->gender .'</td> <td>'. $status .'</td> <td>'. $jail .'</td> <td>'. $hosp .'</td>'; if ($hosp == 'No' || $jail == 'No') { echo 'Not attackable'; } else { echo '<td>[url="attack.php?ID=' . $ud->userid . '"]Attack[/url]</td>'; } echo '</tr>'; } } echo '</table>'; $h->endpage(); ?> (Not tested, will happily fix errors) Quote
iseeyou94056 Posted May 17, 2008 Posted May 17, 2008 Re: TownView [$5] Updated LostOnes post. <?php require("globals.php"); $query = mysql_query( sprintf("SELECT `userid` FROM `users` WHERE (`location` = %u)", $ir['location'])); $p = mysql_num_row($query); $pages= abs(@intval(( ($p / 10) + 1 )); if ($p % 10 == 0) { $pages--; } echo ' <center> <form action="'.$_SERVER['PHP_SELF'].'" method="POST">Page:<select name="page">'; // Pages while ($pages = mysql_fetch_object($query)) { for($i=1; $i <= $pages; $i++) { $pa = ($i-1) * 10; echo '<option value="'.$pa.'">'.$pa.'</option>'; } } echo '</select><input type="submit" name="submit" value="Go To!" /></form> </center><table width="80%"> <tr> <th width="33%">Name</th> <th>Level</th> <th>Money</th> <th>Gender</th> <th>Online?</th> <th>In Jail?</th> <th>In Hosp?</th> <th width="33%">Attack?</th> </tr>'; $pag = abs(@intval($_POST['page'])); $limit_a = 0; $limit_b = 10; if (isset($_POST['page'])) { $limit_a = $_POST['page'] * 10; $limit_b = $limit_a + 10; } $this_q = sprintf('SELECT username,userid,level,money,gender,laston,hospital,jail FROM `users` WHERE `location` = ("%u") ORDER BY userid ASC LIMIT %u , %u', $ir['location'], $limit_a, $limit_b); $this_qu = mysql_query($this_q) or die (mysql_error()); if(!mysql_num_rows($this_qu)) { echo 'You are the only person in this location'; } else { while($ud = mysql_fetch_object($this_qu)) { if ($ud->laston > unix_timestamp()-15*60) { $status = 'Online'; } else { $status = 'Offline'; } if ($ud->jail > 0) { $jail = 'Yes'; } else { $jail = 'No'; } if ($ud->hospital > 0) { $hosp = 'Yes'; } else { $hosp = 'No'; } echo ' <tr> <td>' . $ud->username . ' [' . $ud->userid . ']</td> <td>' . number_format($ud->level, "") . '</td> <td>'. money_formatter($ud->money) .'</td> <td>'. $ud->gender .'</td> <td>'. $status .'</td> <td>'. $jail .'</td> <td>'. $hosp .'</td>'; if ($hosp == 'No' || $jail == 'No') { echo 'Not attackable'; } else { echo '<td>[url="attack.php?ID=' . $ud->userid . '"]Attack[/url]</td>'; } echo '</tr>'; } } echo '</table>'; $h->endpage(); ?> (Not tested, will happily fix errors) hahahaha lol Quote
Haunted Dawg Posted May 18, 2008 Author Posted May 18, 2008 Re: TownView [$5] Do you all have to be jackass's? Btw iso, nice try but i see your's has more lines than mine xD Quote
iseeyou94056 Posted May 18, 2008 Posted May 18, 2008 Re: TownView [$5] almost everyone here has asked you the same thing Quote
Tezza` Posted May 18, 2008 Posted May 18, 2008 Re: TownView [$5] Do you all have to be jackass's? Btw iso, nice try but i see your's has more lines than mine xD But stil does the same job :) Quote
Zero-Affect Posted May 18, 2008 Posted May 18, 2008 Re: TownView [$5] whats with all the posts on this mod lol i mean if ya made it for free post it in free modifications n get over it... its not like kyle can't code something new... Quote
Isomerizer Posted May 18, 2008 Posted May 18, 2008 Re: TownView [$5] whats with all the posts on this mod lol i mean if ya made it for free post it in free modifications n get over it... its not like kyle can't code something new... http://criminalexistence.com/ceforums/i ... ic=20538.0 Just for you. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.