The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
LBmtb's Recent Topics on Non-VB Pages Details »» | |||||||||||||||||||||||||
RECENT TOPICS by LBmtb
Version 1.03 Last updated: March 27th, 2007 DESCRIPTION This script will display the topics with the most recent posts on a non-vb page (any HTML page). The page it's on must have a .php extension or you should setup apache to parse the page correctly. The threads with the latest posts are on top. The output is a clean list in this format: HTML Code:
<ul class="vb_topics"> <li><a href="http://www.yourdomain.com/forum/showthread.php?t=4150">This is the latest thread</a> <span class="vb_last_post">(user1 @ 12/18/06 05:58 PM)</span></li> <li><a href="http://www.yourdomain.com/forum/showthread.php?t=4138">Another recent thread</a> <span class="vb_last_post">(user2 @ 12/18/06 05:58 PM)</span></li> </ul>
There is a copyright line. I am releasing this script on the condition that you do not remove this line unless you send $5 via paypal to webmaster@socaltrailriders.org. Thanks in advance for understanding. NEED CUSTOMIZATION OR PROFESSIONAL INSTALLATION? Email me at webmaster@socaltrailriders.org, PM me on vbulletin.org, or aim me at "lbmtb" to inquire about customizing this script or installation. REVISION HISTORY Version 1.03: Adds small preview of first post when the user rolls over the links Version 1.02: option to exclude certain forums Version 1.01: option to only include certain forums Version 1.0: Initial Release INSTRUCTIONS: 1) Copy and paste the following code where you want the list to appear and adjust the values in the section "CUSTOMIZE THE FOLLOWING": PHP Code:
3) Enjoy! 4) Donate (this step optional) UPGRADE INSTRUCTIONS (from 1.02 to 1.03): FIND: Code:
$thread_sql = mysql_query("SELECT threadid,title,lastpost,lastposter FROM ".$db_prefix."thread WHERE visible=1 AND open=1 $fid_final $fidx_final ORDER BY lastpost desc LIMIT $limit"); Code:
$thread_sql = mysql_query("SELECT SQL_CACHE t.threadid,t.title,t.lastpost,t.lastposter,t.forumid,substring(p.pagetext,1,90) as post_text FROM ".$GLOBALS['db_prefix']."thread t INNER JOIN ".$GLOBALS['db_prefix']."post p ON t.firstpostid = p.postid WHERE t.visible=1 AND t.open=1 $fidi_final $fidx_final ORDER BY t.lastpost desc LIMIT $limit"); Code:
$tid = $thread_get['threadid']; Code:
$text = $thread_get['post_text']; Code:
forumid=".$value Code:
t.forumid=".$value Code:
echo "<li><a href=\"$forum_url/showthread.php?t=$tid\">$thread_get[title]</a> <span class=\"$recent_poster\">($poster $seperator $date2)</span></li>\n"; Code:
echo "<li><a href=\"$forum_url/showthread.php?t=$tid\" title=\"".$text."\">$thread_get[title]</a> <span class=\"$recent_poster\">($poster $seperator $date2)</span></li>\n"; UPGRADE INSTRUCTIONS (from 1.01 to 1.02): FIND: PHP Code:
PHP Code:
PHP Code:
NOTES: This is my first mod/script so be nice, please DEMO: http://www.socaltrailriders.org/latest_posts.php Supporters / CoAuthors Show Your Support
|
Comments |
#62
|
|||
|
|||
grate hack.. but I also can't use it to show posts from specific forums.. hopefully this will be fixed soon as I really need to install it
|
#63
|
|||
|
|||
I recently updated the script from 1.02 to 1.03 and some problems occured.
I changed the default code to suit my needs (utf-8, different style, max 30 chars in topic title etc.). I applied the same changes that worked in 1.02 to 1.03 but now every once in a while there are two arrows in front of one topic title. I added an arrow .gif in front of every topic title so it links to the newpost in that topic. For some reason this arrow is doubled by one of the topics on the list. It is not always the same topic and I can't find a rule that triggers this behaviour. Below is my modified code. Help would be much appreciated. Code:
## NO NEED TO TOUCH ANYTHING BELOW ##################################### ############################################################################# if (!($recent_topics_connection = mysql_connect("$db_host", "$db_user", "$db_pw"))) die ("could not connect"); if (!(mysql_select_db("$db_name", $recent_topics_connection))) mysql_error(); mysql_query('set names utf8'); mysql_query('set character set utf8'); $fid_array = explode (',', $fid_raw); if ($fid_raw) { $fid_final .= "AND ("; foreach( $fid_array as $key => $value){ if ($key == 0) { $fid_final .= "t.forumid=".$value; } else { $fid_final .= " OR t.forumid=".$value; } } $fid_final .= ")"; } $fidx_array = explode (',', $fidx_raw); if ($fidx_raw) { $fidx_final .= "AND NOT ("; foreach( $fidx_array as $key => $value){ if ($key == 0) { $fidx_final .= "t.forumid=".$value; } else { $fidx_final .= " OR t.forumid=".$value; } } $fidx_final .= ")"; } $thread_sql = mysql_query("SELECT SQL_CACHE t.threadid,t.title,t.lastpost,t.lastposter,t.forumid,substring(p.pagetext,1,200) as post_text FROM ".$GLOBALS['db_prefix']."thread t INNER JOIN ".$GLOBALS['db_prefix']."post p ON t.firstpostid = p.postid WHERE t.visible=1 AND t.open=1 $fidi_final $fidx_final ORDER BY t.lastpost desc LIMIT $limit"); while($thread_get=@mysql_fetch_array($thread_sql)) { $lastpost = $thread_get['lastpost']; $poster = $thread_get['lastposter']; $tid = $thread_get['threadid']; $text = $thread_get['post_text']; if ($post_date_format == "1") { $date2 = date ("m/d/y h:i A" ,$lastpost); } elseif ($post_date_format == "2") { $date2 = date ("h:i A" ,$lastpost); } else { $date2 = date ("m/d/y h:i A" ,$lastpost); } echo " <a href=\"$forum_url/showthread.php?t=$tid&goto=newpost\" class=\"povezava\" target=\"_parent\"><img src=\"arrow.gif\" border=\"0\" align=\"absmiddle\"> </a>"; echo " <a href=\"$forum_url/showthread.php?t=$tid\" class=\"povezava\" target=\"_parent\" title=\"".$text."\">"; if (strlen($thread_get[title])>30) echo substr($thread_get[title],0,30)."..."; else echo $thread_get[title]; echo "</a><br />\n"; } mysql_close($recent_topics_connection); ?> |
#64
|
|||
|
|||
The problem occurs when the preview text of the topic includes " in the text. This seems to mess up the output.
|
#65
|
|||
|
|||
How do I go about making the the links to the topics SEO friendly? My forum is using Zoints SEO.
|
#66
|
|||
|
|||
Hi,
How would i make it so the time is GMT, The forum is set to us GMT but the script wont show the time the forum is showing. Martin |
#67
|
|||
|
|||
A very nice script - I was wondering it looks like - ORDER BY t.lastpost desc
shows the last comments. Can I change it so that it would order by the original post time in the thread. So that the order is from what I post time, and when people comment on an item it doesn't mess up the ordering that I had them in. |
#68
|
|||
|
|||
This works well but how do you get the links to open up in a new window or the parent window using an iframe?
|
#69
|
|||
|
|||
|
#70
|
|||
|
|||
Hi this is a great mod, thank you! I have to use this one because my site is php4 so I wonder.. is there anyway to give it an offset, so it can exclude the most recent 5 topics?
This is will allow for a 2 or 3 column layout. Thanks again |
#71
|
|||
|
|||
OK.. so offset then.
Is it possible to display a group of boards.. for example I have board 5 with sub boards inside it.. it is possible to display the main board AND the sub boards? Thanks for your help, looking forward to using this. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|