vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Integration with vBulletin - Complete Wordpress/Vbulletin Bridge - Share Users And Postings (https://vborg.vbsupport.ru/showthread.php?t=134521)

dailyyeah 11-09-2008 04:08 AM

Has anyone successfully integrated the avatars from Vbulletin into the Comment section of wordpress? I would like to know how :D

XManuX 11-11-2008 02:03 PM

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]";



nymyth 11-14-2008 07:29 PM

Quote:

Originally Posted by skubaman (Post 1656260)
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?

wafriend 11-15-2008 03:02 AM

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?

cashaddy 11-16-2008 04:16 PM

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 :)!

XManuX 11-17-2008 12:20 PM

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.

wafriend 11-19-2008 02:36 PM

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.

wafriend 11-20-2008 05:43 AM

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"

dreamhost 11-20-2008 08:57 PM

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!

tjpeople 11-22-2008 05:59 PM

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/


All times are GMT. The time now is 01:25 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
  • Page Generation 0.01989 seconds
  • Memory Usage 1,797KB
  • 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
  • (5)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (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