PDA

View Full Version : Integration with vBulletin - LBmtb's Recent Topics on Non-VB Pages


LBmtb
12-18-2006, 10:00 PM
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:

<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>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 othersCOPYRIGHT
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
################################################## ########################
// RECENT TOPICS by LBmtb
// Version 1.03
// 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.

// APEARANCE OPTIONS
$seperator = "@"; // 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"

// use one or the other, not both. if left blank the script will return threads from any forum
$fid_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

## 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";
$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.forum id,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");
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 "<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";
}
echo "</ul>\n<div style=\"font-size: .9em;\">recent topics by <a href=\"http://www.socaltrailriders.org/\"><acronym title=\"Southern California Trail Riders\">SocalTrailRiders.org</acronym></a></div>";
mysql_close($recent_topics_connection);
?> 2) Go back to the vbulletin.org thread where you found this and click on "Mark as Installed"
3) Enjoy!
4) Donate (this step optional) (https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=webmaster%40socaltrailriders%2eorg&item_name=vb%20Mod&item_number=Recent%20Topics%20Script&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8)


UPGRADE INSTRUCTIONS (from 1.02 to 1.03):

FIND:
$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");REPLACE WITH:
$thread_sql = mysql_query("SELECT SQL_CACHE t.threadid,t.title,t.lastpost,t.lastposter,t.forum id,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");FIND:
$tid = $thread_get['threadid'];AFTER, ADD:
$text = $thread_get['post_text'];FIND AND REPLACE:
forumid=".$valueWITH:
t.forumid=".$valueFIND:
echo "<li><a href=\"$forum_url/showthread.php?t=$tid\">$thread_get[title]</a> <span class=\"$recent_poster\">($poster $seperator $date2)</span></li>\n";REPLACE WITH:
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:
// APEARANCE OPTIONS
$seperator = "@"; // this goes between last poster and date
$fid_raw = ""; // If you want to restrict to specific forums, enter the forum id(s) here. seperate them with a comma. Otherwise, leave it blank.
$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"REPLACE WITH:
// APEARANCE OPTIONS
$seperator = "@"; // 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"

// use one or the other, not both. if left blank the script will return threads from any forum
$fid_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 commaREPLACE EVERYTHING BELOW:
## NO NEED TO TOUCH ANYTHING BELOW ######################################
################################################## ########################With everything below that same line in 1.02

NOTES:
This is my first mod/script so be nice, please :)

DEMO:
http://www.socaltrailriders.org/latest_posts.php

LBmtb
12-19-2006, 12:48 AM
I'll be cool like all the veterans out there and reserve the first post. :)

Murty
12-19-2006, 03:48 AM
hmm... looks interesting. what would this be handy for?

LBmtb
12-19-2006, 03:56 AM
hmm... looks interesting. what would this be handy for?
Probably most useful for people who have a website outside of their forums. Like my website has some 'static' html pages aside from the forums. There are mods and vBAdvanced modules that do this sort of thing but I never found one that did this on a page outside of vBulletin.

So basically . . . handy for displaying recent forum activity outside of the forums. Check my website link in my sig for an idea of how I use it. :)

OmniBuzz
12-19-2006, 04:51 AM
any chance to have a version that would add an "updated threads" list ?
Like :
palm spring ...(created by outlaw blabla, last answer by neil blabla)

s0b
12-19-2006, 05:01 AM
Great, installed it but i am also interested in the "updated threads"

LBmtb
12-19-2006, 05:16 AM
any chance to have a version that would add an "updated threads" list ?
Like :
palm spring ...(created by outlaw blabla, last answer by neil blabla)
Here ya go:
<?php
################################################## ########################
// RECENT TOPICS 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.

// APEARANCE OPTIONS
$seperator = "@"; // this goes between last poster and date
$forum_id = ""; // If you wish to display the posts from a specific forum, enter the forum id here. Otherwise, leave it blank.
$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"

// 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

