Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Complete Wordpress/Vbulletin Bridge - Share Users And Postings Details »»
Complete Wordpress/Vbulletin Bridge - Share Users And Postings
Version: 3.05, by Jafo232 Jafo232 is offline
Developer Last Online: Oct 2022 Show Printable Version Email this Page

Category: Integration with vBulletin - Version: 3.6.8 Rating:
Released: 12-20-2006 Last Update: 02-15-2011 Installs: 1260
DB Changes Uses Plugins
Additional Files  
No support by the author.

DOES NOT WORK FOR Vbulletin 4.x

This version probably no longer works for Wordpress 3.x. I have started developing this product over and have released the NEW version here:

http://www.lampwrights.com/showthread.php?t=41

This mod bridges your Vbulletin users over to Wordpress. You can also use Vbulletin as your comment engine instead of the spammy one built into Wordpress. You can display the comments inline in your post. You need not use the comment feature, if your only interested in sharing users.

You can map your Vbulletin Usergroups to Wordpress Usergroups and those users will then be recognized as registered Wordpress users.

For example, user "Joe" registers at your forum and logs in. Joe then clicks on your Wordpress page. Joe is instantly added to the Wordpress user base with the permissions you set for his usergroup. In otherwords, if a user comes over belonging to the "Registered User" group, you can select that he is placed in the Wordpress "Subscriber" usergroup.

If you change a users group from vbulletin, it will automatically change in Wordpress.

Requirements:
  • DOES NOT and WILL NEVER support Wordpress MU.
  • Wordpress and Vbulletin scripts must reside on the same physical server.
  • Wordpress and Vbulletin must use the same domain name.
  • Stable Wordpress Version greater than or equal to 2.5.
  • If your WP login name is the same as your VB username, this user will NOT be ported! If this was the case, you could lose your WP admin rights if there was an error, or if you deactivated the plugin.
  • DOES work for Vbulletin 3.7.
Limitations:
  • Please don't ask if it works for any BETA versions of Vbulletin. I do not know and will not convert this to the latest version of VB (whatever it is at the time you are reading this) until the version is released as non-beta.
  • If you delete a user, you must do so in both Wordpress and Vbulletin.
  • If you are using XMLRPC to post with applications such as Windows Live Writer, you must change the password of the author in the WORDPRESS admin cp, after the user is ported over from VB. If you are not integrating users, then you do not have to.
  • Chances are, this will not work when VB and Wordpress are located in different sub domains. I.E. forum.yoursite.com - blog.yoursite.com. Cookie issue.
  • I did the best I could in determining your forums file path with the script. There may be certain script setups that cannot find the file path properly, in which case you may get errors that the script cannot find or open /config.php. If this is the case, please HARDCODE your ABSOLUTE path to the forum in vbridge.php.

    To do this find:

    Code:
     ## If you are having path problems, uncomment this next variable and define the path
    ## NO TRAILING SLASH!
    # $vwd = '/some/path/to/your/forum';
    And uncomment the last line, and change the path to your forums path:

    Code:
     ## If you are having path problems, uncomment this next variable and define the path
    ## NO TRAILING SLASH!
    $vwd = '/some/path/to/your/forum';
Common Mistakes When Installing:
  • Using two different host names causes problems. If your forum URL contains www.yourdomain.com, then your wordpress blog URL MUST contain the www. part of www.yourdomain.com also. This goes for any other host name. Browsers are finnecky when it comes to cookies (as they should be).
  • Editors generally EDIT, not write. In Wordpress, editors don't show up in the post author drop down. This has nothing to do with this plugin, that is Wordpress code.
  • Make sure you DO NOT create a subdirectory for this plugin in the wp-content/plugins directory. Just upload it directly there.
  • If the admin username in Vbulletin is the same as the one in Wordpress (i.e. Admin), that user will NOT be able to login to the WP dashboard.
  • If you do not map users before you turn auto-integrate on, the plugin has no idea whether your allowed into the dashboard.
  • If you all of a sudden can't login to the dashboard, see the above two common mistakes.
  • FOLLOW the directions and make a test post first. Being in a rush and not testing will most likely turn out bad for you.
  • When you create a test user in VB to test mapping users, the test user MUST have an email address. If a VB users email address is blank, they will not map.
UPDATES:

01/03/2007 - Fixed the unlock_tables() issue on some setups.

01/03/2007 - Fixed a bug in the script that if you used a MySQL database prefix, integration would not work. Please see this post for more information! Special thanks to axisoverdrive for giving me access to his server and letting me troubleshoot the issue!

01/05/2007 - Fixed issue where if a user saved (not published) and published later, the post would not be added to the forum.

01/05/2007 - When a post is edited, it will also be edited in the forum.

01/08/2007 - Modified slightly so when posts are edited, so are the titles (if edited).

02/07/2007 - Major modifications to new version (now 2.05). The list follows:
  • Reworked the code so it uses the $vbulletin object throughout the code especially during the bridging process.
  • Users are bridged whether they checked the "Remember Me" box or not.
  • Removed a couple of SQL calls that became redundant.
  • Addressed a bug where if a user logged out of the dashboard, it only logged them out of VB.
  • Added Inline Comments capability. Comments posted to the forum (using VB for comments) will now appear at the bottom of a WP Post when viewing the post.
  • Author user names can now be linked to their VB profile page if desired.
  • Added option to turn off posting to forum. All this really does is remove the "Select Forum To Post To" option when writing a post. (There you go AxisOverdrive )
  • The $vbulletin object should now be available in all templates and most plugins.
  • Fixed a bug where deactivating any plugin would semi deactivate this plugin.
  • With the reduction in SQL calls, and the removal of now unnecessary variables, speed and memory use should be improved.
  • PLEASE READ THE UPGRADE INSTRUCTIONS IF UPGRADING!
07/17/2007
  • Fixed problem where upload iframe was a bit mangled.
  • Fixed problem where users had to refresh the dashboard once after logging in.
  • Fixed problem that arose from Wordpress 2.2.1 upgrade that would not allow activation.
  • Fixed logout issue where users would still be logged into Wordpress.
  • When a Wordpress post is deleted, so is the thread it created.
  • Added option to allow thread posted from Wordpress article to be truncated, with a linkback to the article.
  • Fixed issue when user re-activates plugin, and vb_threadid column already exists. Now checks for column first.
  • Removed a stray VB_Init() call.
  • Forums that do not allow threads will not be selectable in the drop down menu when writing a post.
  • Forums are listed out in a parent/child nested pattern.
  • (Note: 367 downloads of version 2.05)
11/29/07 - 3.00
  • Added TABLE_PREFIX throughout the script instead of the get_option('vbb_VBPRX') call. get_option('vbb_VBPRX') is now deprecated.
  • Addressed path issues by establishing $vwd first. If for some reason there are path issues on an install, the path only needs to be manually changed once, at the beginning of the script.
  • Removed call to admin_db.php which seems to no longer be necessary.
  • Changed all queries to the VB database to be handled by the $vbulletin object. This should facilitate multiple database configurations.
  • Added limited XMLRPC support.
  • Had to include a basic copy of the functions_wysiwyg.php file (functions_wysiwyg2.php) with a minor change in the sanitize_url function (now sanitize_vburl) as it conflicts with a new WP function of the same name. Otherwise, this is identical to the VB release. This was necessary to keep formatting somewhat uniform between the two.
  • Removed unnecessary globals.
  • Changed the global.php call so it always loads. $vbulletin should be available throughout the code (via global in functions).
  • Edited some code around wysiwyg functions of VB, and conversions to vbcode.
  • Added "Turn Plugin On" option.
  • Fixed an issue with the forum list on the "Write Post" page. Default forum was not being auto selected in some cases.
  • Modified from BETA so that the new functions_wysiwyg2.php file is loaded using the WP ABSPATH constant. Requires the plugin to stay in the plugins directory.
  • Fix an error message when a post was deleted in VB, then edited in WP.
