Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 29 Dec 2012, 04:54
fungku's Avatar
fungku fungku is offline
 
Join Date: Jan 2011
Here is some code for adding recent threads on website front page

THIS widget thread by cory_booth helped get me started, but isn't what I needed, so this is a heavily modified version.

Here is the php for displaying recent threads on your front page (or any page), not as VB CMS.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.



The line with:
WHERE NOT ISNULL(threadid) AND forum.forumid NOT IN (3,10,11,12,13,14,15,16,19) AND visible = '1' AND open!='10'
Is where you would put the forumids of the forums you want to exclude from showing up.

Hope this is useful for somebody.

Since I found the original thread useful and this is a modified version of that, I thought I'd share as well.

add your own CSS, and edit the HTML, to syle it however you want.

Cheers,

--------------- Added 29 Dec 2012 at 05:11 ---------------

I tried to edit the above php code block to stop the word-wrap making it messy to read, but I've given up.

You can figure it all out easy enough it is short and sweet.

If this has helped you at all, if you have any questions, or if you see ways to improve it, please let me know.

Last edited by fungku; 30 Dec 2012 at 18:55.
Reply With Quote
  #2  
Old 02 Jan 2013, 14:14
Muhammad Rahman Muhammad Rahman is offline
 
Join Date: Jun 2012
Can cut off the day when the thread is displayed?
like a CMS Widget ..
Reply With Quote
  #3  
Old 02 Jan 2013, 18:05
fungku's Avatar
fungku fungku is offline
 
Join Date: Jan 2011
You could probably modify the SQL statement in this line:
WHERE NOT ISNULL(threadid) AND forum.forumid NOT IN (3,10,11,12,13,14,15,16,19) AND visible = '1' AND open!='10'
to also exclude posts older than a certain date.
Reply With Quote
  #4  
Old 12 Apr 2013, 03:52
bing11 bing11 is offline
 
Join Date: Feb 2003
Originally Posted by fungku View Post
You could probably modify the SQL statement in this line:
WHERE NOT ISNULL(threadid) AND forum.forumid NOT IN (3,10,11,12,13,14,15,16,19) AND visible = '1' AND open!='10'
to also exclude posts older than a certain date.
hello
Could limit 1 forum only can show 1 thread?

like we have 10 recent threads here . but must from 10 different forums.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 13:54.

Layout Options | Width: Wide Color: