Jump to content
MakeWebGames

please help with HOF


mikeymike

Recommended Posts

im a complete noob at this and im just trying to learn something. can someone see if they can tell me what i am doing wrong here? i may be way off on the code for what i am attempting

}

function hof_attacks()

{

global $ir,$c,$userid;

print "Showing the 20 users with the highest total attacks

 

Pos User

$q=mysql_query("SELECT u.*,g.* FROM attacklogs u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 ORDER BY (us.wins+losses) DESC,u. userid ASC LIMIT 20", $c);

$p=0;

while($r=mysql_fetch_array($q))

{

$p++;

if($r['userid'] == $ir['userid']) { $t="";$et=""; } else { $t="";$et=""; }

print "

$t$p$et $t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et ";

}

 

i am trying to put a category in my HOF for most total attacks. i also want it to list the total there too. i know i didnt include that part anywhere yet. please dont make fun of me if i am going completely in the wrong direction with this. i cant figure out why it wont show anything when i click the link for "total attacks". i dont get any kind of error

Link to comment
Share on other sites

Re: please help with HOF

I would suggest doing this.

Add a category to your usertable called "attacks"

change attack system so when you attack it adds one to your attacks count, win or loss.

Then, you simply call that number and order by the highest to lowest, limit 20. :)

Make any sense?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...