Nice, I like the layout, as I replied on your site ;)
But the text in Home/About/News doesn't really fit with the design...as well as the replies...it just needs some styling like font and colour ;).
Suggestion: make a script that will generate a thumbnail when you upload a new comic, and display that thumbnail in the table...will be much faster to load and not as pixel as it is now.
PHP Code:
function resize($path)
{
list($width, $height, $type) = getimagesize($path);
$new_width = 100;
$new_height = 100;
$im = imagecreatetruecolor($new_width, $new_height);
$filename = "name-this-whatever-you-want";
switch ($type)
{
case 1:
{
$image = imagecreatefromgif($path);
imagecopyresampled($im, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagegif($im, $filename);
break;
}
case 2:
{
$image = imagecreatefromjpeg($path);
imagecopyresampled($im, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagejpeg($im, $filename, 100);
break;
}
case 3:
{
$image = imagecreatefrompng($path);
imagecopyresampled($im, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagepng($im, $filename);
break;
}
default:
{ return false; }
}
}
Might not be fully correct, but I just copy-pasted it and modified it here...
For the captcha, I use this:
PHP Code:
mysql_connect('localhost', [username], [password]) or exit('Error!');
mysql_select_db([database]) or exit('Error!');
$width = 160;
$height = 40;
$characters = 4;
$font_size = 12;
$im = imagecreate($width, $height);
$bg = imagecolorallocate($im, 0, 0, 0);
$character_array = array("A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
$i = 0;
while ($i<3)
{
imageline($im, rand(0, 8), rand(0, $height), ($width-rand(0, 8)), rand(0, $height), imagecolorallocate($im, rand(95, 159), rand(95, 159), rand(95, 159)));
$i++;
}
$total_string = "";
$i=0;
while ($i<$characters)
{
$string = $character_array[rand(0, (count($character_array)-1))];
$total_string .= $string;
$textcolor = imagecolorallocate($im, rand(127, 255), rand(127, 255), rand(127, 255));
imagestring($im, 5, rand((((($width)/$characters)*$i)+3), ((($width/$characters)*($i+1))-16)), rand(0, ($height-20)), $string, $textcolor);
$i++;
}
$insert = mysql_query("INSERT INTO verification VALUES ('', '".md5($total_string)."', '".$_SERVER['REMOTE_ADDR']."', '".time()."')") or exit('Error!');
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
Verification table looks like this:
Code:
CREATE TABLE `verification` (
`verify_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`code` CHAR(32) NOT NULL,
`ip_address` CHAR(32) NOT NULL,
`time` INT UNSIGNED NOT NULL,
PRIMARY KEY (`verify_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ;
Than for checking I use this:
PHP Code:
$code = false;
$_POST['code'] = strtoupper($_POST['code']);
if (empty($_POST['code']))
{
$error[] = 'You must fill in the <b>security code</b>.';
}
elseif (!ereg("^[A-Z]{5}$", $_POST['code']))
{
$error[] = 'The <b>security code</b> does not match the code shown in the image.';
}
else
{
mysql_query("DELETE FROM verification WHERE ip_address = '".$_SERVER['REMOTE_ADDR']."' OR time <= '".(time()-(60*60))."'");
$select = mysql_query("SELECT code FROM verification WHERE code = '".md5($_POST['code'])."' AND ip_address = '".$_SERVER['REMOTE_ADDR']."' AND time > '".(time()-(60*60))."' LIMIT 1", 'code');
if (!mysql_num_rows($select))
{
$error[] = 'The <b>security code</b> does not match the code shown in the image.';
}
else { $code = true; }
}
if ($code)
{
echo 'code was alright';
}
else
{
echo 'oops';
foreach($error as $single_error)
{
echo $single_error.'<br>';
}
}
Hope this helps a bit ;)