Info In Wordpress?

Discussion in 'vBulletin Discussions' started by OneUpDave, Oct 22, 2009.

  1. OneUpDave

    OneUpDave Guest

    I need to know how to include and pull info from vB (like member name, categories, etc) into my Wordpress. I'm assuming I need to require_once global.php, but I don't seem to be doing something correctly. This is what I'm using now:

    PHP:
    <?php 
    chdir
    ("/home/USER/public_html/forum"); 
    require(
    '/home/USER/public_html/forum/global.php');
    chdir("./");
    ?>
     
  2. Wayne Luke

    Wayne Luke Regular Member

    Joined:
    Apr 2, 2009
    Messages:
    991
    Likes Received:
    276
    Re: Info In Wordpress? (Do Not Move)

    What was your expect result and what is your actual result? The code above doesn't really have any output. That is, global.php doesn't create any output for the screen.
     
  3. twhiting9275

    twhiting9275 Regular Member

    Joined:
    Aug 19, 2009
    Messages:
    372
    Likes Received:
    8
    Re: Info In Wordpress? (Do Not Move)

    Without a bit more information, it's not possible to help much. Here's a couple things that could be going wrong though.

    Firstly, make sure you initialize variables, which could be why you're not seeing the expected output.

    Secondly, make sure the file is correct. You shouldn't have to use chdir or anything else, but using require , include (or require_once, include_once) should be enough to at least get you started.
     
  4. GTB

    GTB Regular Member

    Joined:
    Jun 30, 2009
    Messages:
    1,791
    Likes Received:
    270
    Re: Info In Wordpress? (Do Not Move)

    One easy way to pull the "Latest Threads" list into your WordPress Sidebar, is to use the RSS Feed option in WordPress and import them from your forum.
     
  5. OneUpDave

    OneUpDave Guest

    Re: Info In Wordpress? (Do Not Move)

    Sorry for the vagueness, I was ready to hit the sack when I wrote that. When I tried to include the global.php, it spits out the following error on any WP page:

    I'm not a coder, so this "initialize variables" is greek to me. But one of the things I'm looking to do is display the username (if logged in) and to output a list of the main-level forum categories.
     
  6. twhiting9275

    twhiting9275 Regular Member

    Joined:
    Aug 19, 2009
    Messages:
    372
    Likes Received:
    8
    Re: Info In Wordpress? (Do Not Move)

    Not sure about the first error, but the second one speaks for itself.

    You're trying to use $db->query_first_slave without actually initializing $db first

    My guess is that the first error is trying to pull a fetch_array statement and it's complaining because it's not an array.

    Make sure that whatever instructions you have followed are followed perfectly, and that any includes come before anything
     
  7. OneUpDave

    OneUpDave Guest

    Re: Info In Wordpress? (Do Not Move)

    There are no instructions, per se. I'm trying to piece together some code I'm finding on Google to do this. And please explain "initializing" for me. I'm not really a PHP coder. Or much of a coder at all.
     
  8. OneUpDave

    OneUpDave Guest

    Re: Info In Wordpress? (Do Not Move)

    Ok, so I removed the "require" code from the WP template's header.php file and added it to wp-config.php, which I read about on another forum. I also changed the code I inserted to this:
    PHP:
    define('CWD''/home/{USER}/public_html/forum'); 
    define('VB_AREA''Forum');
    require_once(
    './forum/includes/init.php');
    require_once(
    './forum/global.php');
    And now I get the following error(s) when I visit the site:
     
  9. David

    David Regular Member

    Joined:
    May 30, 2003
    Messages:
    1,088
    Likes Received:
    133
    Location:
    Australia
    Re: Info In Wordpress? (Do Not Move)

    I've never been able to get past the header already sent error on wordpress so I can't help you much.
     
  10. OneUpDave

    OneUpDave Guest

    Re: Info In Wordpress? (Do Not Move)

    I just did, now I need to know how to show a variable output (like the "$bbuserinfo[username]"). If it's successful, I'll share my findings here.
     
  11. Peggy

    Peggy Regular Member

    Joined:
    May 18, 2009
    Messages:
    1,641
    Likes Received:
    58
    Re: Info In Wordpress? (Do Not Move)

    That's what I do.
     
  12. OneUpDave

    OneUpDave Guest

    Re: Info In Wordpress? (Do Not Move)

    I'm not pulling the latest threads, though. I'm trying to display the username/login box, and show a list of the forum categories in a sub-menu. Now if there's a plugin for that, lead me to it, because this is giving me headaches.
     
  13. 2dub

    2dub Regular Member

    Joined:
    Jun 19, 2009
    Messages:
    157
    Likes Received:
    26
    Location:
    Moyock, NC
    I would love to see a good WB-VB integration tool.
     
  14. OneUpDave

    OneUpDave Guest

    There are actually some plugins where you can sync users or use vB as a comment system, but none of them are the type that I need. I agree with you, though. With both being very popular scripts, that would be a killer bridge.
     
  15. OneUpDave

    OneUpDave Guest

    So, does no one here know how to do this "initialization", or are we just not gonna help the newbie?
     

Share This Page