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)

GONUMBER6 03-08-2010 12:34 AM

Quote:

Originally Posted by Inflikted (Post 1994657)
is there an easy way to block out private forums from this?

nevermind figured it out... for those others who wanted to know how

change
Code:

if (!in_array($recent_thread[forumid], array(105,83,121,110,82,112,109,101,102,72))) {
to the proper forumid's you would like to block
PHP 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 visible = '1' AND open!='10' 
ORDER BY lastpost DESC 
LIMIT 0, 10 
"
); 
$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('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(); 


I tried to change it, but must be doing something wrong. What exactly do I change?

I pasted this into the widget where you placed it:
if (!in_array($recent_thread[forumid], array(105,83,121,110,82,112,109,101,102,72))) {

and then changed the forum id to the forum I want hidden:

if (!in_array($recent_thread[Moderators Area], array(105,83,121,110,82,112,109,101,102,72))) {

How do I do it the right way??? Thank you in advance cuz I really like this widget!!! :)

AURFSCAN 03-08-2010 12:44 AM

If you want forum id's 1,2,3,4 hidden then it would look like this

if (!in_array($recent_thread[forumid], array(1,2,3,4))) {

GONUMBER6 03-08-2010 01:31 AM

Awesome, but it did not work for me. :( I tried 3 times.

Here is the error I am getting:


Parse error: syntax error, unexpected $end in /home/content/32/5565332/html/forums/packages/vbcms/widget/execphp.php(177) : eval()'d code on line 39

GONUMBER6 03-08-2010 01:36 AM

Thanks, I finally got it.

GONUMBER6 03-08-2010 01:57 AM

I am sorry to bug you all again, but now the "last post by:" is white, which does not show on the white background of this widget.

Can you tell me what sylvars or coding to change the background (not the font) to the same color as my board? Thanks in advance....

Here is my CMS page: http://www.englishbulldognews.com/forums/content.php

I have the new widget on the bottom of the page until I get it up and running properly to replace the 4.02 standard one, so scroll down plz... :)

Inflikted 03-08-2010 04:27 AM

change the font colors in the script, i had to modify the colors to make it look right with my theme. sorry i forgot to remove those parts out.

RedHacker 03-08-2010 07:32 AM

Quote:

Originally Posted by AURFSCAN (Post 1999517)
If you want forum id's 1,2,3,4 hidden then it would look like this

if (!in_array($recent_thread[forumid], array(1,2,3,4))) {

Parse error: syntax error, unexpected $end in /home/*****/public_html/packages/vbcms/widget/execphp.php(177) : eval()'d code on line 41

GONUMBER6 03-08-2010 01:17 PM

Make sure you use the entire code, don't just add the code to the original. Same thing happened to me until I earased and used the entire code.

Inflikted 03-08-2010 02:21 PM

ya.. its not just one line there is a bracket at the bottom your missing, which doesnt properly close the script.

RedHacker 03-08-2010 06:57 PM

Quote:

Originally Posted by GONUMBER6 (Post 1999812)
Make sure you use the entire code, don't just add the code to the original. Same thing happened to me until I earased and used the entire code.

I cant understand...

GONUMBER6 03-08-2010 07:20 PM

Quote:

Originally Posted by Inflikted (Post 1994657)
is there an easy way to block out private forums from this?

nevermind figured it out... for those others who wanted to know how

change
Code:

if (!in_array($recent_thread[forumid], array(105,83,121,110,82,112,109,101,102,72))) {
to the proper forumid's you would like to block
PHP 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 visible = '1' AND open!='10' 
ORDER BY lastpost DESC 
LIMIT 0, 10 
"
); 
$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('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(); 


Sorry, use the above code, (the one that was added), don't use the original and then add the code. It does not work that way (yet).

GONUMBER6 03-08-2010 07:22 PM

How do I change the back ground color of the widget? Mine is currently white with blue/grey shaded in between threads.

Also, how do I increase the amount of recent threads showing? Right now I only show 8, would like to see 20.

Also, how to add a "go to last post" button to it?

Thanks in advance!

alkrida 03-15-2010 10:08 PM

updata the arabic>>>

Quote:

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 visible = '1' AND open!='10'
ORDER BY lastpost DESC
LIMIT 0, 10
");
$i = 0;
while ($recent_thread = $db->fetch_array($recent_threads))
{
$i++;
if (!in_array($recent_thread[forumid], array(1,2,3))) {
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">آخر مشاركة بواسطة: <a href="member.php?u='.$recent_thread[lastposterid].'">'.$recent_thread[lastposter].'</a></font><br/></span></b>';
$toutput .='<font size="1" face="verdana,arial">قسم: <a href="forumdisplay.php?f='.$recent_thread[forumid].'">'.$recent_thread[forumtitle].'</a> | الردود: '.$recent_thread[replycount].'</font><br/>';
$toutput .='<font size="1" face="verdana,arial">بتاريخ: <strong>'.$recent_thread[lastpostdate].'</strong> في: <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();
you need to clear the Cache :)

thankx

RedHacker 03-16-2010 06:46 AM

Can help me someone with this...?

I have Parse error: syntax error, unexpected T_STRING, expecting ']' in /home/xxxxx/public_html/packages/vbcms/widget/execphp.php(177) : eval()'d code on line 19

and i put this
Code:

if (!in_array($recent_thread[Hidden Area], array(132,257,268))) {

Videx 03-16-2010 09:33 AM

Quote:

Originally Posted by RedHacker (Post 2004614)
i put this
Code:

if (!in_array($recent_thread[Hidden Area], array(132,257,268))) {

Why have you replaced 'forumid' with 'Hidden Area'? Nobody told you to do that. The only thing you're supposed to change is the numbers of the forums in the array.

RedHacker 03-17-2010 05:55 AM

Quote:

Originally Posted by Videx (Post 2004674)
Why have you replaced 'forumid' with 'Hidden Area'? Nobody told you to do that. The only thing you're supposed to change is the numbers of the forums in the array.

OK put this

Code:

if (!in_array($recent_thread[forumid], array(132,257,268))) {
and show this message:

Parse error: syntax error, unexpected $end in /home/xxxxx/public_html/packages/vbcms/widget/execphp.php(177) : eval()'d code on line 4

e-Peer 03-17-2010 06:08 AM

^ That error usually means you're missing a closing } before the php end tag (?>).

RedHacker 03-17-2010 06:49 AM

Quote:

Originally Posted by e-Peer (Post 2005304)
^ That error usually means you're missing a closing } before the php end tag (?>).

Thanks must be put
Code:

}
before //End Thread Counts

johnny713 03-18-2010 11:43 PM

Thank you for sharing Cory. This is what I looking for..installed :).

sqzdog 03-18-2010 11:56 PM

Can anybody figure out how to make this widget scroll? vertical, not horizontal marquee.

BlackThorn 04-06-2010 01:21 PM

Gread job! installed.

murekhalir 04-06-2010 05:42 PM

I can't get the widt to work, do i enter it as a php direct execution?

Also - do i just copy and paste the code on the OP literally? without any changes?

Or... would i have to add forum sections / ids in there.

graphicnut 04-16-2010 12:03 AM

Great widget ;) Where do we edit the styles for it? Thanks in advance

Sorry see it now in the actual code.

How would i make the title larger and bold, sorry for noob Q :)

GONUMBER6 04-17-2010 03:10 PM

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! :)

Inflikted 04-18-2010 06:25 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! :)

to do that just read this http://www.freefrag.com/guides-tutor...ge-script.html

The script I posted you can throw that into its own php file as well as externally use it on another site if you know how ofcourse. That script should work for CMS and vBA CMPS and also should work outside vbulletin forums :)

Example: http://www.freefrag.com
Outside Example: http://freefrag.com/outsidesample.php (no css on this one :P but you can stylize it still)

axix20xx 04-20-2010 07:42 AM

many tahnx installed but onle showed the date

Inflikted 04-20-2010 10:58 PM

axix you put the coding in the description that means, go back into your widgets and make sure you click on configure to add the code in the proper area.

AnthemToGod 04-27-2010 08:27 AM

How to hide some forums id ?

widget displays all forum threads but I have some invisible area on my forum... how to except some id's ?

AnthemToGod 04-27-2010 08:44 AM

Quote:

Originally Posted by AnthemToGod (Post 2028014)
How to hide some forums id ?

widget displays all forum threads but I have some invisible area on my forum... how to except some id's ?

find them :)

sql:

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(82,41,159) AND visible = '1' AND open!='10'
ORDER BY lastpost DESC
LIMIT 0, 15

sKippah 04-27-2010 01:42 PM

Can anybody replace "Last Post By: - Forum: and Posted:" with the vb:phrase code?
Thx

Videx 04-27-2010 02:01 PM

Quote:

Originally Posted by AnthemToGod (Post 2028014)
How to hide some forums id ?

widget displays all forum threads but I have some invisible area on my forum... how to except some id's ?

You have incorrectly used the code in the first post instead of reading through the thread and using the code in https://vborg.vbsupport.ru/showpost....7&postcount=25 that includes an exclusion array.

I have no idea why the author hasn't yet updated the first post or at least mentioned the exclusion option.

cory_booth 04-27-2010 02:54 PM

Quote:

Originally Posted by Videx (Post 2028116)
You have incorrectly used the code in the first post instead of reading through the thread and using the code in https://vborg.vbsupport.ru/showpost....7&postcount=25 that includes an exclusion array.

I have no idea why the author hasn't yet updated the first post or at least mentioned the exclusion option.

Sorry ya'll...

I will get that updated... I am currently retiring from the military, establishing a new home, and looking for a J.O.B. while also trying to finish up my degree. LOL... I miss a lot of the posts sometimes.

Videx 04-27-2010 04:39 PM

Thanks! Yes, we all understand B.U.S.Y.! But while you're updating, you may also want to mention that removing the ! from that line will make it an inclusion list.

Dr.osamA 04-27-2010 09:33 PM

thanxx installed + 5 stars

janaf 05-13-2010 08:38 AM

Installed! Worknig out of the box!

(Yes, to use this widget, your create a new PHP direct execusion widget, save it, open Configure link for it, copy and past the code (may 13:th 2010) unchanged)

Someone with more vB knowledge than me could surely change the SQL query so that only the postings that the current user has rigts to see, will be displayed. Then members of restricted forums could also see those postings from those forums.

Pangramma 05-14-2010 01:24 PM

Hey, it's any way possible to show the "go to last post" button?

Great alternative for default VB widget, installed! :D

Katoona 05-15-2010 02:25 AM

I would also like "go to latest post" option, and I was also wondering if it is possible to change the code so that it shows recent threads from one spesific user (I really need this for some sub-pages I am making).

I would really appreciate any help making this possible.

alfisti 05-19-2010 11:17 PM

I have vb 4.0.3 and the vb_date is not working, only the time is working.

In the position of the date, it shows always M jS.

Any ideas??
Thanks

[Fixed]

GONUMBER6 05-22-2010 09:13 PM

It seems the widget is configured to pull out the last 24 hours of threads. My forum is not that busy yet (hopefully soon), can we pull 2 days worth instead? How do I change that?

Go to last post button would be nice too. :)

wanno 05-27-2010 02:03 PM

Quote:

Originally Posted by alfisti (Post 2040215)
I have vb 4.0.3 and the vb_date is not working, only the time is working.

In the position of the date, it shows always M jS.

Any ideas??
Thanks

[Fixed]

Put the code in Configure.


All times are GMT. The time now is 04:03 AM.

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.01515 seconds
  • Memory Usage 1,894KB
  • 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
  • (6)bbcode_code_printable
  • (2)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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