* @version 3.0.0 * @copyright Copyright (c) 2009 Cracker Tracker Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ if (!function_exists('implode_r')) { // Implode recursive a multi-dimension array, taken from www.php.net function implode_r ($glue, $array, $array_name = NULL) { $return = array(); while(list($key,$value) = @each($array)) { if(is_array($value)) { // Is an array again, so call recursive $return[] = implode_r($glue, $value, (string) $key); } else { if($array_name != NULL) { $return[] = $array_name . '[' . (string) $key . ']=' . $value . "\n"; } else { $return[] = $key . '=' . $value."\n"; } } } // END - while // Return resulting array return(implode($glue, $return)); } // END - function } // END - if if (!function_exists('implode_secure')) { // Implode a simple array with a 'call-back' to our escaper function function implode_secure ($array) { // Return string $return = ''; // Implode all data foreach ($array as $entry) { // Don't escape some if (in_array($entry, array('NOW()'))) { // Add it with non-string glue $return .= $entry . ','; } elseif (empty($entry)) { // Empty strings need no escaping $return .= '"",'; } else { // Secure this string and add it $return .= '"' . crackerTrackerEscapeString($entry) . '",'; } } // END - foreach // Remove last char $return = substr($return, 0, -1); // Return this string return $return; } // END - function } // END - if // Getter for ctracker_debug function isCrackerTrackerDebug () { // Is it set? return ((isset($GLOBALS['ctracker_debug'])) && ($GLOBALS['ctracker_debug'] === true)); } // [EOF] ?>