The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
[WIDGET] Recent Threads Details »» | |||||||||||||||||||||||||||
In an attempt at mirroring an old ASP website I used to have, I modified the recent threads display to show a bit more information in a bit more compressed format.
Feel free to use/hack/slash this code for your own needs... Navigate to AdminCP -> CMS -> Widgets. Create a PHP Type Widget and paste the below code. READ BELOW THE CODE FOR AN UPDATE PHP Code:
Updated to reflect contribution from Inflikted: https://vborg.vbsupport.ru/showpost....7&postcount=25 Be SURE to update the following line:if (!in_array($recent_thread[forumid], array(105,83,121,110,82,112,109,101,102,72))), to group the forumids you wish to NOT have included in the query results. Screenshots
Show Your Support
|
Благодарность от: | ||
psd_hunter |
Comments |
#132
|
||||
|
||||
how to do it to show for specific forums only ?
|
#133
|
|||
|
|||
I apologize for bumping this but does anyone know if it would be possible to pull off showing the forums instead of the threads? I've provided a roughly photoshoped image to explain.
|
#134
|
|||
|
|||
Works for me on 4.1.12
|
#135
|
|||
|
|||
Great Work, thank you!
To get the prefix to be shown to the recent thread add: PHP Code:
PHP Code:
|
#136
|
|||
|
|||
Please, have somebody an idea how to put the last posts (not topics) inside this widget and have somebody a version what shows the avatars?
Thank you in advance |
#137
|
|||
|
|||
Ok so it turns out that none of the forums in the array are being excluded, anyone know why?
Here's my widget code; <snip> see reply |
#138
|
|||
|
|||
Ok so I missed a page while reading through the thread and found the fix My widget code looks like this (for those that still have the same issue) ...
Code:
ob_start(); global $vbulletin, $db; //Begin Thread Counts $toutput=''; $recent_threads = $vbulletin->db->query_read(" SELECT thread.threadid, 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 forum.forumid not in(4,5,6,7,8,126,127,128,129,132,133) AND visible = '1' AND open!='10' ORDER BY lastpost DESC LIMIT 0, 10 "); $i = 0; while ($recent_thread = $db->fetch_array($recent_threads)) { $i++; { if ($i & 1) {$class='alt1';} else {$class='alt2';} $recent_thread[title] = unhtmlspecialchars($recent_thread[title]); $recent_thread[lastpostdate] = vbdate('M jS', $recent_thread[lastpost], 1); $recent_thread[lastposttime] = vbdate($vbulletin->options['timeformat'], $recent_thread[lastpost]); $toutput .='<tr><td class="'.$class.'" align="left"><b><font color="#98B5E2" size="1" face="verdana,arial"><a href="showthread.php?t='. $recent_thread[threadid].'">'. $recent_thread[title].'</a></font></b><br/>'; $toutput .='<b><span style="color: #E1E1E2"><font size="1" face="verdana,arial">Last Post By: <a href="member.php?u='.$recent_thread[lastposterid].'">'.$recent_thread[lastposter].'</a></font><br/></span></b>'; $toutput .='<font size="1" face="verdana,arial">Forum: <a href="forumdisplay.php?f='.$recent_thread[forumid].'">'.$recent_thread[forumtitle].'</a> | Replies: '.$recent_thread[replycount].'</font><br/>'; $toutput .='<font size="1" face="verdana,arial">Posted: <strong>'.$recent_thread[lastpostdate].'</strong> at: <strong>'. $recent_thread[lastposttime].'</strong></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(); |
#139
|
||||
|
||||
Quote:
|
#140
|
||||
|
||||
I would like to display this widget in the center with a large portion of the posts showing. Is this possible?
|
#141
|
|||
|
|||
thank you for this widget
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|