1

(11 replies, posted in PunBB 1.3 troubleshooting)

But can you tell me what the search functions do when they return no results? As that's the only time it errors out.

2

(11 replies, posted in PunBB 1.3 troubleshooting)

Do the devs of this forum software ever read the forums?

3

(11 replies, posted in PunBB 1.3 troubleshooting)

I have found out that whenever a search parameter finds nothing is when i get the error. So if i search for something I know exists in the forums everything is fine, if there are no results it gives;

Fatal error: Call to a member function on a non-object in /****/session.php on line 91

Does this make any sense? Where can I find what each search function does when it returns null?

This didn't seem to change anything as the search results page as well as the "Active topics" and "Unanswered topics" are still using main.tpl. Only the initial state of the search page seems to use search.tpl...

Is there something I am missing?

Do you already have the code to create an entry in a mysql db?

Yes they are in main.tpl and includes/functions.php

Thanks for your help!

Any idea why when I submit a search it is still pulling includes that the main.tpl uses?

edit;

The "search.php?action=" pages seem to still be using main.tpl - any idea why?

Is it Possible to use a seperate main.tpl template for search.php?

9

(11 replies, posted in PunBB 1.3 troubleshooting)

Think I figured out what is happening, but I am not sure how to fix it...

Seems that when search calls anything from search_functions.php it's not calling my php includes from include/user. Have a file called session.php which contains;

<?
include("../include/session.php");
if(!$session->logged_in){
header("Location: ../index.php");
}

?>

If I remove include/user/session.php and just put "include("../include/session.php");" at the top of search.php it works fine...

Anyone have any ideas?

10

(11 replies, posted in PunBB 1.3 troubleshooting)

Anyone that knows the punbb variables a little able to look at what might be conflicting?

11

(11 replies, posted in PunBB 1.3 troubleshooting)

Ok yeah I was afraid you were referring to that post... That is the first thing I saw when I  Googled my error.

It wasn't any help...

That section of code works fine on every other page of the site so I was thinking it may be conflicting variables or something?

12

(11 replies, posted in PunBB 1.3 troubleshooting)

Utchin wrote:

I dont know how to fix this but looking around:

Your constructor forsomeclassis not setting thesomeobjectmember variable correctly, so it remains a null reference, which causes the error.

I am not sure where to go form here, will you please elaborate?

13

(11 replies, posted in PunBB 1.3 troubleshooting)

I edited my first port to include the beginning of the function starting at like 79, does this help at all?

14

(11 replies, posted in PunBB 1.3 troubleshooting)

I have PunBB integrated into a website that has a login system.

Whenever I hit submit on the forum search I recieve;


Fatal error: Call to a member function on a non-object in /****/session.php on line 91

Session.php is part of the websites login - here are lines 79 though 110 of session.php.

   function checkLogin(){
      global $database;  //The database connection
      /* Check if user has been remembered */
      if(isset($_COOKIE['cookname']) && isset($_COOKIE['cookid'])){
         $this->username = $_SESSION['username'] = $_COOKIE['cookname'];
         $this->userid   = $_SESSION['userid']   = $_COOKIE['cookid'];
      }

      if(isset($_SESSION['username']) && isset($_SESSION['userid']) &&
         $_SESSION['username'] != GUEST_NAME){
         /* Confirm that username and userid are valid */
91         if($database->confirmUserID($_SESSION['username'], $_SESSION['userid']) != 0){
            /* Variables are incorrect, user not logged in */
            unset($_SESSION['username']);
            unset($_SESSION['userid']);
            return false;
         }

         /* User is logged in, set class variables */
         $this->userinfo  = $database->getUserInfo($_SESSION['username']);
         $this->username  = $this->userinfo['username'];
         $this->userid    = $this->userinfo['userid'];
         $this->userlevel = $this->userinfo['userlevel'];
         $this->company = $this->company['company'];
         return true;
      }
      /* User not logged in */
      else{
         return false;
      }
   }

Line 91 is pulling this from another file;

   function confirmUserID($username, $userid){
      /* Add slashes if necessary (for query) */
      if(!get_magic_quotes_gpc()) {
          $username = addslashes($username);
      }

      /* Verify that user is in database */
      $q = "SELECT userid FROM ".TBL_USERS." WHERE username = '$username'";
      $result = mysql_query($q, $this->connection);
      if(!$result || (mysql_numrows($result) < 1)){
         return 1; //Indicates username failure
      }

      /* Retrieve userid from result, strip slashes */
      $dbarray = mysql_fetch_array($result);
      $dbarray['userid'] = stripslashes($dbarray['userid']);
      $userid = stripslashes($userid);

      /* Validate that userid is correct */
      if($userid == $dbarray['userid']){
         return 0; //Success! Username and userid confirmed
      }
      else{
         return 2; //Indicates userid invalid
      }
   }

Anyone have any idea where the conflict could be?:/