![]() |
vBulletin-WordPress Bridge
I have been looking around for a WordPress - vBulletin plug-in and can?t seem to find one. I had time today to look at the WordPress code and tried out some things, and came up with a small hack for a bridge.
This bridge will let you use vBulletin as the main comments area for the blog entry. A copy of the intro blog entry is automatically created in a specific forum you choose, as well as a link back to the original blog entry from the forum. The blog entry will also show the total comments made. Let me first say that I don?t have any experience in creating plug-ins for WordPress so please don?t ask me to convert this to one. If you plan to make this as an official plug-in or improve on it, please make sure to let me know so I can place a link on this article to yours. Thanks and I hope you all enjoy it. Note:
Database Changes: I have added a new column in WordPress? posts table to maintian the vBulletin thread id that will be automatically generated for the blog entry. Note that the table name prefix might be different from your WordPress table settings: Code:
ALTER TABLE `wp_posts` ADD `vb_threadid` INT(10); Save the following as vb3?settings.php and upload it to the Wordpress wp-includes folder: Code:
<?php
Added in v1.1: In the attached files at the right, download postfeed.php and upload it to the root folder of your vB forums (it should be in the same folder where external.php is). Files to be Modified: Here comes the slightly harder part. We need to modify some WordPress files. Part of the changes assume that you are using the Kubrick default theme. If you are using a different theme, change the corresponding files accordingly. wp-includes/comment-functions.php Replace: Code:
function get_comments_number( $comment_id ) { Code:
function get_comments_number( $comment_id ) { Code:
function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') { Code:
include (ABSPATH . WPINC . '/vb3-settings.php'); Added in v1.1: wp-includes/feed-functions.php Replace: Code:
function comments_rss_link($link_text = 'Comments RSS', $commentsrssfilename = '') { Code:
function comments_rss_link($link_text = 'Comments RSS', $commentsrssfilename = '') { wp-admin/post.php Below: Code:
require_once('admin.php'); Code:
include_once (ABSPATH . WPINC . '/vb3-settings.php'); Code:
$result = $wpdb->query($postquery); Code:
// VB Bridge Start If you are using the Kubrick default theme, open wp-content/themes/default/comments.php Replace contents with: Code:
<?php // Do not delete these lines If you are using the Kubrick default theme, open wp-content/themes/default/single.php Replace: Code:
You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(true); ?>" rel="trackback">trackback</a> from your own site. Code:
You can <a href="/forum/showthread.php?t=<?php echo( $post->vb_threadid ); ?>&goto=newpost">leave a response</a>, or <a href="<?php trackback_url(true); ?>" rel="trackback">trackback</a> from your own site. If you are using the Kubrick default theme, open wp-content/themes/default/footer.php Replace: Code:
and <a href="feed:<?php bloginfo('comments_rss2_url'); ?>">Comments (RSS)</a>. Code:
<!-- and <a href="feed:<?php bloginfo('comments_rss2_url'); ?>">Comments (RSS)</a>.--> Lastly, open wp-rss2.php Replace: Code:
<wfw:commentRSS><?php echo comments_rss(); ?></wfw:commentRSS> Code:
<wfw:commentRSS>http://www.yoursite.com/forum/showthread.php?t=<?php echo $post->vb_threadid; ?></wfw:commentRSS> vBulletin Settings: The RSS feed will not work if you haven't activated RSS External synidcation on your forum. To do this, on your forums admincp, go to vBulletin Options->External Data Provider and check 'Yes' on Enable RSS Syncidcation. Final Words: Well, that?s about it! I?m not sure how often I can visit this thread but I hope those who find success in implementing the bridge, can help those who are having problems. Again, if you have suggestions on improving the script, let me know. Thanks and happy modding! :D Live Demo: http://www.internettablettalk.com/blog/ Revision History: v1.2 (12/7/2005): Uses correct vB user id and user name of the blog author. This will work only if the username of the Wordpress user is exactly the same as the vB username. If not, it uses $vb_userid and $vb_username defined in the settings. v1.1 (8/19/2005): Revisions are based on reports by Darth Gill (see discussion). New version includes vB RSS thread parser and a bug fix on vB not displaying recently added blog entry on the forum level. Current revisions are marked in green. Changes:
Screenshots: |
awesome awesome awesome
Been waiting for something like this... will install later :) |
This is really cool stuff, thank you for the hard work and I will talk to my friend who asked me for such a thing to see if this is what he is looking for.
|
Can this be made for 3.5?
|
I haven't tried it but it should work. There are no vB code changes in the hack. Changes are all done on the side of WordPress.
|
really cool- thanks for sharing all of your work! :D
|
I love it! I have it installed. This is exactly what I was looking for!!!! VERY GOOD. Now you need to make it better! Works great with 3.5. :D
Either Convert HTML into VBCODE or insert it as HTML OR Have an option in the plugin to insert into vbulletin only a snippet of the original post - that way forum users are forced to go to the blog. |
Quote:
Thanks. |
I modified the code to put just 150 chars into the forum as a snippet. You also need to parse out and " > <, etc... because the strip html function in php doesn't handle this. Just do a ireg_replace('"','\"','string) or something like that....
Brandan |
Brandan,
The code right now actually looks for the <!--more--> tag and only copies the text beofre it. I thought that's a good way to quote the entry. If you want to add a limit, you can probably add a new variable at vb-settings.php so you can increase/decrease the limit easily. Thanks. |
Thanks rsupido, I changed it back (to use the <!--more--> tag ... I've noticed a few bugs that could use correction. First of all, when I create a blog entry, it doesn't seem to be making the new thread properly so that it shows up on forum home. (as the latest thread in that forum) and the icon is missing on the forum listing. It only shows up if you edit the thread manually.
Second, the rss feed doesn't display the comments for me properly... See example: Regular blog entry: http://blog.5solas.org/2005/08/18/th...rist-has-done/ Feed: http://blog.5solas.org/2005/08/18/th...has-done/feed/ Now I have some comments for this post, but they're not in this feed. Any ideas? Thanks for a great product! |
Wow! Wow! Wow! Wow! Wow! Just plain Wow! :)
I am gonna try and install it on my 3.5 site! Thanks a lot sir! :) |
Quote:
Quote:
|
Quote:
In the first one (forumhome), you can see that the latest thread in the forum isn't showing up in the display. In the second one, (5solas.org Blog Listing), you can see that the icon is missing in the display. I think maybe you need to do TWO inserts into vbulletin - one for thread and one for the post - but I may be mistaken. You can see the forum listing at : http://forums.5solas.org/forumdisplay.php?f=29 Quote:
|
I see what you mean. I'll try to look into it.
|
New version is now up!
v1.1 (8/19/2005): Revisions are based on reports by Darth Gill (see discussion). New version includes vB RSS thread parser and a bug fix on vB not displaying recently added blog entry on the forum level. Current revisions are marked in green. Changes:
Enjoy. |
Wow, thanks for the quick FIX! I've updated my blog, now will the rss fix old blog entries or only new ones... cause I'm not seeing the fix in the older entries....
http://blog.5solas.org/2005/08/18/th...has-done/feed/ |
You have an error in one of your insert statements into vbulletin... Take out the extra spaces in front of allowsmilies...
|
Found another bug... See screenshot. First of all the post icon is still not showing up... And second, there are now { BRACKETS } around the poster name...
|
vB has a bug somewhere that puts spaces in the code tags for really long strings. :(
Please apply the modified change for wp-admin/post.php again Brandan. The RSS feed will only work on the new ones, sorry. I'll try to look for a work around though. |
the new rss feed isn't working for me...
I have posted a test comment, and it didn't work... |
Sort of an off-topic question, but if anyone knows the answer, I think it's you.
Can Wordpress integrate with Vbulletin so that the only members who can post articles/leave comments are those that are registered to the forum? Is there already a mod for this? |
Yes, this mod only allows the vB registered members to post comments.
|
Quote:
Warning: main(): Failed opening '' for inclusion (include_path='.:/usr/local/lib/php') in /homepages/28/d109317046/htdocs/xp9/blog/wp-admin/post.php on line 4 And the code from line 1-20 in wp-admin/post.php is PHP Code:
|
ok i fixed it its cause the code wasnt right on your site(but it was right here) now when i write something and hit publish it says
PHP Code:
|
---------------------------------------------------
please answer I see your viewing this thread :nervous: |
What's the prefix of your vB tables? Is it vb3? You need to indicate that in the vb3–settings.php.
|
Quote:
|
Quote:
|
Quote:
|
The best way is to open the config.php file in your <forum root folder>/includes. Somewhere in line 90, check what it says as the value of the "$tableprefix: variable. Copy that value in the "$vb_dbprefix" in vb3–settings.php.
|
Quote:
|
rsuplido, my blog still isn't parsing through comments in the rss feeds.... Any ideas why? I double checked everything, and it all looks good.... This is driving me crazy. Everything else is working great now though!
P.S. - I won't be around until Friday of next week to help debug this wonderful hack. Brandan |
Brandan,
I think the postfeed.php file isn't working since you are using vb3.5. I'm attaching a file for you. Rename it to postfeed.php and upload it to the root folder of your forums. |
That didn't work for me. Thanks for your effort though... :)
|
Sorry, it's a more of a trial-and-error for me since I'm not using v3.5. I have attached a new file. Please rename to postfeed.php and upload to your forum root folder.
Also, it seems like you didn't make the change on the wp-includes/feed-functions.php file. Please check. |
Didn't work... http://forums.5solas.org/postfeed.php?t=2529&type=rss2
|
Aha, I fixed it! I took out the AND $vboptions['externalrss'] out of the conditionals... Thanks! See attached... I'll be back next Friday...
Brandan |
That means you haven't activated external RSS in your vB settings (in vB options). Also, it seems like the domain field and URL in the RSS lacks your forum's complete path.
|
Actually, I did have external RSS activated and I did have the domain field filled out in my VB Options. I noticed it wasn't reading anything out of vboptions it seems! :) I replaced $vboptions[bburl] with http://forums.5solas.org... Thanks for pointing that out. - Brandan
|
All times are GMT. The time now is 09:42 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|