PDA

View Full Version : Calling recent blog posts externally


Fuzz
09-20-2012, 11:22 PM
Hey guys,

I have scoured the forums and can't seem to find a straight answer on this, so can someone please help me out?

How can you call external data from my vBulletin 'blog'? I know how to use the external.php and get the last 5 threads on a non-vb page, however, I would like to know how to do the same for blogs? Is this possible? is that what the 'blog_external.php" file is for? Do i do it like this?

<div class="smallfont">
<script type="text/javascript" src="http://www.thefinalfantasy.com/forums/blog_external.php?type=rss"></script>
<script language="" type="text/javascript">
<!--
for (var x in threads)
{
document.writeln("<img class=\"inlineimg\" src=\"$stylevar[imgdir_button]/lastpost.gif\" alt=\"\" border=\"0\" /> <a href=\"showthread.php?t="+threads[x].threadid+"\">"+threads[x].title+"</a> <span class=\"time\">($vbphrase[posted_by]: "+threads[x].poster+")</span><br />");
}
//-->
</script></div>

Notice the rest after the JS call are for the latest threads (external.php) not blog, since I don't even know what variables or data I can even pull. Is there a list of such variables?

I have everything switched enabled in the admin panel for external data... so I guess my question is HOW to call the last 5 blog posts on a NON vbulletin page externally?

I appreciate any help you can provide.

Thank you,

kh99
09-21-2012, 09:04 PM
blog_external.php doesn't support javascript output, only RSS, so you can't use it that way. I think you'd have to write your own custom script to do it (which you might be able to do by combining the blog_external.php script with the javascript portion of external.php).

Fuzz
09-23-2012, 04:03 AM
Thanks for the reply and clearing that up for me. I attempted to combine the JS elements of the 'external.php' to the 'blog_external.php' file and calling it that way, but couldn't get it to work. I ended up just doing a custom query. Thanks again