Quote:
Originally Posted by Big Kahuna
I'm testing the 3.0.6 version on my test forum and it appears to be working fine. I'll give a link to the live forum once it is installed there. I think the 3.0.6 people will not have a problem. All went very smooth.
I'd like to be able to display the TOP 10 CONFIRMED (ticket submitted) in my forum index. Any chance of getting a bone rolled to me on the code required?
|
Well, I've never tried it but it should be just as easy to add the top 10 confirmed to your forum index.
Try this..
In forums/index.php find:
Code:
'forumhome_pmloggedin',
replace it with:
Code:
'forumhome_pmloggedin',
'times',
'toptimes',
find:
Code:
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###
above it add:
Code:
// Top Times add-on
$pos = 0;
$condition.=" AND (userfield.field57!='' OR customtimeslippic.dateline!='') AND userfield.field55>0";
$users=$DB_site->query("SELECT *
FROM " . TABLE_PREFIX . "user AS user, " . TABLE_PREFIX . "userfield AS userfield
LEFT JOIN " . TABLE_PREFIX . "customtimeslippic AS customtimeslippic ON (customtimeslippic.userid = user.userid)
WHERE user.userid = userfield.userid
$condition
ORDER BY userfield.field55 ASC
LIMIT 10");
// Set up vars
while ($userinfo=$DB_site->fetch_array($users)) {
$tdateline = $userinfo[dateline];
$pos++;
$rank= number_format($pos);
$TDusername= $userinfo[username];
$ride= $userinfo[field50];
if ($userinfo[field52]>0){
$sixty= $userinfo[field52];
}else{
$sixty="";
}
if ($userinfo[field55]>0){
$quarter= $userinfo[field55];
}else{
$quarter="";
}
if ($userinfo[field56]>0){
$atmph2="@";
}else{
$atmph2="";
}
if ($userinfo[field56]>0){
$quartermph= $userinfo[field56];
}else{
$quartermph="";
}
$userinfo[field57] = trim($userinfo[field57]);
if ($userinfo[field57]!="")
{
$slip="<a href=\"$userinfo[field57]\" target=\"_blank\"><img src=\"$stylevar[imgdir_misc]//slipicon.gif\" border=0></a>";
}
else
{
$slip="";
}
eval('$times .= "' . fetch_template('times') . '";');
} // end while
eval('$toptimes .= "' . fetch_template('toptimes') . '";');
Create a new template named "toptimes" and add the HTML below:
Code:
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr id="cat">
<td colspan="6" class="tcat" width="100%"><span class="smallfont"><b>?Top 10 1/4 Mile ETs</b></span></td>
</tr>
<tr>
<td class="alt2" align="center"><span class="smallfont"><b>#</b></span></td>
<td class="alt2" align="center"><span class="smallfont"><b>Username</b></span></td>
<td class="alt2" align="center"><span class="smallfont"><b>Ride</b></span></td>
<td class="alt2" align="center"><span class="smallfont"><b>60'</b></span></td>
<td class="alt2" align="center"><span class="smallfont"><b>1/4 Mile ET & MPH </b></span></td>
<td class="alt2" align="center"><span class="smallfont"><b>Slip</b></span></td>
</tr>
$times
<tr>
<td class="tcat" colspan="6"><span class="smallfont"><CENTER>[<a href=$vboptions[bburl]/timeslips.php>Click here to view the complete list</a>]</CENTER></span></td>
</tr>
</table>
<br />
Create a new template named "times" and add the HTML below:
Code:
<tr>
<td class="alt1" align="center"><span class="smallfont">$rank</span></td>
<td class="alt1" align="center"><span class="smallfont"><a href="$vboptions[bburl]/member.php?$session[sessionurl]u=$userinfo[userid]">$TDusername</a></span></td>
<td class="alt1" align="center"><span class="smallfont">$ride</span></td>
<td class="alt1" align="center"><span class="smallfont">$sixty</span></td>
<td class="alt1" align="center"><span class="smallfont">$quarter$atmph2$quartermph</span></td>
<td class="alt1"><if condition="$tdateline!=''">
<a href="image.php?u=$userinfo[userid]&type=timeslip&dateline=$tdateline" target="_blank"><img src="$stylevar[imgdir_misc]/slipicon.gif" border=0></a>
<else />
$slip
</if></td>
</tr>
Then in your forumhome template put $toptimes where ever you want the Top 10 ETs module to show up.
I haven't tested this but it should work.
Dewayne