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-68b99871a7743696254657/] Contact_form.php - view [crayon-68b99871a7750530204858/] Contact_model [crayon-68b99871a7755686393353/] Captcha Helper [crayon-68b99871a775b807112913/] Notifications_model [crayon-68b99871a7763016729776/] Database…
[crayon-68b99871a7b7a188398478/] [crayon-68b99871a7b81770120081/]
[crayon-68b99871a7dae992859732/] The first parameter specifies the type of string, the second parameter specifies the length.…
Create Controller [crayon-68b99871a7f57605257645/] 2. Create View File [crayon-68b99871a7f5d855116000/]
[crayon-68b99871a80ec376957717/] [crayon-68b99871a80f2025772745/]
All of the native error messages are located in the following language file: system/language/english/form_validation_lang.php To set…