## 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";
if ($forum_id) { $forumid = "AND forumid=$forum_id"; }
$thread_sql = mysql_query("SELECT threadid,title,lastpost,lastposter, postusername FROM ".$db_prefix."thread WHERE visible=1 AND open=1 $forumid ORDER BY lastpost desc LIMIT $limit");
while($thread_get=@mysql_fetch_array($thread_sql))
{
$lastpost = $thread_get['lastpost'];
$firstpost = $thread_get['postusername'];
$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); }
echo "<li><a href=\"$forum_url/showthread.php?t=$tid\">$thread_get[title]</a> <span class=\"$recent_poster\">(created by: $firstpost, last reply by: $poster $seperator $date2)</span></li>\n";
}
echo "</ul>\n<div style=\"font-size: .9em;\">recent topics by <a href=\"http://wwwsocaltrailriders.org/\"><acronym title=\"Southern California Trail Riders\">SocalTrailRiders.org</acronym></a></div>";
mysql_close($recent_topics_connection);
?>
That will stick "(created by: MOSH1DH, last reply by: SAR_boats @ 12/18/06 09:23 PM)" at the end of it. Looks a bit long to me? What would be a better format for it?

Well if you set $post_date_format to 2 then it'll only have 09:23 PM for the last post time. That should ease up on the clutter.

UPDATE: Instructions for this functionality are in post 17 (https://vborg.vbsupport.ru/showpost.php?p=1141686&postcount=17).

OmniBuzz
12-19-2006, 05:36 AM
THANKs, I am going to install it today :)
Well, me being in France (bonjour) any chance to have a 17:00 rather than a 5:00 PM time display ?

LBmtb
12-19-2006, 05:48 AM
THANKs, I am going to install it today :)
Well, me being in France (bonjour) any chance to have a 17:00 rather than a 5:00 PM time display ?
FIND: if ($post_date_format == "1") { $date2 = date ("m/d/y h:i" ,$lastpost); }
elseif ($post_date_format == "2") { $date2 = date ("h:i" ,$lastpost); }
else { $date2 = date ("m/d/y h:i A" ,$lastpost); }
REPLACE WITH:
if ($post_date_format == "1") { $date2 = date ("m/d/y H:i A" ,$lastpost); }
elseif ($post_date_format == "2") { $date2 = date ("H:i" ,$lastpost); }
else { $date2 = date ("m/d/y H:i A" ,$lastpost); }
:)

edit: removed AM/PM. Thanks for pointing it out, firstrebel

firstrebel
12-19-2006, 07:19 AM
FIND: 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); }
REPLACE WITH:
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); }
:)
Still shows AM/PM after doing this. Nice mod, better than the one from vB's support site, which is never up-to-date.

Installed.

Bob

s0b
12-19-2006, 08:09 AM
Its possible to export this mod to a Javascript that lent me some like this:

<script type="text/javascript" language="JavaScript1.2">
var parameter1=value1;
var parameter2=value2;
etc.


EDIT: I forget to say that the vbSEO version will be great, i use it

projectego
12-19-2006, 11:36 AM
Awesome! Thanks for this. :)

LBmtb
12-19-2006, 12:44 PM
Still shows AM/PM after doing this. Nice mod, better than the one from vB's support site, which is never up-to-date.

Installed.

Bob
Oops, didn't notice the lack of AM/PM. Only noticed the 24hr time (it's finals week here and I'm tired). I updated post #9 - now it takes out AM/PM also.

If you modified it like I said before and it shows 24hr time and AM/PM just do a find/replace turning "H:i A" into "H:i".

Its possible to export this mod to a Javascript that lent me some like this:

<script type="text/javascript" language="JavaScript1.2">
var parameter1=value1;
var parameter2=value2;
etc.


EDIT: I forget to say that the vbSEO version will be great, i use it
Sorry, I don't know javascript. I'll see about releasing the vbSEO one tonight.
Awesome! Thanks for this. :)
You're welcome. :)

Amenadiel
12-19-2006, 01:48 PM
I use something similar based on a stripped vaispy code (without the scrolling part) inside an iframe. I use this because I need it to look at the permissions, so gathering data directly from the database wouldn't suit my needs.

Congratz anyway.

firstrebel
12-19-2006, 02:42 PM
If you modified it like I said before and it shows 24hr time and AM/PM just do a find/replace turning "H:i A" into "H:i".

Works fine, thanks.

Bob

LBmtb
12-19-2006, 03:41 PM
I use something similar based on a stripped vaispy code (without the scrolling part) inside an iframe. I use this because I need it to look at the permissions, so gathering data directly from the database wouldn't suit my needs.

Congratz anyway.
Thanks for pointing that out, I didn't think about permissions and such. I'll make a version tonight that selects only public forums. The option "$forum_id =" in the current script only works when one forum is selected. The new version will take multiple forum ID's separated by commas.

Stay tuned.

LBmtb
12-19-2006, 04:55 PM
UPDATE: uploaded a new version that can restrict the threads to just a select number of forums. If you want to use this feature, modify "$fid_raw =" (there's instructions in the code).

It won't check whether the user is logged in and what he/she has permission to. But you can simply restrict it to forums that you want to be publicly available.

:)

edit: Added following instructions.

In this newer version, if you guys want to include the thread creator as was discussed in post 7, (https://vborg.vbsupport.ru/showpost.php?p=1141433&postcount=7) do this:
FIND:
$thread_sql = mysql_query("SELECT threadid,title,lastpost,lastposter FROM ".$db_prefix."thread WHERE visible=1 AND open=1 $fid_final ORDER BY lastpost desc LIMIT $limit");
REPLACE WITH:
$thread_sql = mysql_query("SELECT threadid,title,lastpost,lastposter,postusername FROM ".$db_prefix."thread WHERE visible=1 AND open=1 $fid_final ORDER BY lastpost desc LIMIT $limit");
FIND:
echo "<li><a href=\"$forum_url/showthread.php?t=$tid\">$thread_get[title]</a> <span class=\"$recent_poster\">($poster $seperator $date2)</span></li>\n";
REPLACE WITH:
echo "<li><a href=\"$forum_url/showthread.php?t=$tid\">$thread_get[title]</a> <span class=\"$recent_poster\">(created by: $firstpost, last reply by: $poster $seperator $date2)</span></li>\n";

The time instructions (https://vborg.vbsupport.ru/showpost.php?p=1141442&postcount=9) are still the same to change from 12hr to 24hr.

Anybody need upgrade instructions to go from 1.00 if you already installed it to 1.01? Only new functionality is to be able to restrict threads to multiple forums.

Injektilo
12-19-2006, 06:13 PM
i've entered my db settings but it only outputs this

recent topics by SocalTrailRiders.org

pcoskat
12-19-2006, 06:20 PM
FABULOUS, FABULOUS!!! (Nice site, btw!)

Any chance this works on non-vb pages that are on a different domain?

ETA
I just went back and read the entire first post. Now I see it works on any HTML page.

I think I'm in love!! :)

LBmtb
12-19-2006, 08:01 PM
i've entered my db settings but it only outputs this
Re-check the db settings, it sounds like the connection to the database or the query failed. Did you remember about the table prefix (if any) also? PM me if you still have trouble.
FABULOUS, FABULOUS!!! (Nice site, btw!)

Any chance this works on non-vb pages that are on a different domain?

ETA
I just went back and read the entire first post. Now I see it works on any HTML page.

I think I'm in love!! :)
You're welcome. :)

I haven't tried it on different domains since my site isn't run like that but I would think you'd just change $db_host to whatever the db server is.

Injektilo
12-19-2006, 08:39 PM
LBmtb: all db settings seems to be ok ... its kind of weird why it doesnt work :S

Hornstar
12-19-2006, 11:23 PM
I'm about to install this now. I think ill donate you the $5 as well, because i'm hoping you may be able to help me with getting it to fit into the current style of my site, as I know ill end up having trouble with that part.

Also what are the chances you will release other vbadvanced mods for non vb pages? Because then you would be my god lol. There are all these mods that I used to use, but since going to a non vb page for my homepage, I have not been able to use any of them.

LBmtb
12-20-2006, 01:15 AM
I'm about to install this now. I think ill donate you the $5 as well, because i'm hoping you may be able to help me with getting it to fit into the current style of my site, as I know ill end up having trouble with that part.

Also what are the chances you will release other vbadvanced mods for non vb pages? Because then you would be my god lol. There are all these mods that I used to use, but since going to a non vb page for my homepage, I have not been able to use any of them.
Thanks a lot, hornstar. I don't have msn. Do you have aim? I'm lbmtb on there.

Chances of releasing vbadvanced mods for non vb pages are fairly slim. I don't and have never used vbadvanced before. I also have an upcoming events script on my site - that one I got off of vbulletin.org. I'm sure you can find it if you search. PM me with mod ideas if you'd like.

firstrebel
12-20-2006, 06:51 AM
i've entered my db settings but it only outputs this

I have this same problem. v1.00 works but v1.01 does not.

Bob

LBmtb
12-20-2006, 08:10 AM
Ah, dangit. You guys are right. Here's the fix:

FIND:
if ($fid_array) {
REPLACE WITH:
if ($fid_raw) {

I updated the top instructions. Sorry!

LBmtb
12-20-2006, 08:28 AM
Plan for tomorrow: Add the ability to exclude forums. Currently you can only specify forums to include.

The include would be useful if you want threads from just one or two forums. If you want most forums to be displayed except for one or two then you'd want to use the exclude thing.

firstrebel
12-20-2006, 11:57 AM
Ah, dangit. You guys are right. Here's the fix:

FIND:
if ($fid_array) {
REPLACE WITH:
if ($fid_raw) {

I updated the top instructions. Sorry!
All OK now, thanks.

Bob

LBmtb
12-20-2006, 03:43 PM
All OK now, thanks.

Bob
Good to hear! :)

Updated the script with the ability to exclude certain forums. Included upgrade instructions from 1.01. So now you can either specify forums to include OR forums to exclude.

Anybody have any suggestions for future releases?

Hornstar
12-21-2006, 07:01 AM
Well I sent you a list of other mods suggestions, but so far this looks great. I'm just trying to get it positioned into the right spot on my homepage tho, i'll probably spend hours on that lol.

Some suggestions could be to also include a snipet of the post, and if you do that, then I have heaps of ideas to go on from their.

also do you have the vbseo version?

also you misspelled your domain name in the copyright part.

Thanks.

4yBak
12-21-2006, 11:40 AM
hm... maybe you know how to parse bb-codes stored in DB ? I was did similar task, but I have trouble with parsing vBulletin bb-codes :(

More info here.

LBmtb
12-21-2006, 02:39 PM
Well I sent you a list of other mods suggestions, but so far this looks great. I'm just trying to get it positioned into the right spot on my homepage tho, i'll probably spend hours on that lol.

Some suggestions could be to also include a snipet of the post, and if you do that, then I have heaps of ideas to go on from their.


also do you have the vbseo version?

also you misspelled your domain name in the copyright part.

Thanks.
Thanks a lot for the info on the mispelling. Maybe I should have waited until after finals week to work on this? lol

I'll try and get the vbSEO one released tomorrow. Snippet of post is possible. What would be more useful: snippet of the last post made or of the first post?

hm... maybe you know how to parse bb-codes stored in DB ? I was did similar task, but I have trouble with parsing vBulletin bb-codes :(

More info here.
BBcode sounds like a lot of work, lol. I'll look into it though . . .

LBmtb
12-22-2006, 02:01 AM
EDIT: I forget to say that the vbSEO version will be great, i use it
Here ya go: linkage (https://vborg.vbsupport.ru/showthread.php?p=1143223).

Hornstar
12-24-2006, 11:50 AM
Im thinking first post would be more useful, maybe release this one as a second mod release, have it like a news system. so it displays a snipet of the post including all bb code. that would be really good for some more content on my homepage.

Thanks.

weicool
12-26-2006, 04:42 PM
Hi, is there anyway to display only the name of the person who started the thread, and NOT the latest poster?

Never mind, I figured it out. Thanks for this nice script.

Hornstar
01-04-2007, 01:24 AM
Hi, is there anyway to display only the name of the person who started the thread, and NOT the latest poster?

Never mind, I figured it out. Thanks for this nice script.

Mind sharing it, the more we have the better.

tonynlek
01-31-2007, 01:20 PM
LBmtb,

I need help to install it and i dunno much about PHP. care to guide me along or anyone.

I do not know how to do this part:
<< The page it's on must have a .php extension or you should setup apache to parse the page correctly. >>

What must i do first?

saman
02-03-2007, 01:43 PM
LBmtb,

I need help to install it and i dunno much about PHP. care to guide me along or anyone.

I do not know how to do this part:
<< The page it's on must have a .php extension or you should setup apache to parse the page correctly. >>

What must i do first?

facing the same problem

right now i have added it on .html extension and the only thing it shows is this:

recent topics by SocalTrailRiders.org

can someone help me out with this? i really like this mod, i am testing it and if he works i will need to get the copyright removed ($5)...

btw, where should i add this html code?

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>

tonynlek
02-05-2007, 02:21 AM
As far as i know, You need to create an inframe in HTml page to put in the site address of that PHP file and it will open in the inframe.

I hate the borderline of the inframe, so my homepage has to be index.php, in order to put the code without the inframe border.

a programmer that i paid, told me this. I wonder why the script creator dun reply.

tonynlek
02-05-2007, 03:42 AM
// use one or the other, not both. if left blank the script will return threads from any forum
$fid_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


How do you put the ID there?

Dave-ahfb
02-05-2007, 03:56 PM
I am attempting to install this and it does works as designed, however I am trying to include multiple instances of the script on the same page, each instance using a different forum./

example:

top of page use only forum 14
middle of page use only forum 13

yadda yadda

I can include multiple instances of the same forum meaning I can place forum 14 in as many places of a page as I want, but I cannot get a second forum to show in a different location of the page.

LBmtb
02-06-2007, 04:35 AM
First of all, thanks to everyone for their interest in this mod.
LBmtb,

I need help to install it and i dunno much about PHP. care to guide me along or anyone.

I do not know how to do this part:
<< The page it's on must have a .php extension or you should setup apache to parse the page correctly. >>

What must i do first?
You can either rename the page with a .php extension or if your page has a .html or .htm extension add the following to your apache configuration file and restart apache:
AddType application/x-httpd-php .html .htm


facing the same problem

right now i have added it on .html extension and the only thing it shows is this:

recent topics by SocalTrailRiders.org

can someone help me out with this? i really like this mod, i am testing it and if he works i will need to get the copyright removed ($5)...

btw, where should i add this html code?

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>
Same answer as previous person. Don't insert that html code into your page; it's just an example of the output that the script makes.

As far as i know, You need to create an inframe in HTml page to put in the site address of that PHP file and it will open in the inframe.

I hate the borderline of the inframe, so my homepage has to be index.php, in order to put the code without the inframe border.

a programmer that i paid, told me this. I wonder why the script creator dun reply.
That would work, or the apache method I described above, or adding the .php extension like you did.

How do you put the ID there?
Just list off the forum ID's and separate them with a comma. For example if I want to only include threads from three forums with ID's 9, 11, and 15 I would have this:
// use one or the other, not both. if left blank the script will return threads from any forum
$fid_raw = "9,11,15"; // 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

I am attempting to install this and it does works as designed, however I am trying to include multiple instances of the script on the same page, each instance using a different forum./

example:

top of page use only forum 14
middle of page use only forum 13

yadda yadda

I can include multiple instances of the same forum meaning I can place forum 14 in as many places of a page as I want, but I cannot get a second forum to show in a different location of the page.
It's possible but you would need to do some renaming of copying and renaming of variables so that variables from one of the sections don't conflict with variables from the other section.

If you need custom work done, PM me.

tonynlek
02-06-2007, 11:41 PM
You can either rename the page with a .php extension or if your page has a .html or .htm extension add the following to your apache configuration file and restart apache:


Hi LBmtb,

Thanks for your reply. BY the way, where is the apache config file. ANd which part of the page should i put the code in. I am sorry to ask you this question as programming is out of my league. Learning now.

LBmtb
02-07-2007, 06:42 PM
Hi LBmtb,

Thanks for your reply. BY the way, where is the apache config file. ANd which part of the page should i put the code in. I am sorry to ask you this question as programming is out of my league. Learning now.
I found a good tutorial on it: http://www.adlogger.org/index.php/Parsing_HTML_Pages_Like_PHP

Tomzl
02-13-2007, 04:25 PM
Is there a way to trim the number of characters in the topic title? For example: a topic has 50 characters in its title. Can I show just 25 characters with this script?

roni1015
02-15-2007, 01:27 PM
I'm trying to rescrict this to only public forums and it's still showing threads from all forums.

Here is the code I have:

// use one or the other, not both. if left blank the script will return threads from any forum
$fid_raw = "99,3,119,134"; // 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

I also tried doing it by excluding certain forums instead and removed the ones to include and then added the ones to exclude below, but it didn't work either. What am I doing wrong?

pcoskat
02-15-2007, 04:47 PM
LBmtb, is your 'upcoming events' list using the EVENTS mod, or is your mod using a feed directly from the calendar?

roni1015
02-17-2007, 04:16 PM
I'm trying to rescrict this to only public forums and it's still showing threads from all forums.

Here is the code I have:

// use one or the other, not both. if left blank the script will return threads from any forum
$fid_raw = "99,3,119,134"; // 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

I also tried doing it by excluding certain forums instead and removed the ones to include and then added the ones to exclude below, but it didn't work either. What am I doing wrong?

Anyone?

superluks
02-19-2007, 05:59 PM
i wanna add it to header - i added this code <?php include("last.php"); ?> but it wont content..

Dave-ahfb
03-03-2007, 01:20 AM
Is there a way to limit the text string? I have small "modules" and some times they wrap 3 times.

ricker
03-16-2007, 04:52 AM
This may be a long shot, but I'm using extra threadfields (https://vborg.vbsupport.ru/showthread.php?t=108888) and am wondering if it'd be easy to include a field or two in the display. :D Thanks for the great mod!!!

Rich
03-23-2007, 11:54 PM
I have a request that would benefit me greatly. I am using this modification, or will be anyways, ON vBulletin powered pages. I would LOVE to have this as a variable. My attempts so far have failed at making it function as one though. The best I could do was get it to display a single entry.

I realize there are other modifications out there that do this within the boundries of vB. They don't serve my purpose though.

This one allows me to quickly reuse the same information, except output different forums in a different file. This is what I need.

Any chance you could make this a variable or show me how to make it a variable that I could toss into custom templates I have created? (I already include the global file in THIS modification and output the template below this code. I would like the ability to insert this code though into the templates.

Thanks for any input you could give.

ricker
03-24-2007, 11:52 PM
Great script! Thanks! I'm looking to send you over a donation, but Paypal is acting up. Any chance you can add a "donation" link in your post? You may get more clicks.

Keep rockin!
Sarah

LBmtb
03-27-2007, 06:26 PM
Is there a way to limit the text string? I have small "modules" and some times they wrap 3 times.
Yeah there is, I don't have much time available though. If you really need that done PM me and maybe I can do a custom script for you.
Anyone?
Hi Roni. I'm interested in what query the script if using for you. Do this:

After
$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");
Insert
echo "<!-- 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 -->";
Then go to the page, look at the source code and copy the query. You can PM me the query it makes so I can look it over. If you have SSH or phpMyAdmin access you can try the query directly and see what you get.
This may be a long shot, but I'm using extra threadfields (https://vborg.vbsupport.ru/showthread.php?t=108888) and am wondering if it'd be easy to include a field or two in the display. :D Thanks for the great mod!!!
I'm pretty sure it's possible. I haven't looked at the mod myself but I assume it just makes extra fields in the vb_thread table. Again, if you need a customized script for that PM me.
I have a request that would benefit me greatly. I am using this modification, or will be anyways, ON vBulletin powered pages. I would LOVE to have this as a variable. My attempts so far have failed at making it function as one though. The best I could do was get it to display a single entry.

I realize there are other modifications out there that do this within the boundries of vB. They don't serve my purpose though.

This one allows me to quickly reuse the same information, except output different forums in a different file. This is what I need.

Any chance you could make this a variable or show me how to make it a variable that I could toss into custom templates I have created? (I already include the global file in THIS modification and output the template below this code. I would like the ability to insert this code though into the templates.

Thanks for any input you could give.
Unfortunately I'm not too familiar with vBulletin variable and such. If you want to take this script and work with it or have another person work with it just let me know.
Great script! Thanks! I'm looking to send you over a donation, but Paypal is acting up. Any chance you can add a "donation" link in your post? You may get more clicks.

Keep rockin!
Sarah
Thanks, "ricker" :)

ZomgStuff
03-27-2007, 08:58 PM
Very nice!

firstrebel
06-02-2007, 04:13 PM
// use one or the other, not both. if left blank the script will return threads from any forum
$fid_raw = "14"; // 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
This is not working in vB 3.6.7PL1. No matter which forum ID I use it returns the last 10 from all forums.

Bob

Rich
06-09-2007, 03:09 PM
This is not working in vB 3.6.7PL1. No matter which forum ID I use it returns the last 10 from all forums.

Bob

A work around would be to input the forums that wish NOT to display. The location to do that is directly below the location where you input the forums you DO wish to display.

jags2ooo
06-23-2007, 06:31 AM
wow this looks great, wondering can i get it to show the full post as well as the topic ?

amnesia623
08-29-2007, 08:34 AM
I have a request that would benefit me greatly. I am using this modification, or will be anyways, ON vBulletin powered pages. I would LOVE to have this as a variable. My attempts so far have failed at making it function as one though. The best I could do was get it to display a single entry.

I realize there are other modifications out there that do this within the boundries of vB. They don't serve my purpose though.

This one allows me to quickly reuse the same information, except output different forums in a different file. This is what I need.

Any chance you could make this a variable or show me how to make it a variable that I could toss into custom templates I have created? (I already include the global file in THIS modification and output the template below this code. I would like the ability to insert this code though into the templates.

Thanks for any input you could give.

if you use the directions here -> http://www.vbulletin.com/forum/showthread.php?t=173937 and include the file as a plugin you can sort of achieve this. would love to know how to just have the code in the plugin instead of calling a file.... but it's a working solution until others follow

amnesia623
08-29-2007, 08:40 AM
do you know how cool this is? rock the house baby!

xBhp
09-06-2007, 02:34 PM
Despite my best of efforts I could not make it display posts only from a single forum. It still displays recent posts from all forums.

ahmedbehiry
10-17-2007, 09:42 AM
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 :(

Tomzl
10-22-2007, 07:03 PM
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.

## 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.forum id,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 "&nbsp;<a href=\"$forum_url/showthread.php?t=$tid&goto=newpost\" class=\"povezava\" target=\"_parent\"><img src=\"arrow.gif\" border=\"0\" align=\"absmiddle\">&nbsp;</a>";
echo "&nbsp;<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);
?>

Tomzl
10-22-2007, 07:32 PM
The problem occurs when the preview text of the topic includes " in the text. This seems to mess up the output.

ceint
02-26-2008, 08:45 AM
How do I go about making the the links to the topics SEO friendly? My forum is using Zoints SEO.

martinc126
02-26-2008, 04:24 PM
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

tspore
03-08-2008, 09:05 PM
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.

umusic2000
03-13-2008, 07:32 AM
This works well but how do you get the links to open up in a new window or the parent window using an iframe?

LBmtb
09-09-2008, 07:49 AM
Posted an update here: https://vborg.vbsupport.ru/showthread.php?t=190425

thanks,

microdot
09-13-2008, 08:14 AM
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

microdot
09-26-2008, 02:36 PM
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.

CorneliusW
10-28-2008, 11:57 PM
I just download version 1.03 and it only outputs recent topics by SocalTrailRiders.org

I saw the previous comments but those were for the older versions so it doens't apply to me + there are three "$fid_array".

Can you please help. Thanks!

BTW database information is correct. Checked about 20 times.

JohorBahru
02-16-2009, 02:03 PM
could i put this on my vbulletin homepage?
because it seems like more flexible than other recent topic mod

varkjie
07-08-2009, 03:21 AM
This may be a stupid question..... but my main site is currently html, how can I apply this php code on an html site? if I can't then how I can I make it's own directory where it will run as a php?
I tried making a directry and uploading the code in it's own file as test.php and it didn't work... not sure what else I should be trying?

Thanks

netdreams
02-02-2010, 05:03 AM
hey that work for me
nw i need one help
pls tell me that hw to add latest blog post in non-vb page

any help would be appriciated

thank u