12/10/07 - 3.01
  • Fixed two <? tags that should have been <?php (pointed out by Amenadiel)
03/31/08 - 3.02
  • Fixed media-upload clash for new version of Wordpress (2.5).
  • Added fix that will now delete threads in VB when the post is deleted in WP and not using Ajax delete.
  • Added code to insert a default email address if VB users email address is blank upon bridging.
04/20/08
  • Fixed a bug in user roles for the new version 2.5.1 of Wordpress.
05/08/2008
  • Fixed issue where CSS was munging scrolling text box when selecting a forum during a post
  • Fixed an issue where content encoding was getting screwey between WP and VP creating a lot of unintended characters (only on PHP installs where utf8_decode() exists (most)).
05/08/2008
  • Fixed issue where post count of a user did not change
Sites Using This Plug-In:(PM me if you want to add your site here)

Special Thanks:

axisoverdrive - Debugging Help, Kyraal - Paypal Donation, Kalina - Paypal Donation, Wildcard27 - Paypal Donation, Shri - Paypal Donation, pspcrazy - Paypal Donation, Tomahoochi - Paypal Donation.

If you use this plug-in, and find it useful, please support us by nominating us for Mod Of The Month (MOTM) in the top right corner of this thread, or feel free to donate.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #1252  
Old 11-09-2008, 04:08 AM
dailyyeah dailyyeah is offline
 
Join Date: Apr 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anyone successfully integrated the avatars from Vbulletin into the Comment section of wordpress? I would like to know how
Reply With Quote
  #1253  
Old 11-11-2008, 02:03 PM
XManuX XManuX is offline
 
Join Date: Feb 2007
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Avatars are not amongst the vBulletin data that vBridge collects.

In order to use them on your Wordpress pages, along with infos like User's Title or so, you need to modify the vBridge query that gets data from vBulletin replies.

Below is more a technical draft than a failsafe HowTo.

- Open vbbridge.php and look for the following query:
PHP Code:
$sql "select postid, username, userid, pagetext, title FROM " .  TABLE_PREFIX "post where threadid = '$results->vb_threadid' order by dateline"
This is the one that gets data about every vBulletin replies to your Wordpress article.

Replace it by:
PHP Code:
$sql "SELECT postid, p.username, p.userid, pagetext, p.title, u.avatarid, u.avatarrevision, a.avatarpath 
    FROM " 
TABLE_PREFIX "post AS p 
    LEFT JOIN " 
TABLE_PREFIX "user AS u ON u.userid = p.userid 
    LEFT JOIN " 
TABLE_PREFIX "avatar AS a ON a.avatarid = u.avatarid
    WHERE threadid = '
$results->vb_threadid' ORDER BY dateline"
As you can see, we are now getting much more data from vBulletin : the user's 'avatarid', 'avatarrevision', 'avatarpath' and even the user's title.

- Save your vbbridge.php.

- Now the quick and dirty part : there are probably vBulletin functions to handle avatars properly, since i haven't had a look at that yet, here is some bad way to handle most of the avatars.

- Open your theme php file where you already did some copy/paste with the vbbridge code to handle comments.

