if ( ! function_exists('create_square_thumb')) { function create_square_thumb($img,$dest) { $seg = explode('.',$img); $thumbType = 'jpg'; $thumbSize = 300; $thumbPath = $dest; $thumbQuality = 100; $last_index = count($seg); $last_index--; if($seg[$last_index]=='jpg' || $seg[$last_index]=='JPG' || $seg[$last_index]=='jpeg') { if (!$full = imagecreatefromjpeg($img)) { return 'error'; } } else if($seg[$last_index]=='png') { if (!$full = imagecreatefrompng($img)) { return 'error'; } } else if($seg[$last_index]=='gif') { if (!$full = imagecreatefromgif($img)) { return 'error'; } } $width = imagesx($full); $height = imagesy($full); /* work out the smaller version, setting the shortest side to the size of the thumb, constraining height/wight */ if ($height > $width) { $divisor = $width / $thumbSize; } else { $divisor = $height / $thumbSize; } $resizedWidth = ceil($width / $divisor); $resizedHeight = ceil($height / $divisor); /* work out center point */ $thumbx = floor(($resizedWidth - $thumbSize) / 2); $thumby = floor(($resizedHeight - $thumbSize) / 2); /* create the small smaller version, then crop it centrally to create the thumbnail */ $resized = imagecreatetruecolor($resizedWidth, $resizedHeight); $thumb = imagecreatetruecolor($thumbSize, $thumbSize); imagealphablending( $resized, false ); imagesavealpha( $resized, true ); imagealphablending( $thumb, false ); imagesavealpha( $thumb, true ); imagecopyresized($resized, $full, 0, 0, 0, 0, $resizedWidth, $resizedHeight, $width, $height); imagecopyresized($thumb, $resized, 0, 0, $thumbx, $thumby, $thumbSize, $thumbSize, $thumbSize, $thumbSize); $name = name_from_url($img); imagejpeg($thumb, $thumbPath.str_replace('_large.jpg', '_thumb.jpg', $name), $thumbQuality); } }
if ( ! function_exists('create_rectangle_thumb')) { function create_rectangle_thumb($img,$dest) { $seg = explode('.',$img); $thumbType = 'jpg'; $thumbSize = 300; $thumbWidth = 300; $thumbHeight = 226; $thumbPath = $dest; $thumbQuality = 100; $last_index = count($seg); $last_index--; if($seg[$last_index]=='jpg' || $seg[$last_index]=='JPG' || $seg[$last_index]=='jpeg') { if (!$full = imagecreatefromjpeg($img)) { return 'error'; } } else if($seg[$last_index]=='png') { if (!$full = imagecreatefrompng($img)) { return 'error'; } } else if($seg[$last_index]=='gif') { if (!$full = imagecreatefromgif($img)) { return 'error'; } } $width = imagesx($full); $height = imagesy($full); # work out the smaller version, setting the shortest side to the size of the thumb, constraining height/wight if ($height > $width) { $divisor = $width / $thumbHeight; } else { $divisor = $height / $thumbWidth; } $resizedWidth = ceil($width / $divisor); $resizedHeight = ceil($height / $divisor); # work out center point $thumbx = floor(($resizedWidth - $thumbWidth) / 2); $thumby = floor(($resizedHeight - $thumbHeight) / 2); /* create the small smaller version, then crop it centrally to create the thumbnail */ $resized = imagecreatetruecolor($resizedWidth, $resizedHeight); $thumb = imagecreatetruecolor($thumbWidth, $thumbHeight); imagealphablending( $resized, false ); imagesavealpha( $resized, true ); imagealphablending( $thumb, false ); imagesavealpha( $thumb, true ); imagecopyresized($resized, $full, 0, 0, 0, 0, $resizedWidth, $resizedHeight, $width, $height); imagecopyresized($thumb, $resized, 0, 0, $thumbx, $thumby, $thumbSize, $thumbSize, $thumbSize, $thumbSize); $name = name_from_url($img); imagejpeg($thumb, $thumbPath.str_replace('_large.jpg', '_thumb.jpg', $name), $thumbQuality); } }
Contact Controller [crayon-67a36b466a08e912259137/] Contact_form.php - view [crayon-67a36b466a09f065180644/] Contact_model [crayon-67a36b466a0a5720114337/] Captcha Helper [crayon-67a36b466a0ab527231875/] Notifications_model [crayon-67a36b466a0b2778449130/] Database…
[crayon-67a36b466a8ad212329159/] [crayon-67a36b466a8b7453637592/]
[crayon-67a36b466ac19181373255/] The first parameter specifies the type of string, the second parameter specifies the length.…
Create Controller [crayon-67a36b466ad6d288051800/] 2. Create View File [crayon-67a36b466ad72844636284/]
[crayon-67a36b466b043396707162/] [crayon-67a36b466b04a583531749/]
All of the native error messages are located in the following language file: system/language/english/form_validation_lang.php To set…