* @since 19/01/2005 * @version $Revision $ * * Copyright (C) 2004-2007 by ghcif.de * * 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 2 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /** * access check */ if(!defined('IN_GNP')) { die('access denied!'); } /** * error reporting */ error_reporting(E_ALL); /** * generation time */ $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $starttime = $mtime; /** * start caching */ ob_start(); /** * if install file exists the script will die */ if(file_exists('install.php')) { die('you have to install the script first!'); } /** * define session und sessionvars */ session_start(); if(!isset($_SESSION['name'])) { $_SESSION['name'] = ''; } if(!isset($_SESSION['tab_length'])) { $_SESSION['tab_length'] = ''; } if(!isset($_SESSION['code_lang'])) { $_SESSION['code_lang'] = ''; } if(!isset($_SESSION['description'])) { $_SESSION['description'] = ''; } if(!isset($_SESSION['code'])) { $_SESSION['code'] = ''; } /** * includes */ require_once(GNP_REAL_PATH . 'config.php'); /** * connect to db */ mysql_connect($dbhost, $dbuser, $dbpasswd) OR die(mysql_error()); mysql_select_db($dbdatabase) OR die(mysql_error()); /** * read config */ $sql = 'SELECT * FROM '.$tbl_prefix.'config;'; $query = mysql_query($sql) OR die(mysql_error()); while($row = mysql_fetch_assoc($query)) { $config[$row['config_name']] = $row['config_value']; } /** * load language file */ if(file_exists(GNP_REAL_PATH . 'languages/'.$config['lang'].'_main.php')) { include(GNP_REAL_PATH . 'languages/'.$config['lang'].'_main.php'); } else { include(GNP_REAL_PATH . 'languages/en_main.php'); } header('Content-Type: text/html; charset=' . $lang['charset']); /** * supported languages array */ $language = array("Plain Text", "C89", "C", "C++", "PHP", "Perl", "Java", "VB", "C#", "Ruby", "Python", "Pascal", "mIRC", "PL/I", "SQL", "XML", "Scheme"); sort($language); /** * select optionen for the supported languages */ $lang_option = ''; foreach($language as $optlang) { $lang_option .= '