Version: 1.00, by LBmtb
Developer Last Online: Aug 2015
Category: Integration with vBulletin -
Version: 3.6.4
Rating:
Released: 12-21-2006
Last Update: Never
Installs: 22
No support by the author.
This mod does the same thing as my original recent topics mod but vbSEO'izes the URL's. You MUST have vbSEO installed for this one to work. Otherwise use the original one.
RECENT TOPICS (vbSEO edition) by LBmtb
Version 1.00
Last updated: Dec 21th 2006
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/general-discussion/4150-a-thread.html">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/general-discussion/4152-another-thread.html">Another recent thread</a><span class="vb_last_post">(user2 @ 12/18/06 05:58 PM)</span></li></ul>
Customizable options include:
* forum ID - choose to only include or exclude certain forums
* number of topics displayed
* CSS class names for the topic name/url and last poster/date
* and a few others
COPYRIGHT
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.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:
<?php
##########################################################################
// RECENT TOPICS (vbSEO edition) by LBmtb
// webmaster@socaltrailriders.org OR aim: LBmtb
//
// Do not remove copyright unless you donate $5 via paypal
// to the above email address, thanks
// CUSTOMIZED from a www.phase1media.com script found here:
// https://vborg.vbsupport.ru/showpost.php?p=589067&postcount=7
##########################################################################
## CUSTOMIZE THE FOLLOWING ##############################################
// DATABASE & URL SETTINGS
$db_host = "localhost"; // Change this if your MySQL database host is different.
$db_name = "db_name"; // Change this to the name of your database.
$db_user = "db_username"; // Change this to your database username.
$db_pw = "db_password"; // Change this to your database password.
$db_prefix = "vb_"; // Change to your tables' prefix. Usually vb_
$forum_url = "http://www.yourdomain.com/forum"; // Change this to reflect to your forum's URL.
// APPEARANCE OPTIONS
$separator = "@"; // this goes between last poster and date
$limit = "10"; // Number of posts displayed
$post_date_format = "1"; // leave as 1 for "12/18/06 05:26 PM" or change to 2 for "05:26 PM"
// FORUM SOURCES FOR TOPICS
// use one or the other, not both. if left blank the script will return threads from any forum
$fidi_raw = ""; // ONLY include threads from these forums. seperate each ID with a comma
$fidx_raw = ""; // Exclude threads from these forum. seperate each ID with a comma
// CSS CLASSES
$recent_topics = "vb_topics"; // you can use CSS to adjust the presentation of the list
$recent_poster = "vb_last_post"; // you can use CSS to adjust the presentation the last poster and date
## VBSEO SETTINGS #####################################################
include_once "forum/includes/functions_vbseo.php"; // change this path to reflect where your forum is
vbseo_startup(); // if you have a vbSEO version under 3, comment this line and uncomment the next three
// vbseo_get_options();
// vbseo_prepare_seo_replace();
// get_forum_info();
## 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();
echo "<ul class=\"$recent_topics\">\n";
$fidi_array = explode (',', $fidi_raw);
$fidx_array = explode (',', $fidx_raw);
function forum_where($f_array,$which){
if ($which == "i") { $f_final .= "AND ("; }
if ($which == "x") { $f_final .= "AND NOT ("; }
foreach( $f_array as $key => $value){
if ($key == 0) { $f_final .= "forumid=".$value; }
else { $f_final .= " OR forumid=".$value; }
}
$f_final .= ")";
return $f_final;
}
if ($fidi_raw) { $fidi_final = forum_where($fidi_array,"i"); }
if ($fidx_raw) { $fidx_final = forum_where($fidx_array,"x"); }
$thread_sql = mysql_query("SELECT threadid,title,lastpost,lastposter,forumid FROM ".$db_prefix."thread WHERE visible=1 AND open=1 $fidi_final$fidx_final ORDER BY lastpost desc LIMIT $limit");
while($thread_get=@mysql_fetch_array($thread_sql))
{
$lastpost = $thread_get['lastpost'];
$poster = $thread_get['lastposter'];
$tid = $thread_get['threadid'];
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); }
Just a thought, I know we can include or not include certain forums, however I was thinking it would be much better if it could automatically not include any forums who that user does not have permission too.
for example. I want to see the staff section posts, but I dont want other users seeing them. I'm sure this is possible, what do you think?
Got the donation, its nice to know the work is appreciated. THANKS!
Quote:
Originally Posted by hornstar1337
Just a thought, I know we can include or not include certain forums, however I was thinking it would be much better if it could automatically not include any forums who that user does not have permission too.
for example. I want to see the staff section posts, but I dont want other users seeing them. I'm sure this is possible, what do you think?
I can't promise that I'll commit to it because of time. But I did notice someone had an access control mod for non vb pages. Maybe I'll get in touch with him and see what we can do.
Got the donation, its nice to know the work is appreciated. THANKS!
I can't promise that I'll commit to it because of time. But I did notice someone had an access control mod for non vb pages. Maybe I'll get in touch with him and see what we can do.
You're welcome. Hope it helps out your site.
Cool, because if you guys could work together and make some awesome mods for non vb pages, I would seriously be thrilled