vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   vBulletin CMS Widgets - [WIDGET] Recent Threads (https://vborg.vbsupport.ru/showthread.php?t=236404)

peterkohar 10-02-2011 12:55 PM

why i have space above my first post in this widget ?
how to remove that.

https://vborg.vbsupport.ru/


thanks for the help, will appreciate it much

Wordplay 10-02-2011 10:48 PM

how do you change how old the threads can be before they stop showing there, and the number of threads to show in this widget?

Wordplay 10-05-2011 11:53 PM

Quote:

Originally Posted by Wordplay (Post 2252486)
how do you change how old the threads can be before they stop showing there, and the number of threads to show in this widget?

anything anybody?

Videx 10-06-2011 12:16 AM

Quote:

Originally Posted by Wordplay (Post 2252486)
how do you change how old the threads can be before they stop showing there, and the number of threads to show in this widget?

Did you look at the code? It's been a while for me, but there's a line "LIMIT 0, 10" that sure sounds like it's setting the output to 10; just lower it.

I don't think you can set a cutoff date easily. If you set the output to 5, it will get 5 regardless of dates.

bada_bing 10-06-2011 02:23 AM

anyway to make this ajax ?

Videx 10-06-2011 02:44 AM

Quote:

Originally Posted by bada_bing (Post 2253811)
anyway to make this ajax ?

Depends on how skillful you are. Let us know if you manage it.

Lazorbeam 11-08-2011 03:08 PM

Quote:

Originally Posted by peterkohar (Post 2252323)
why i have space above my first post in this widget ?
how to remove that.

http://www.tdwclub.com/0temp/3.png


thanks for the help, will appreciate it much

Link me to your forum and I can fix this. I had the same issue and resolved it, but I can't remember what I had to change. I will have to inspect your page.

tonjohn 11-09-2011 06:10 PM

The exclusion list should simply be added to the query, no?

Just move the line where you build the list before the query and add it to the WHERE clause.

pportuese 01-30-2012 12:30 AM

This work on 4.1.10?

tsac 01-30-2012 04:08 AM

Quote:

Originally Posted by pportuese (Post 2294040)
This work on 4.1.10?

I'm running 4.1.10 and It's working just fine for Me. :)

ibwt 02-12-2012 02:08 AM

how to do it to show for specific forums only ?

PowerboatNation 03-29-2012 09:52 PM

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.

http://iamcdl.com/images/preview.jpg

John Lester 08-03-2012 05:11 AM

Works for me on 4.1.12 :)

barnsi 08-08-2012 02:15 PM

1 Attachment(s)
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(); 


Draffi 10-24-2012 09:16 PM

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

John Lester 10-31-2012 07:08 PM

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

John Lester 10-31-2012 09:02 PM

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();


fungku 12-30-2012 06:52 PM

Quote:

Originally Posted by GONUMBER6 (Post 2022694)
Can this widget be placed on a regular site page (not in vb)? I would like a widget of recent threads on my home page at www.englishbulldognews.com

Thanks! :)

https://vborg.vbsupport.ru/showthread.php?t=293380

RichieBoy67 01-17-2013 04:55 PM

I would like to display this widget in the center with a large portion of the posts showing. Is this possible?

t18ftw 04-15-2013 01:40 AM

thank you for this widget

Obi Wan 11-08-2013 04:17 PM

1 Attachment(s)
i can not use the Widget :(

where is the error ?

I have vb4.2.1

emits 10-13-2014 08:09 PM

It is possible to set one forum? And Is it possible to download user names with avatar?

Bubroid 10-27-2014 07:55 AM

How can I add 1'st posts text to the block?

barnsi 12-10-2015 05:43 PM

Hello World!
...how can i INCLUDE only one forum? :confused:

i found one solution in including forum "355":
PHP Code:

LEFT JOIN  " . TABLE_PREFIX . "forum AS forum ON forum.forumid thread.forumid )  
WHERE NOT ISNULL(threadid) AND forum.forumid '355'  AND visible '1' AND open!='10' 

...but how can i include all the childforums under forum 355?
PHP Code:

WHERE NOT ISNULL(threadid) AND forum.forumid IN (355,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,396,397,392,398,399,393,400,401,394,395,402,403,404,366,405,415,416,406,417,418,407,419,420,408,421,422,423,424,425,426,427,428,429,430,409,410,431,432,411,412,413,414,433,434)  AND visible '1' AND open!='10' 

...the more comfortable way to include one forum including complete childlist:
(in this example forum 355)
PHP Code:

ob_start(); 
global 
$vbulletin$db$vbphrase
//Begin Thread Counts 
$childlist 0;
if(
$fcc355 $vbulletin->forumcache[355]['childlist'])
{
    
$childlist trim(str_replace('-1'''$fcc355), ',');
}   
$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 forum.forumid IN (
$childlist) AND visible = '1' AND open!='10'

ORDER BY lastpost DESC  
LIMIT 0, 20 


barnsi 03-16-2023 03:26 AM

To INCLUDE only three forums (for example) including all childforums, i found a solution:
PHP Code:

ob_start(); 
global 
$vbulletin$db$vbphrase
//Begin Thread Counts 
$childlist 0;

$fcc16 $vbulletin->forumcache[16]['childlist']; // LKW-B?nder
$fcc213 $vbulletin->forumcache[213]['childlist']; // Vormontage
$fcc256 $vbulletin->forumcache[256]['childlist']; // Bau 73
$arr $fcc16 $fcc213 $fcc256;

$childlist trim(str_replace('-1'''$arr), ',');
  
$toutput=''

To EXCLUDE only two forums (for example) including all childforums, i found this solution:
PHP Code:

ob_start(); 
global 
$vbulletin$db$vbphrase
//Begin Thread Counts  
$fcc355 $vbulletin->forumcache[355]['childlist']; // Forum Anlagenw?rter
$fcc455 $vbulletin->forumcache[455]['childlist']; // Forum Pistolenlebenslauf

$arr $fcc355 $fcc455// Foren, die ausgeblendet werden sollen
$arr trim(str_replace('-1'''$arr), ',');

$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 forum.forumid not in (
$arr) AND visible = '1' AND open!='10' ORDER BY lastpost DESC  
LIMIT 0, 50  
"
); 



All times are GMT. The time now is 11:27 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02780 seconds
  • Memory Usage 1,863KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (7)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (25)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete