Thread: Integration with vBulletin - LBmtb's Recent Topics on Non-VB Pages
View Single Post
  #63  
Old 10-22-2007, 07:03 PM
Tomzl Tomzl is offline
 
Join Date: Jan 2006
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I recently updated the script from 1.02 to 1.03 and some problems occured.

I changed the default code to suit my needs (utf-8, different style, max 30 chars in topic title etc.). I applied the same changes that worked in 1.02 to 1.03 but now every once in a while there are two arrows in front of one topic title. I added an arrow .gif in front of every topic title so it links to the newpost in that topic. For some reason this arrow is doubled by one of the topics on the list. It is not always the same topic and I can't find a rule that triggers this behaviour.

Below is my modified code. Help would be much appreciated.

Code:
## NO NEED TO TOUCH ANYTHING BELOW    ##################################### 
############################################################################# 

if (!($recent_topics_connection = mysql_connect("$db_host", "$db_user", "$db_pw"))) 
die ("could not connect");  
if (!(mysql_select_db("$db_name", $recent_topics_connection))) 
mysql_error();
mysql_query('set names utf8');
mysql_query('set character set utf8');
$fid_array = explode (',', $fid_raw); 
if ($fid_raw)  { 
    $fid_final .= "AND ("; 
    foreach( $fid_array as $key => $value){ 
        if ($key == 0) { $fid_final .= "t.forumid=".$value; } 
        else { $fid_final .= " OR t.forumid=".$value; } 
    } 
    $fid_final .= ")"; 
} 
$fidx_array = explode (',', $fidx_raw); 
if ($fidx_raw)  { 
    $fidx_final .= "AND NOT ("; 
    foreach( $fidx_array as $key => $value){ 
        if ($key == 0) { $fidx_final .= "t.forumid=".$value; } 
        else { $fidx_final .= " OR t.forumid=".$value; } 
    } 
    $fidx_final .= ")"; 
} 
$thread_sql = mysql_query("SELECT SQL_CACHE t.threadid,t.title,t.lastpost,t.lastposter,t.forumid,substring(p.pagetext,1,200) as post_text 
    FROM ".$GLOBALS['db_prefix']."thread t 
    INNER JOIN ".$GLOBALS['db_prefix']."post p 
    ON t.firstpostid = p.postid 
    WHERE t.visible=1  
    AND t.open=1 $fidi_final $fidx_final  
    ORDER BY t.lastpost desc  
    LIMIT $limit"); 
while($thread_get=@mysql_fetch_array($thread_sql)) 
{ 
    $lastpost = $thread_get['lastpost']; 
    $poster = $thread_get['lastposter']; 
    $tid = $thread_get['threadid']; 
$text = $thread_get['post_text']; 
    if ($post_date_format == "1") { $date2 = date ("m/d/y h:i A" ,$lastpost); } 
    elseif ($post_date_format == "2") { $date2 = date ("h:i A" ,$lastpost); } 
    else { $date2 = date ("m/d/y h:i A" ,$lastpost); } 
        echo "&nbsp;<a href=\"$forum_url/showthread.php?t=$tid&goto=newpost\" class=\"povezava\" target=\"_parent\"><img src=\"arrow.gif\" border=\"0\" align=\"absmiddle\">&nbsp;</a>"; 
		echo "&nbsp;<a href=\"$forum_url/showthread.php?t=$tid\" class=\"povezava\" target=\"_parent\" title=\"".$text."\">";
		if (strlen($thread_get[title])>30) echo substr($thread_get[title],0,30)."...";
		else echo $thread_get[title];
		echo "</a><br />\n";
} 
mysql_close($recent_topics_connection); 
?>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01123 seconds
  • Memory Usage 1,773KB
  • 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
  • (1)bbcode_code
  • (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