View Full Version : Want to get "Today's Posts" or similar on WordPress
fmckinnon
06-02-2008, 07:38 PM
Hey Everyone,
I've got vbulletin installed at http://www.theworshipcommunity.com/forums
We are about to launch a magazine-style site in the root directory, which is powered by WordPress. We're using the Revelation Theme for WordPress, and since we aren't requiring registration to read the articles in WordPress ... I don't think we need the vbulletin/wordpress bridge just yet.
However, one of the things we'd hoped to implement on the homepage of Wordpress is an "include" to show some of the recent forum posts.
Example:
Today's Forum Discussions:
... and then have a dynamically updated list of the most recently updated (or new) threads.
In vbulletin, this is easy enough by simply logging in and going to "Quick Links > Today's Posts". What I'd love to be able to do is get these same results to show up to non-members, or people who aren't logged in, and have it show up on the index.php page of WordPress at http://www.theworshipcommunity.com/index.php
Any help or suggestions?
Fred
Dismounted
06-03-2008, 04:20 AM
You can simply query the database, or use the vBulletin RSS feed.
fmckinnon
06-03-2008, 02:49 PM
Thanks, Dismounted
The RSS feed seems to only include new items on the front page .. main forums, and doesn't seem to reflect updated threads in sub-forums, or just newly "updated" threads (only "new" threads, unless I'm missing something).
Can you help me along with what the code would like like to "query the database" from within wordpress?
Thanks,
Fred
Dismounted
06-04-2008, 09:24 AM
The most easiest way would be to include global.php.
mattpist
07-13-2008, 04:01 AM
um... how would this be done?
Dismounted
07-13-2008, 06:22 AM
I don't know how WordPress works, but if the MySQL user you use for WordPress has permissions on the vBulletin database, you can use WordPress' internal database class.
aisais
07-14-2008, 07:16 PM
um... how would this be done?
I think you can use JS feed insted.
I am planning to do it this way:
First, activate External Source Provider.
Go to: Admin Control Panel > vBulletin Options > External Data Provider:
and choose JavaScript ( first choice ).
Then copy this Java Script code code and add it right at the inside your WP theme template.
<!-- Title -->
<div id="forum">
<h2><a href="http://www.yourforum.url/search.php?$session[sessionurl]do=getnew">Last Active Threads</a></h2>
<!-- List of today's threads -->
<script type="text/javascript" src="http://www.yourforum.url/external.php?forumids=2,32,35,27,3,12,6,30,31&type=js"></script>
<script language="" type="text/javascript">
<!--
for (var x in threads)
{
document.writeln("<a href=\"showthread.php?t="+threads[x].threadid+"&goto=newpost\"><a href=\"http://www.yourforum.url/showthread.php?t="+threads[x].threadid+"\">"+threads[x].title+"</a> <span class=\"smallfont\">(By: "+threads[x].poster+")</span> <br />;");
}
</script>
</div>
Forumids= IDs of forum to grap posts from.
You will need to replace yourforum url and path inside the code
you might also need to replace the & sign with & in case had errors.
Option : if you want to show the list based on last post time add : &lastpost=1 right after &type=js at 4th line of the code.
Please let me know if it works with you.
Good Luck!
Fraik
07-15-2008, 04:04 PM
You can use the feeds, or simply search for 'external' in the mods section here. I use inferno external to display the last x amounts of posts on my wordpress site :)
kevcj
07-25-2008, 03:19 PM
I think you can use JS feed insted.
I am planning to do it this way:
Please let me know if it works with you.
Good Luck!
I have been trying to get this working on my wordpress site, but its not going through. The script works on a basic HTML page, but when its put into a wordpress page, it stops working.
I had 3 html portal pages the feed was working on for around 6 months. In june those sites were migrated to wordpress. The code was copied from the html page, pasted it into a wordpress page and it does not work.
Over the past 2 days I have tried 3 different sources of code - the one you posted above, my code from the html site and a code straight from vbulletin.com and non of them work. They might work in the right / left columns but I have not tried it there. I created a static wordpress page, and get nothing from the feed.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.