importDataByArray(strip($_POST)); // validate user entry if(count($errors = $setup->validate()) == 0) { define("JLOG_BASEPATH", $setup->getValue('jlog_basepath')); if(is_writable(JLOG_BASEPATH.'personal'.DIRECTORY_SEPARATOR)) { $c .= "
".$l['admin']['s_ready']."
"; } else { // validate PHP and MySQL versions if(!version_compare(phpversion(), JLOG_PHPV, ">=") == 1) $errors[] = $l['admin']['s_phpv_tolow']; if(!is_writable($basepath.'personal'.DIRECTORY_SEPARATOR)) $errors[] = $l['admin']['s_personal_not_wrtbl']; if(!is_writable($basepath.'img'.DIRECTORY_SEPARATOR)) $errors[] = $l['admin']['s_img_not_wrtbl']; if(empty($errors)) { // output form $setup->importSuggestedData(); $c .= $setup->form_output(); } else $c .= error_output($errors); } echo do_htmlpage($c); #### some needed functions for the setup #### function create_mysql_tables($data) { # returns false if all tables were created, if not returns the $errors array $sql['content'] = ' CREATE TABLE `'.$data['jlog_db_prefix'].'content` ( id int(11) auto_increment, url varchar(200), topic varchar(255), date datetime, teaser mediumtext, teaserpic varchar(10), teaserpiconblog tinyint(1), keywords varchar(255), content longtext, comments tinyint(1) default \'1\', allowpingback tinyint(1) default \'1\', section varchar(10) default \'weblog\', UNIQUE KEY id (id), FULLTEXT KEY content_index (content, topic, teaser, keywords) ) TYPE=MyISAM CHARACTER SET utf8;'; $sql['comments'] = ' CREATE TABLE `'.$data["jlog_db_prefix"].'comments` ( id int(11) auto_increment, sid varchar(35), name varchar(255), city varchar(255), email varchar(255), homepage varchar(255), content mediumtext, date datetime, reference int(11), mail_by_comment tinyint(1), type varchar(30) default \'\', PRIMARY KEY (id), UNIQUE KEY sid (sid), FULLTEXT KEY comments_index ( name, city, email, homepage, content ) ) TYPE=MyISAM CHARACTER SET utf8;'; $sql['categories'] = ' CREATE TABLE `'.$data["jlog_db_prefix"].'categories` ( id tinyint(4) auto_increment, name tinytext, url varchar(100), description text, UNIQUE KEY id (id), UNIQUE KEY url (url) ) TYPE=MyISAM CHARACTER SET utf8;'; $sql['catassign'] = ' CREATE TABLE `'.$data["jlog_db_prefix"].'catassign` ( content_id int(11), cat_id tinyint(4) ) TYPE=MyISAM CHARACTER SET utf8;'; $sql['attributes'] = ' CREATE TABLE `'.$data["jlog_db_prefix"].'attributes` ( id int(10) unsigned NOT NULL auto_increment, entry_id int(10) unsigned NOT NULL default \'0\', name varchar(120) NOT NULL default \'\', value varchar(250) NOT NULL default \'\', PRIMARY KEY (id), KEY entry_id (entry_id) ) TYPE=MyISAM CHARACTER SET utf8;'; global $l; if(!@mysql_connect($data['jlog_db_url'], $data['jlog_db_user'], $data['jlog_db_pwd'])) $errors[] = "Falsche Zugangsdaten | ".mysql_error(); elseif(!@mysql_select_db($data['jlog_db'])) $errors[] = "Datenbank ".$data['jlog_db']." extistiert nicht".mysql_error(); elseif(!version_compare(mysql_get_server_info(), JLOG_MYSQLV, ">=") == 1) $errors[] = $l['admin']['s_mysqlv_tolow']; else { new Query("SET NAMES utf8"); $create['content'] = new Query($sql['content']); if($create['content']->error()) $errors[] = "MySQL".$create['content']->getError().""; $create['comments'] = new Query($sql['comments']); if($create['comments']->error()) $errors[] = "MySQL
".$create['comments']->getError().""; $create['categories'] = new Query($sql['categories']); if($create['categories']->error()) $errors[] = "MySQL
".$create['categories']->getError().""; $create['catassign'] = new Query($sql['catassign']); if($create['catassign']->error()) $errors[] = "MySQL
".$create['catassign']->getError().""; $create['attributes'] = new Query($sql['attributes']); if($create['attributes']->error()) $errors[] = "MySQL
".$create['attributes']->getError().""; } return $errors; } function do_personal() { # returns true if all files and dirs could be generated # if not returns the $errors array global $l; // make some dirs $oldmask = umask(0); // make some files if(!fopen(JLOG_BASEPATH."personal".DIRECTORY_SEPARATOR."settings.inc.php", "w")) $errors[] = $l['admin']['s_problem_fwrite']." /personal/settings.inc.php"; if(!fopen(JLOG_BASEPATH."personal".DIRECTORY_SEPARATOR."rss.xml", "w")) $errors[] = $l['admin']['s_problem_fwrite']." /personal/rss.xml"; if(!fopen(JLOG_BASEPATH."personal".DIRECTORY_SEPARATOR."rss-full.xml", "w")) $errors[] = $l['admin']['s_problem_fwrite']." /personal/rss-full.xml"; if(!fopen(JLOG_BASEPATH."personal".DIRECTORY_SEPARATOR."subcurrent.inc", "w")) $errors[] = $l['admin']['s_problem_fwrite']." /personal/subcurrent.inc"; // chmod 666 so that the user have the ability to delete/write to this files if(!chmod(JLOG_BASEPATH."personal".DIRECTORY_SEPARATOR."settings.inc.php", 0666)) $errors[] = $l['admin']['s_problem_chmod']." /personal/settings.inc.php"; if(!chmod(JLOG_BASEPATH."personal".DIRECTORY_SEPARATOR."rss.xml", 0666)) $errors[] = $l['admin']['s_problem_chmod']." /personal/rss.xml"; if(!chmod(JLOG_BASEPATH."personal".DIRECTORY_SEPARATOR."rss-full.xml", 0666)) $errors[] = $l['admin']['s_problem_chmod']." /personal/rss-full.xml"; if(!chmod(JLOG_BASEPATH."personal".DIRECTORY_SEPARATOR."subcurrent.inc", 0666)) $errors[] = $l['admin']['s_problem_chmod']." /personal/subcurrent.inc"; umask($oldmask); return $errors; } function do_htmlpage($content) { return '