dartharnold / mining-buddy-plus

Automatically exported from code.google.com/p/mining-buddy-plus
3 stars 0 forks source link

Syntax error in graphics class #37

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Not sure what caused this issue, but I can't seem to get around it. Can't 
figure out what's wrong with it if anything. 

Here is the error message

PHP Parse error: syntax error, unexpected ']', expecting T_STRING or T_VARIABLE 
or T_NUM_STRING in 
D:\Domains\v-ventures-eve.com\wwwroot\mb\classes\graphic_class.php on line 295 

Here's the code.

      /* Converts html color code into hex */
        private function convert($html) {
                // Split the chunk up.
                $splitted = explode(".", chunk_split($html, 2, "."));

                // Convert each color
                foreach ($splitted as $split) {
                        $converted[] = base_convert($split, 16, 10);
                }

                // Return converted colors
                return ($converted);
        }

        /* Checks wether the image is already in the database */
        private function checkCache($text) {
                // We need access to the database.
                //              return (false);
                global $DB;

                // Base64 encode the image text.
                $text = base64_encode($text);

                // Get the ID.
                $count = $DB->getCol("SELECT id FROM images WHERE text='$text' " .
                "AND type='" . $this->type . "' " .
                "AND textColor='" . $this->rawColor . "' " .
                "AND bgColor='" . $this->rawBGColor . "' " .
                "AND width='" . $this->width . "' " .
                "AND height='" . $this->height . "'");

                // Return the id.
                return ($count[0]);
        }

}

Original issue reported on code.google.com by Ddrai...@gmail.com on 24 Mar 2013 at 7:55