Interface not working #266


  • New
  • Defect
Open
Assigned to _ForgeUser7076494
  • _ForgeUser7520617 created this issue Mar 28, 2012

    What is the problem?

    The web interface throws a problem, attempting too search with it appears too load, but never returns results

    What steps will reproduce the problem?
    1. Install/configure HawkEye and the Web Interface
    2. Log in to the game and do a few things, break blocks, chat, run commands
    3. Log into the interface and try and search your username

    What version of HawkEye are you using (shown in console during start-up)?

    HawkEye 1.0.7b/web interface 1.0.7c

    Show me any console errors and/or your start-up console message for HawkEye

    (From the Web Interface)

    ( ! ) Notice: Undefined variable: isAuth in C:\wamp\www\hawkeye\index.php on line 62
    Call Stack
    #    Time    Memory    Function    Location
    1    0.0012    428824    {main}( )    ..\index.php:0

    Show me your config.yml and/or your config.php (REMOVE YOUR PASSWORD)

    <?php
        ///////////////////////////////////////////////////
        //         HawkEye Interface Config File         //
        //                 by oliverw92                  //
        ///////////////////////////////////////////////////
        //     Edit the config array below with your     //
        //     details. Make sure all strings are        //
        //     escaped. If you can't work this out,      //
        //     ask in the thread on bukkit.org.          //
        ///////////////////////////////////////////////////
        $hawkConfig = array(
                        //Enter your MySQL database information
                        //Do not change 'dbTable'
                        "dbHost"  => "localhost:3306",
                        "dbDbase" => "[Redacted]",
                        "dbUser"  => "[Redacted]",
                        "dbPass"  => "[Redacted]",
                        "dbTable" => "hawkeye",
                        "dbPlayerTable" => "hawk_players",
                        "dbWorldTable" => "hawk_worlds",

                        //Set this to the password you want people to have to use to access the interface
                        //Leave blank for no password
                        "password" => "[Redacted]",

                        //Default radius to search for if user supplies a location
                        "radius" => 30,

                        //Limit the maximum number of results that can be returned. Do not use quotes
                        //Set to 0 for no limit
                        "maxResults" => 0,

                        //Language pack - default is english.php
                        //You can create your own based off the english.php file,
                        //then change the name below to your language file name
                        "langFile" => "english.php",

                        //Log queries to log.txt
                        //Useful to keep track of who is querying what
                        "logQueries" => true,

                        //Use forum for authentication?
                        //Default is false
                        "forumAuth" => false,

                        //The relative location for the forum to this file.
                        //Default is "../forum/"
                        "forumDir" => "../forum/",

                        //The type of forum that will be used.
                        //Default is phpbb3
                        //Available types are: phpbb3 and smf
                        "forumType" => "phpbb3"

                        );

        //The user wants to use forumAuth
        if ($hawkConfig["forumAuth"])
        {
            //We need to require the specified forumType.  Hopefully we support it (Or the user is using their own file)
            require('./forumAuth/'.$hawkConfig['forumType'].'.php');
        }

        $con = mysql_connect($hawkConfig["dbHost"], $hawkConfig["dbUser"], $hawkConfig["dbPass"]);
        if (!$con)
            return error("Could not connect to MySQL Database!");
        if (!mysql_select_db($hawkConfig["dbDbase"], $con))
            return error(mysql_error());

        mysql_query("SET NAMES UTF8");

        function handleError($errno, $errstr, $errfile, $errline, array $errcontext) {
            // error was suppressed with the @-operator
            if (0 === error_reporting()) return false;
            throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
        }

    ?>

    Have you checked the FAQ page?

    Yes.

  • _ForgeUser7520617 added the tags New Defect Mar 28, 2012
  • baffler posted a comment Jun 25, 2012

    I was having the same issue. I tracked it down though, and had to fix 2 things in interface.php file.

    On line 139 you'll see:

    foreach($items as $i) {
    		$item = explode(",", $i);
    		$itemhash[intval($item[0])] = $item[1];
    	}
    

    replace it with

    foreach($items as $i) {
    		$item = explode(",", $i);
    		if (count($item) > 1)
    			$itemhash[intval($item[0])] = $item[1];
    	}
    

    The other one is on line 219, you'll see:

    function getBlockName($string) {
    		global $items, $itemhash;
    
    		$parts = explode(":", $string);
    		$i = $itemhash[$parts[0]];
    		if($i) {
    			if (count($parts) == 2)
    				return $i . ":" . $parts[1];
    			else
    				return $i;
    		}
    		return $string;
    	}
    

    Replace it with

    function getBlockName($string) {
    		global $items, $itemhash;
    
    		$parts = explode(":", $string);
    		$key1 = $parts[0];
    		if (array_key_exists($key1, $itemhash))
    		{
    			$i = $itemhash[$key1];
    			if($i) {
    				if (count($parts) == 2)
    					return $i . ":" . $parts[1];
    				else
    					return $i;
    			}
    		}
    		return $string;
    	}
    

To post a comment, please login or register a new account.