Log in

View Full Version : Latest vBulletin Posts on a Non-vBulletin Page


PGAmerica
09-04-2009, 02:54 AM
I saw a mod along time ago that showed how to add vBulletin info on non-vBulletin pages. It would allow me to do something like vbAdvanced does (latest posts, etc) without using vbAdvanced. I do not need all the features of vbAdvanced and want alot more control of the look and feel.

Does anybody know where these instructs are? I look around and cannot seem to find it.

kevcj
09-04-2009, 01:39 PM
I saw a mod along time ago that showed how to add vBulletin info on non-vBulletin pages.

You do not need a modification for this. All you need to do is turn the feature on and put a script on the site you want to display the feed on.

If you want to look it up, its called the "external data provider." Here is where to find it at.

Step 1 - VB admin control panel - left column - vb options - vb options - External Data Provider - Enable External Javascript - Yes - Save.

Step 2 - Then go to the webpage you want to display the recent post on and add this code.

<script type="text/javascript" src="http://www.your forum address.com/forum/external.php?&type=js"></script>
<script language="" type="text/javascript">
<!--
for (x = 0; x < 15; x++)
{
document.writeln("*<a href=http://www.your forum address.com/forum/showthread.php?t="+threads[x].threadid+">"+threads[x].title+"</a><br />");
}
//-->
</script>

That will display the 15 most recent forum threads on your external page. Just for the fun of it, I inserted a * to separate the links. Lets say you want 5 post instead of 15, just replace that 15 in the code with a 5.

You can see it here in the left column of this site - its feeding the most recent post from the VB forum - http://www.elgms.com/

That should get you started. If you need more inforamtion, go to vbulletin.com and look up "External Data Provider" - there have been several examples posted over there.

You can also define which forum sections you want to display from. And I have that option set on another one of my sites. Where only post from certain forum sections are displayed.

PGAmerica
09-04-2009, 02:34 PM
Thank you for this info. I will look into it now.

--------------- Added 1252080062 at 1252080062 ---------------

Well, it works perfectly with your code.

I did a search as you suggested, but I was unable to get code to display the latest posts in specific forums. My goal is twofold:

1) Display the contents of the latest post (including the post title)in 1 specific forum on my main page (the news forum). Actually, preferably the 1st 50 characters with a link to the full post.

2) Display the contents of the latest post (including the post title) in 2 specific forums on my main page. Actually, preferably the 1st 25 characters with a link to the full posts.

Is this even possible?

kevcj
09-04-2009, 04:49 PM
Thank you for this info. I will look into it now.


I did a search as you suggested, but I was unable to get code to display the latest posts in specific forums.

Here is the code to display only certain forum sections on an external page

<script type="text/javascript" src="http://www.your forum address.com/external.php?forumids=49,108,11,13,12&type=js"></script>
<script language="" type="text/javascript">
<!--
for (x = 0; x < 15; x++)
{
document.writeln("*<a href=http://www.your forum address.com/showthread.php?t="+threads[x].threadid+">"+threads[x].title+"</a><br />");
}
//-->
</script>


Notice in this second example there is some extra code in the first part ?forumids=49,108,11,13,12&type=js

Just change those numbers to the forum section you want to display.

I use both of the codes on two different wordpress blogs. That is how I came up with them so fast. I just copied them out of my site and posted them here. If they work for me, they will work for u.

PGAmerica
09-05-2009, 12:35 AM
It is working. I have placed your script 3 times on my page to pull in posts for news, forum 3&4 and also forum 9. The first 2 are working, but the last on is not. See for yourself at http://www.jonandchuck.com.

The code I am using to pull in the "News" (forum ID #2) is as follows:
<script type="text/javascript" src="/forums/external.php?forumids=2&type=js"></script>
<script language="" type="text/javascript">
<!--
for (x = 0; x < 15; x++)
{
document.writeln("<li><a href=/forums/showthread.php?t="+threads[x].threadid+">"+threads[x].title+"</a></li>");
}
//-->
</script>

This is working. The code I am using for the 2nd pull (Forum ID 3 and ID4) is as follows:
<script type="text/javascript" src="/forums/external.php?forumids=3,4&type=js"></script>
<script language="" type="text/javascript">
<!--
for (x = 0; x < 15; x++)
{
document.writeln("<li><a href=/forums/showthread.php?t="+threads[x].threadid+">"+threads[x].title+"</a></li>");
}
//-->
</script>

This is also working. The code I am using for the 2nd pull (Forum ID 9) is as follows:
<script type="text/javascript" src="/forums/external.php?forumids=9&type=js"></script>
<script language="" type="text/javascript">
<!--
for (x = 0; x < 15; x++)
{
document.writeln("<li><a href=/forums/showthread.php?t="+threads[x].threadid+">"+threads[x].title+"</a></li>");
}
//-->
</script>

THIS IS NOT WORKING!!

Ideas?

--------------- Added 1252128122 at 1252128122 ---------------

Weird! It is working now.

Is there any way to show some of the contents of the posts on the page like vbAdvanced does?

Lynne
09-05-2009, 04:45 AM
Weird! It is working now.

Is there any way to show some of the contents of the posts on the page like vbAdvanced does?
Not through using the javascript method you are using, no. If you want a post preview, you will have to use queries to grab this information for your page.

kevcj
09-05-2009, 01:45 PM
Is there any way to show some of the contents of the posts on the page like vbAdvanced does?

Take a look at a script called "carp" and another one called "grouper" from geckotribes. Both of those scripts take rss feeds and can parse them in different ways.

Carp is free and can display only rss2 feeds.

Grouper is a commercial grade solution and can display all kinds of feeds.

Your supposed to be able to display just the title, part of the feed or the whole article using those 2 scripts. Their very flexible in the ways you can set them up.

ggiersdorf
10-01-2009, 08:45 PM
Sorry to jump on this late, but Im trying to use this as well however I was wondering if there is a way to make the newest post or the newest reply in a post to jump the thread to the top again?

Im trying to say the last 10 active discussions. If one happens to be a new post fine, if its a 30 day old post and someone replies I want that to bump up to the top of the list again.. is that possible??

thanks in advance!

Lynne
10-01-2009, 10:07 PM
RSS feeds show the latest threads. So, if you want to do latest posts, you will probably have to use another method like query the database.

ggiersdorf
10-01-2009, 10:22 PM
Thanks Lynn might someone be able to help me achieve this?

Lynne
10-01-2009, 11:12 PM
search "latest*" in "all mods" "titles only" and you should probably find what you want.