- Look for :
PHP Code:
<?php
foreach ($vbridge[replies] as $reply) {
?>
- Below, you may add this code :
PHP Code:
<?php 
if ($reply[avatarpath]) {
 echo 
"<img src="" get_option('vbb_VBURL') . "/" $reply[avatarpath] ."" alt="avatar" />";
} else {
 echo 
"<img src="" get_option('vbb_VBURL') . "/customavatars/avatar" $reply[userid] ."_" $reply[avatarrevision] . ".gif" alt="avatar" />";
}
?>
Keep in mind that it's an early version and that a more complete way of handling avatars should be achieved, especially when no avatars are selected.

For infos here is the part of code that i used a few years ago to handle avatars displaying in non-vb pages (not vbbridge related !)

PHP Code:
$query ="SELECT user.avatarid, user.avatarrevision AS avrevis, avatarpath, NOT ISNULL(filedata) AS hascustom, customavatar.dateline
    FROM user AS user
    LEFT JOIN avatar AS avatar ON avatar.avatarid = user.avatarid
    LEFT JOIN customavatar AS customavatar ON customavatar.userid = user.userid
    WHERE user.userid ="
$prof_uid;
$result requete($query);
$row mysql_fetch_array($result);

// on a renseign? le champ de chemin d'avatar
if (!empty($row['avatarpath']))
{
 
$prof_avatar "<img src="http://ladln.org/boards/{$row['avatarpath']}" alt="avatar" />";
}
// sinon on check si on a upload? un avatar custom
else if ($row['hascustom'])
{
    if (
strlen($row['hascustom'] > 10))
    {
        
$prof_avatar =  "<img src="http://ladln.org/boards/image.php?u=$prof_uid&amp;dateline=$row[dateline]" alt="avatar" />";
    } else {
        
$prof_avatar "<img src="http://ladln.org/boards/customavatars/avatar{$prof_uid}_{$row['avrevis']}.gif" alt="avatar" />";
    }
}
else if (
$row['avrevis']>0)
{
    
$prof_avatar "<img src="http://ladln.org/boards/customavatars/avatar{$prof_uid}_{$row['avrevis']}.gif" alt="avatar" />";
}
else
{
$prof_avatar "[N.A]";

Reply With Quote
  #1254  
Old 11-14-2008, 07:29 PM
nymyth nymyth is offline
 
Join Date: Jun 2002
Location: New York
Posts: 367
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by skubaman View Post
Nymyth, I don't see an integration on your home page. I am specifically looking for a way to have the latest news as well as latest forum posts on your home page.
Does it make sense?

Thanks
Not sure what you mean, it looks bridged to me. Starting a blog entry creates a forum thread, its just the posts dont go back and forth...is it supposed to and i messed something up?

Also, when you turn off the forum the blog has the vbulletin message show up without the style....any ideas?
Reply With Quote
  #1255  
Old 11-15-2008, 03:02 AM
wafriend wafriend is offline
 
Join Date: Oct 2006
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When I create my test post in Wordpress and publish it, I get the following error:

Quote:
Fatal error: Cannot redeclare class vB_DataManager in /home/xxxxxxxx/public_html/v3b/forums/includes/class_dm.php on line 21
xxxxxxxx = my username

Does anyone have any ideas what is causing this error?
Reply With Quote
  #1256  
Old 11-16-2008, 04:16 PM
cashaddy cashaddy is offline
 
Join Date: Nov 2008
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

good evening mates!!

i am pretty happy, that the bridge is working nearly perfectly with my setup!! (wordpress 2.6.3, vbulletin 3.7.4)

also i got handsome with some path problems and fixed them, really fast.

but still one error is occuring. a last damn error, and i don't know how to fix it! here the problem:

the bridge works mainly... (postings are integrated to the forum, i can edit and delete them...) but if i want to submit a new post there occurs always this error:

Warning: Cannot modify header information - headers already sent by (output started at path/wp-content/plugins/vbbridge.php:94) in path/wp-includes/pluggable.php (Line 770)

got any suggestions??

would be REALLY happy if anyone got already fixed this problem and could tell me a way to solve it.

in the meanwhile i will dig the code !
Reply With Quote
  #1257  
Old 11-17-2008, 12:20 PM
XManuX XManuX is offline
 
Join Date: Feb 2007
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

First i would suggest that you try this :

1°) Disable all your Wordpress plugins (except VbBridge of course !) and try again.
-> If it works, then try re-enabling your WP plugins one by one, testing again after each reactivated WordPress plugin.

2°) If it is still not working and provided you've installed some vbulletin add-ons, still keep your WP plugins disabled and now disable all your VB add-ons. And try again.
-> If it works. follow step 3
-> If it still doesn't work, you've run out of luck and you can reactivate everything and look into the code.

3°) Re-activate all of your WordPress plugins. And test again
-> If it works, your WP plugin are not causing the pbr, go to step 4.
-> If it doesn't work, go back to step 1

4°) Your Wordpress Plugins are not causing the error. Now try re-enable your vBulletin addons 1 by 1 and at each one reactivated, check if the error is back or not.
-> If it works, you're lucky ! turning everything OFF then ON again solved your pbr.
-> If it doesn't work. The last vBulletin add-on re-activated is likely the one you should check.
Reply With Quote
  #1258  
Old 11-19-2008, 02:36 PM
wafriend wafriend is offline
 
Join Date: Oct 2006
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've been trying to get this working for three days, I must have reinstalled everything at least five or six times, but I keep getting the same error message:

Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /home/x/public_html/v3b/wp-content/plugins/vbbridge.php on line 29
cannot include /home/x/public_html/v3b/wp-admin/global.php. You should check your path! Turning Plugin Off

where x is the name of my webhosting account.

I'm trying to get this running with a default installation of vBulletin. There are no plugins, nothing has been created, no forums, a straight out of the box installation and straight out of the box installation of Wordpress.

I perform the installation, go to the settings and then select vBridge Settings, I key the following values in for each field:

vb user id: 1
vb username: airtime
vb forum id: 2
forum url: http://y.com/v3b/forums
forum relative path: /forums
Database Prefix: vB_
Turn Plugin on: Yes
Turn Autointegrate on: No
Post articles to forum: Yes
Excerpt forum post: no

I click submit. I get the message options saved. I then Reading and get the above message.

Does anyone have any idea why I'm getting this message. The files are in the:
/v3b/wp-content/plugins directory and I'm not using a subdomain.

This is really beginning to baffle me. I'm sure I'm missing something small, I just don't know what.
Reply With Quote
  #1259  
Old 11-20-2008, 05:43 AM
wafriend wafriend is offline
 
Join Date: Oct 2006
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I finally figured it out, the relative path should be set to /v3b/forums/. I needed to add the trailing slash, something not mentioned in the documentation and not reflected in the example to the right of the field.

By the way, your documentation isn't current with version 2.6.3 of Wordpress. The settings menu is no longer "options" it is now settings. It is also "vbridge settings" and not "vbridge options"
Reply With Quote
  #1260  
Old 11-20-2008, 08:57 PM
dreamhost's Avatar
dreamhost dreamhost is offline
 
Join Date: Jun 2002
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have managed to get the bridge installed and working.

The only question I have is that I have noticed it works kind of strange when it comes to logging my users into the wordpress part.

scenario 1:
1. log into vb
2. goto wordpress
your not logged into wordpress

HOWEVER:
If I then click on the 'login' button on wordpress, it takes me to the vb homepage, which says I am logged in.
Then if I go back to the wordpress I am indeed logged in.

Only way for me to login to wordpress is if I follow the steps above exactly.

If I simply log into vb and then goto wordpress, I am not logged in.
I have to click the wp login button, and then return to wp to be logged in.

Is this how the author intended it?
kinda doubt it but as I have already mapped usergroups and tested posting, and logged in, it seems to work, just kinda strange.

great plugin btw THANK YOU!
Reply With Quote
  #1261  
Old 11-22-2008, 05:59 PM
tjpeople tjpeople is offline
 
Join Date: Jun 2008
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome hack.

Sorry if this is a stupid question but why does this bridge VB users into WordPress?

Why would you want to do this? It's great having the forum comments showing under the WP posts and the new WP getting posted to VB at the same time, but why does WP need to know about the users?

I've set mine up but not enabled user bridging, I don't like the idea of having two user databases, what do I loose in doing this?

For those who like valid sites, there are a few missing " " around URLs and incorrect & signs in URLs in the readme codes.

Jafo: You can add my site if you wish http://www.malcolminthemiddle.co.uk/
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:15 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.15736 seconds
  • Memory Usage 2,377KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (5)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete