template);
}
// Have we already imported ?
$imported = get_option('pagelayer_theme_'.get_template().'_imported');
if(!empty($imported)){
$GLOBALS['pl_warn'] = __('You have already imported the content of this theme. You can re-import the same by either choosing to over-write existing pages / pagelayer templates OR creating duplicate content !', 'pagelayer');
}
// Call the theme
pagelayer_import_T();
}
function pagelayer_import_T(){
global $pagelayer, $pagelayer_theme, $pagelayer_theme_url, $pagelayer_theme_path, $pagelayer_pages, $pl_error;
pagelayer_page_header('Pagelayer - Import Template');
// Any errors ?
if(!empty($pl_error)){
pagelayer_report_error($pl_error);echo '
';
}
// Saved ?
if(!empty($GLOBALS['pl_saved'])){
echo '
'. __('The theme content was successfully imported', 'pagelayer'). '
'.$GLOBALS['pl_warn'].'
The page you requested was not found we suggest you to go back to HomePage
'; $pgl['404'] = $conf['404']; } // Do we have the blog template ? if(empty($pgl['single-template'])){ $conf['single-template']['post_content'] = ' '; $pgl['single-template'] = $conf['single-template']; } return $pgl; } // Resize Image function pagelayer_resizeImage($filename, $newwidth, $newheight){ $imagesize = getimagesize($filename); $width = $imagesize[0]; $height = $imagesize[1]; // Calculate the Height and width if($width <= $newwidth || $height <= $newheight){ return false; } $thumb = imagecreatetruecolor($newwidth, $newheight); switch($imagesize['mime']) { case 'image/jpg': case 'image/jpeg': $source = imagecreatefromjpeg($filename); break; case 'image/gif': $source = imagecreatefromgif($filename); break; case 'image/png': $source = imagecreatefrompng($filename); break; } if(empty($source)){ return false; } imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); imagedestroy($source); ob_start(); switch($imagesize['mime']) { case 'image/jpg': case 'image/jpeg': imagejpeg($thumb); break; case 'image/gif': imagegif($thumb); break; case 'image/png': imagepng($thumb); break; } $image = ob_get_clean(); imagedestroy($thumb); return $image; }