Quote:
Originally Posted by ericgtr
I've added a Top 3 Battle Leaders to this (to the original Mindtrix hack). I have plugged it in next to Logik's 'Latest Battles' hack, see screenshot.
Here's how I do it.
In forumroot/index.php find:
PHP Code:
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###
Add this just above it:
PHP Code:
//Top 3 battle leaders
$topbattles = $DB_site->query("
SELECT userid, username, bs_wins
FROM user
ORDER BY bs_wins DESC
LIMIT 3
");
while ($showbattles=$DB_site->fetch_array($topbattles))
{
$counter++;
$battleuserid = $showbattles['userid'];
$battleusername = $showbattles['username'];
$battlewins = $showbattles['bs_wins'];
$spitbattles .= "<a href=\"member.php?u=$battleuserid\">$battleusername</a> ($battlewins)";
if ($counter < 3)
{
$spitbattles .= "<br /> ";
}
}
//Top 3 battle leaders
Now you can stick this into your FORUMHOME template where you want it to appear with this:
Code:
$spitbattles $bs_wins
I put this in combination with Logik's hack into a fieldset, as it looks in the screenshot, with this code in the FORUMHOME find:
Code:
<!-- end logged-in users -->
Add under:
Code:
<!-- Start Latest Battles -->
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_battles')"><img id="collapseimg_forumhome_battles" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_battles].gif" alt="" border="0" /></a>
Latest Battle Info
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_battles" style="$vbcollapse[collapseobj_forumhome_battles]">
<tr>
<td class="alt2"><a href="forumdisplay.php?f=106$session[sessionurl]"><img src="$stylevar[imgdir_statusicon]/forum_link.gif" alt="Latest Battles" border="0" /></a></td>
<td class="alt1" width="100%">
<div class="smallfont">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><fieldset><legend>Latest Battles</legend>$logikthread</fieldset></td>
<td><fieldset>
<legend>Battle Leaders</legend>
$spitbattles $bs_wins</fieldset></td>
</tr>
</table>
</div>
</td>
</tr>
</tbody>
<!-- End Latest Battles -->
|
thats great but how about, on the latest battles, you add the number of votes each battlers currently have?
for example
Latest battles
test1 vs. test2 (0-0)
test3 vs. test4 (1-0)
test5 vs. test6 (1-1)
test7 vs. test8 (2-1)
Also, no one figure out how to force people to put their opponent name in the opponent field when they start a new battle? I remove the hack because I couldn't find any solution for that and people were lazy to do it