Thread: vBulletin CMS Widgets - [WIDGET] Recent Threads
View Single Post
  #135  
Old 08-08-2012, 02:15 PM
barnsi barnsi is offline
 
Join Date: Dec 2011
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great Work, thank you!

To get the prefix to be shown to the recent thread add:
PHP Code:
$recent_thread[prefix_rich] = $vbphrase["prefix_$recent_thread[prefixid]_title_rich"];
$toutput .=''.$recent_thread[prefix_rich].' '
Widget new:
PHP Code:
ob_start(); 
global 
$vbulletin$db$vbphrase
//Begin Thread Counts  
$toutput='';  
$recent_threads $vbulletin->db->query_read("  
SELECT thread.threadid, thread.prefixid, thread.title, thread.dateline, thread.lastpost, thread.lastposter, thread.lastposterid, thread.visible, thread.open, thread.postusername, thread.postuserid, thread.replycount, thread.views, forum.forumid, forum.title as forumtitle 
FROM  " 
TABLE_PREFIX "thread AS thread  
LEFT JOIN  " 
TABLE_PREFIX "forum AS forum ON ( forum.forumid = thread.forumid )  
WHERE NOT ISNULL(threadid) AND visible = '1' AND open!='10'  
ORDER BY lastpost DESC  
LIMIT 0, 20  
"
);  
$i 0;  
while (
$recent_thread $db->fetch_array($recent_threads))  
{  
$i++; 
if (!
in_array($recent_thread[forumid], array(105,83,121,110,82,112,109,101,102,72))) {  
if (
$i 1) {$class='alt1';} else {$class='alt2';}  
$recent_thread[title] = unhtmlspecialchars($recent_thread[title]);  
$recent_thread[lastpostdate] = vbdate('j. F Y'$recent_thread[lastpost], 1);  
$recent_thread[lastposttime] = vbdate($vbulletin->options['timeformat'], $recent_thread[lastpost]);
$recent_thread[prefix_rich] = $vbphrase["prefix_$recent_thread[prefixid]_title_rich"];

$toutput .='<tr><td class="'.$class.'" align="left"><font size="2" face="verdana,arial"><a href="forumdisplay.php?f='.$recent_thread[forumid].'">'.$recent_thread[forumtitle].'</a></font><br/>';  

if(
'.$recent_thread[prefixid].' <> '')
$toutput .=''.$recent_thread[prefix_rich].' ';

$toutput .='<b><font color="#98B5E2" size="2" face="verdana,arial"><a href="showthread.php?t='.    $recent_thread[threadid].'">'.    $recent_thread[title].'</a></font></b><br/>';  
$toutput .='<font size="1" face="verdana,arial">letzter Eintrag von: <a href="member.php?u='.$recent_thread[lastposterid].'">'.$recent_thread[lastposter].'</a></font><br/>';  
$toutput .='<font size="1" face="verdana,arial">am <strong>'.$recent_thread[lastpostdate].'</strong> um <strong>'.    $recent_thread[lastposttime].'</strong> Uhr</font><hr/></td></tr>';  
}  

//End Thread Counts  

//Sidebar - Begin Forum Threads 
$sb_threads 
<table class="tborder" cellpadding="'
.$stylevar[cellpadding].'" cellspacing="'.$stylevar[cellspacing].'" border="0" width="100%" align="center"> <thead> <tr> <td class="tcat"></td> </tr> </thead> <tbody> <div class="smallfont"> <tr> <td> 
'
.$toutput.
</td> </tr> </div> </tbody> </table> 
'

//Sidebar - End Forum Threads 
echo $sb_threads
$db->free_result($recent_threads); 
$output=ob_get_contents(); 
ob_end_clean(); 
Attached Images
File Type: png Themen.png (26.5 KB, 0 views)
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01113 seconds
  • Memory Usage 1,829KB
  • Queries Executed 12 (?)
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
  • (2)bbcode_php
  • (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_attachment
  • (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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete