• Using WP 2.0.4 and just in case someone needs it, using vanilla 1.0.1. I run this server and have full control of it.
    OK, i am trying to integrate my Vanilla forum into my existing WP theme. so, i put require (‘../wp-blog-header.php’); in the forum head.php file, between the < head > tags. When i do this, i get this error:
    Fatal error: Call to a member function on a non-object in /srv/www/htdocs/wp-includes/cache.php on line 206
    How do i correct this error? Or am i doing something wrong in the theme integration process?
    This is line 206 of cache.php in wp-includes:
    $wpdb->hide_errors();
    Line 205 is this:
    if (‘options’ == $group) {
    and line 207 is this:
    if (!$options = $wpdb->get_results(“SELECT option_name, option_value FROM $wpdb->options WHERE autoload = ‘yes'”)) {

Viewing 4 replies - 1 through 4 (of 4 total)
  • if you’re simply trying to adapt or port your WP theme to a vanilla forum theme, you shouldn’t need to be playing with the php. if you’re trying to integrate the two (like single sign on for users, etc) that’s an entirely different matter. i’d suggest simply installing vanilla in a /forums or /support folder, using separate logons for each system, then creating a vanilla theme to match your WP theme.

    …c

    Thread Starter carnold

    (@carnold)

    If you goto https://www.mytimewithgod.net/xdforum you will see exactly how i want the vanilla forum to integrate. It appears in the “content” area with both sidebars and header and footer. For this, you have to tell vanilla to load the sidebars and header and footer so you have to mess with the php. To do that, you need < ? php require(‘../wp-blog-header.php’); ? > in the head.php file between the < head > tags and when i do this, i get the above error. So, my question is where does the < ? php require(‘../wp-blog-header.php’); ? > go? Does it go between the < head > tags?

    that site is using the xdforum plugin for wordpress :
    https://www.xdweb.net/index.php?page=12

    what you’re trying to do (load the WP header and sidebar) requires loading WP core, that’s why you’re getting the fatal errors, unknown functions, etc. you can’t just ‘include’ the header.php and sidebar.php from wordpress (because they’re loaded and use functions from WP core) from another application.

    I’m somewhat familiar with the vanilla forum system, and as I mentioned the easiest thing to do would be to build a “theme” for vanilla which matches your WP theme (this would include creating appopriate headers/sidebar within vanilla)

    if you’re not married to the idea of using the vanilla forums, you could also consider using xdforum (the plugin link above) or bbpress (which runs the wordpress support forums), your integration task would be easier with either of those. I don’t believe there’s a plugin or ‘bridge’ to integrate vanilla and WP as yet.

    …c

    Thread Starter carnold

    (@carnold)

    Yes, i am using the xdforum plugin now and want to use vanilla forum instead. So i am aware where to get the plugin and how to use the xdforum plugin. What i am asking is where in this file:
    < ? php
    // Note: This file is included from the library/Framework/Framework.Control.Head.php class.

    $HeadString = ‘<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”&gt;
    <html xmlns=”https://www.w3.org/1999/xhtml&#8221; xml:lang=”‘.$this->Context->GetDefinition(‘XMLLang’).'”>
    <head>
    <title>’.$this->Context->Configuration[‘APPLICATION_TITLE’].’ – ‘.$this->Context->PageTitle.'</title>
    <link rel=”shortcut icon” href=”‘.$this->Context->StyleUrl.’favicon.ico” />’;
    if (is_array($this->StyleSheets)) {
    while (list($Key, $StyleSheet) = each($this->StyleSheets)) {
    $HeadString .= ‘
    <link rel=”stylesheet” type=”text/css” href=”‘.$StyleSheet[‘Sheet’].'”‘.($StyleSheet[‘Media’] == ”?”:’ media=”‘.$StyleSheet[‘Media’].'”‘).’ />’;
    }
    }
    if (is_array($this->Scripts)) {
    $ScriptCount = count($this->Scripts);
    $i = 0;
    for ($i = 0; $i < $ScriptCount; $i++) {
    $HeadString .= ‘
    <script type=”text/javascript” src=”‘.$this->Scripts[$i].'”></script>’;
    }
    }

    if (is_array($this->Strings)) {
    $StringCount = count($this->Strings);
    $i = 0;
    for ($i = 0; $i < $StringCount; $i++) {
    $HeadString .= $this->Strings[$i];
    }
    }
    $BodyId = “”;
    if ($this->BodyId != “”) $BodyId = ‘ id=”‘.$this->BodyId.'”‘;
    echo $HeadString . ‘</head>
    <body’.$BodyId.’ ‘.$this->Context->BodyAttributes.’>’;
    ? >

    do i put < ? php require(‘../wp-blog-header.php’); ? > ?? I have tried everywhere and with the full < ? php require(‘wp-blog-header.php’); ? > outside of the beginning <?php and ending ?>, i get this error:
    Fatal error: Call to a member function on a non-object in /srv/www/htdocs/wp-includes/cache.php on line 206
    With just require(‘../wp-blog-header.php’); inside of the begining < ? php and the ending ?>, i get this error:
    Parse error: parse error in /srv/www/htdocs/forum/themes/head.php on line 9
    with some of the forum page that shows-up. See this last example in action at https://www.mytimewithgod.net/forum and see what i am trying to achieve here https://www.mytimewithgod.net/xdforum

    I also know by adding ../wp-blog-header.php to files outside of WP, it IS possible to “integrate” those files outside of WP to your existing theme. I have done it many times (see here https://www.mytimewithgod.net/bible (and click on Genesis books 1-10) and here https://www.myitmewithgod.net/forum/people.php (this is the sign-on page for the vanilla forum))

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Fatal error’ is closed to new replies.