Vorlen Posted February 13, 2008 Posted February 13, 2008 Now, this is in NO WAY an ORIGINAL idea. It was requested, and thus I made a very BASIC version. If you want a more fancy version, I'm sure you can hire someone, though it'd be a waste... just edit the table, as it's really easy. You can find how to edit a table and font on w3schools anytime. print" <table width=200><tr><th colspan=2>Top 5 Users</th></tr> <tr><th>Rank</th> <th>User</th> </tr>"; $q=mysql_query("SELECT u.*,g.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level = 1 ORDER BY (us.strength+us.agility+us.guard+us.labour+us.IQ) DESC,u.userid ASC LIMIT 5", $c); $p=0; while($r=mysql_fetch_array($q)) { $p++; print "<tr> <td>$p</td> <td>{$r['gangPREF']} {$r['username']} [{$r['userid']}]</td> </tr>"; } print "</table>"; The above code goes wherever you want your table. However, make sure that if your table is going somewhere that is ALREADY in a PRINT, please take off the 'print" ' and ' ";' from the beginning and end of this code. Not the ones in the middle. You're more than welcome to try it out and play around. This is just something to start with. Quote
HITMAN 17 Posted February 13, 2008 Posted February 13, 2008 Re: Top 5 Table for Register/Login print" "; =mysql_query("SELECT u.*,g.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level = 1 ORDER BY (us.strength+us.agility+us.guard+us.labour+us.IQ) DESC,u.userid ASC LIMIT 5", ); =0; while(=mysql_fetch_array()) { ++; print ""; } print " Top 5 Users Rank User [] i get that on mine Quote
Vorlen Posted February 13, 2008 Author Posted February 13, 2008 Re: Top 5 Table for Register/Login If you are putting it in something that's already printing, make it look like this You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. That way the print that's already happening will continue to occurr Quote
zbirc3 Posted February 14, 2008 Posted February 14, 2008 Re: Top 5 Table for Register/Login what is the code for v2? Quote
Vorlen Posted February 14, 2008 Author Posted February 14, 2008 Re: Top 5 Table for Register/Login what is the code for v2? It makes no difference, it only checks the users and userstats tables, so it works on both... :) Quote
Solid Snake Posted February 14, 2008 Posted February 14, 2008 Re: Top 5 Table for Register/Login nice mod vorlen i may use it Quote
Vorlen Posted February 14, 2008 Author Posted February 14, 2008 Re: Top 5 Table for Register/Login nice mod vorlen i may use it Thanks, I might... spiff it up a bit with some styling, but for now, this'll do just fine. Your site CSS in the header should form it to your site's general appearance. :) Feel free to enjoy it, and customize it as you see fit Quote
zbirc3 Posted February 14, 2008 Posted February 14, 2008 Re: Top 5 Table for Register/Login it shows this on mine: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Vorlen Posted February 14, 2008 Author Posted February 14, 2008 Re: Top 5 Table for Register/Login You probably have it in the middle of a Print<<< EOF; yes? Quote
zbirc3 Posted February 14, 2008 Posted February 14, 2008 Re: Top 5 Table for Register/Login yea i saw that b4. Fixed and thx Quote
Vorlen Posted February 14, 2008 Author Posted February 14, 2008 Re: Top 5 Table for Register/Login yea i saw that b4. Fixed and thx No problem, enjoy. :) Quote
zbirc3 Posted February 14, 2008 Posted February 14, 2008 Re: Top 5 Table for Register/Login Is it supposed to be random users or something? it isn’t showing top users in total stats!? Quote
_stoner_ Posted March 13, 2008 Posted March 13, 2008 Re: Top 5 Table for Register/Login Heya Vorlen my buddy +1 :-P Quote
Note i didn't make this mo Posted March 17, 2008 Posted March 17, 2008 Re: Top 5 Table for Register/Login _Stoner_ Your Truley Make Me Sick Your So Far Up Vorlen And Cyanide's *** Thats Its Unbelivable Just Because They Code For You Because You Cant Well Here Is A Code I Think You Should Add To Your Game if($ir['ifyoucantcodeyourself']) { echo 'Why Do It Good bye stoner have a nice poxy life'; } Quote
Isomerizer Posted March 17, 2008 Posted March 17, 2008 Re: Top 5 Table for Register/Login Prepared for this to slow your game down, depending on game size. http://criminalexistence.com/ceforums/i ... ic=17644.0 Even though its limited to 5 rather then 20, I'm sure this strain to load on some games... Also, may be a good idea to select only the columns needed... You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Haunted Dawg Posted March 18, 2008 Posted March 18, 2008 Re: Top 5 Table for Register/Login Well it would slow down your register and login by far exspecialy big games like mine and iso's and those who have 1500+ i am almost about to hit 2k users and imagine if i add that? it will be a stress load to the server :| Quote
Guest Anonymous Posted March 18, 2008 Posted March 18, 2008 Re: Top 5 Table for Register/Login You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Hmm, fairly expensive. I checked this using a profiler on a test site with over 12,000 users (randomly generated I hasten to add) and there was a small hit. By creating indexes on strength, agility and guard, the hit was substantially reduced so it may be workable, but it will depend on how good a machine your database is running on. 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.