View Single Post
  #529  
Old 01-30-2005, 01:29 AM
EvilLS1's Avatar
EvilLS1 EvilLS1 is offline
 
Join Date: Apr 2002
Location: Georgia, USA
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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]&amp;type=timeslip&amp;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
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01160 seconds
  • Memory Usage 1,794KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete