vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Latest vBulletin Posts on a Non-vBulletin Page (https://vborg.vbsupport.ru/showthread.php?t=222438)

PGAmerica 09-04-2009 02:54 AM

Latest vBulletin Posts on a Non-vBulletin Page
 
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

Quote:

Originally Posted by PGAmerica (Post 1879407)
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 [DATE]1252080062[/DATE] at [TIME]1252080062[/TIME] ---------------

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

Quote:

Originally Posted by PGAmerica (Post 1879638)
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:
Code:

<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:
Code:

<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:
Code:

<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 [DATE]1252128122[/DATE] at [TIME]1252128122[/TIME] ---------------

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

Quote:

Originally Posted by PGAmerica (Post 1879901)
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

Quote:

Originally Posted by PGAmerica (Post 1879901)

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?


All times are GMT. The time now is 09:43 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01199 seconds
  • Memory Usage 1,750KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete