From 4dc13a3a92f711900a61335256f97f465a5067dd Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Tue, 30 Nov 2010 19:21:06 +1100 Subject: Fixed bug causing templates to fail after a chdir() --- test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test.php') diff --git a/test.php b/test.php index 06249c38..3e50443a 100644 --- a/test.php +++ b/test.php @@ -3,10 +3,10 @@ require 'inc/functions.php'; require 'inc/display.php'; - require 'inc/template.php'; if (file_exists('inc/instance-config.php')) { require 'inc/instance-config.php'; } + require 'inc/template.php'; require 'inc/config.php'; require 'inc/user.php'; -- cgit v1.3 From 1e3b6f9b69a91e291dd4809fcac9c2645e332acf Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Tue, 30 Nov 2010 20:54:05 +1100 Subject: Added a notice saying it hasn't 'been patched to work with multiple boards yet.' --- test.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test.php') diff --git a/test.php b/test.php index 3e50443a..cda60b0c 100644 --- a/test.php +++ b/test.php @@ -6,8 +6,8 @@ if (file_exists('inc/instance-config.php')) { require 'inc/instance-config.php'; } - require 'inc/template.php'; require 'inc/config.php'; + require 'inc/template.php'; require 'inc/user.php'; function image($type) { @@ -104,5 +104,7 @@ $body .= '

Everything seems okay.

'; } + $body .= '

Disregard me. I haven\'t been patched to work with multiple boards yet.

'; + die(Element('page.html', Array('index' => ROOT, 'title'=>'Tinyboard', 'subtitle'=>'Installation', 'body'=>$body))); ?> \ No newline at end of file -- cgit v1.3 From 9f9861ad204ec84721930fb3bd86a064765c51c3 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Wed, 1 Dec 2010 21:39:34 +1100 Subject: Fixed bug suppressing any output when mysql is not installed/enabled. --- test.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'test.php') diff --git a/test.php b/test.php index cda60b0c..55d97a00 100644 --- a/test.php +++ b/test.php @@ -43,19 +43,21 @@ // Database title('Database'); - if($sql = @mysql_connect(MY_SERVER, MY_USER, MY_PASSWORD)) { - $body .= check('Connection to server.', 'ok'); - if(@mysql_select_db(MY_DATABASE, $sql)) - $body .= check('Select database.', 'ok'); - else { - $body .= check('Select database.', 'error'); + if(extension_loaded('mysql')) { + if($sql = @mysql_connect(MY_SERVER, MY_USER, MY_PASSWORD)) { + $body .= check('Connection to server.', 'ok'); + if(@mysql_select_db(MY_DATABASE, $sql)) + $body .= check('Select database.', 'ok'); + else { + $body .= check('Select database.', 'error'); + $todo[] = 'instance-config.php: Check database configuration.'; + } + } else { + $body .= check('Connection to server.', 'error'); $todo[] = 'instance-config.php: Check database configuration.'; } - } else { - $body .= check('Connection to server.', 'error'); - $todo[] = 'instance-config.php: Check database configuration.'; } - + // Configuration title('Configuration'); $root = dirname($_SERVER['REQUEST_URI']) . (dirname($_SERVER['REQUEST_URI']) == '/' ? '' : '/'); -- cgit v1.3 From 473bc415b5308f37771fe936a95aad046d9fc8cc Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Fri, 17 Dec 2010 02:27:31 +1100 Subject: Moved images in text.php --- test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test.php') diff --git a/test.php b/test.php index 55d97a00..66b78b7e 100644 --- a/test.php +++ b/test.php @@ -11,7 +11,7 @@ require 'inc/user.php'; function image($type) { - return ""; + return ""; } function check($title, $test) { global $body, $count; -- cgit v1.3 From b57d600c368dafa267e137ec1570b044f7247b65 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Sat, 12 Feb 2011 16:16:24 +1100 Subject: deleted test.php --- test.php | 112 --------------------------------------------------------------- 1 file changed, 112 deletions(-) delete mode 100644 test.php (limited to 'test.php') diff --git a/test.php b/test.php deleted file mode 100644 index 66b78b7e..00000000 --- a/test.php +++ /dev/null @@ -1,112 +0,0 @@ -"; - } - function check($title, $test) { - global $body, $count; - $count[$test]++; - $body .= '' . $title . '' . image($test) . ''; - } - function title($text) { - global $body; - $body .= '' . $text . ''; - } - - $count = Array('ok'=>0, 'warning'=>0, 'error'=>0); - $todo = Array(); - $body = ''; - - $extensions = Array('mysql', 'gd'); - - // Extensions - title('Extensions'); - foreach($extensions as &$ext) { - if(extension_loaded($ext)) { - $body .= check($ext, 'ok'); - } else { - $body .= check($ext, 'error'); - $todo[] = 'Install module "' . $ext . '"'; - } - } - - // Database - title('Database'); - - if(extension_loaded('mysql')) { - if($sql = @mysql_connect(MY_SERVER, MY_USER, MY_PASSWORD)) { - $body .= check('Connection to server.', 'ok'); - if(@mysql_select_db(MY_DATABASE, $sql)) - $body .= check('Select database.', 'ok'); - else { - $body .= check('Select database.', 'error'); - $todo[] = 'instance-config.php: Check database configuration.'; - } - } else { - $body .= check('Connection to server.', 'error'); - $todo[] = 'instance-config.php: Check database configuration.'; - } - } - - // Configuration - title('Configuration'); - $root = dirname($_SERVER['REQUEST_URI']) . (dirname($_SERVER['REQUEST_URI']) == '/' ? '' : '/'); - if(ROOT != $root) { - $body .= check('Correct document root.', 'error'); - $todo[] = "instance-config.php: Change ROOT to '{$root}'"; - } else - $body .= check('Correct document root.', 'ok'); - - // Permissions - title('Permissions'); - - $directories = Array(DIR_IMG, DIR_THUMB, DIR_RES, '.'); - foreach($directories as $dir) { - if(file_exists($dir)) { - if(is_writable($dir) && is_readable($dir)) { - $body .= check($dir, 'ok'); - } else { - $body .= check($dir, 'error'); - $todo[] = 'CHMOD ' . $dir . ' to allow PHP to read and write.'; - } - } else { - $body .= check($dir, 'error'); - $todo[] = 'Create directory: ' . $dir; - } - } - - // Other - title('Other'); - if(get_magic_quotes_gpc()) { - $body .= check('magic_quotes_gpc', 'warning'); - $todo[] = 'Recommended: Disable magic_quotes_gpc in your PHP configuration.'; - } else - $body .= check('magic_quotes_gpc', 'ok'); - - $body .= '
'; - - if(!empty($todo)) { - $body .= '
';
-		foreach($todo as $do)
-			$body .= "{$do}\n";
-		$body .= '
'; - } - - if(!$count['error']) { - $body .= '

Everything seems okay.

'; - } - - $body .= '

Disregard me. I haven\'t been patched to work with multiple boards yet.

'; - - die(Element('page.html', Array('index' => ROOT, 'title'=>'Tinyboard', 'subtitle'=>'Installation', 'body'=>$body))); -?> \ No newline at end of file -- cgit v1.3