A PHP Error was encountered

Severity: Notice

Message: Only variable references should be returned by reference

Filename: core/Common.php

Line Number: 257

A PHP Error was encountered

Severity: Warning

Message: Declaration of MX_Lang::load($langfile, $lang = '', $return = false, $add_suffix = true, $alt_path = '') should be compatible with CI_Lang::load($langfile = '', $idiom = '', $return = false, $add_suffix = true, $alt_path = '')

Filename: MX/Lang.php

Line Number: 0

A PHP Error was encountered

Severity: Warning

Message: Declaration of MX_Loader::library($library, $params = NULL, $object_name = NULL) should be compatible with CI_Loader::library($library = '', $params = NULL, $object_name = NULL)

Filename: MX/Loader.php

Line Number: 0

A PHP Error was encountered

Severity: Warning

Message: Declaration of MX_Loader::helper($helper) should be compatible with CI_Loader::helper($helpers = Array)

Filename: MX/Loader.php

Line Number: 0

A PHP Error was encountered

Severity: Warning

Message: Declaration of MX_Loader::helpers($helpers) should be compatible with CI_Loader::helpers($helpers = Array)

Filename: MX/Loader.php

Line Number: 0

A PHP Error was encountered

Severity: Warning

Message: Declaration of MX_Loader::language($langfile, $idiom = '', $return = false, $add_suffix = true, $alt_path = '') should be compatible with CI_Loader::language($file = Array, $lang = '')

Filename: MX/Loader.php

Line Number: 0

A PHP Error was encountered

Severity: Warning

Message: Declaration of MX_Loader::_ci_get_component($component) should be compatible with & CI_Loader::_ci_get_component($component)

Filename: MX/Loader.php

Line Number: 0

A PHP Error was encountered

Severity: Notice

Message: Only variables should be assigned by reference

Filename: core/Loader.php

Line Number: 74

'; } if ($set == 'wireframe_black' || $set == 'wireframe_white') { return ''; } } function new_image($config, $debug = false){ $debug = false; $CI =& get_instance(); $CI->load->library('image_lib'); //Set folder name to desired size if empty if (!$config['destination_folder']) { $config['destination_folder'] = $desired_size; } $config['destination_path'] = './'.$config['base_path'].'/'.$config['destination_folder'].'/'; $config['source_path'] = './'.$config['base_path'].'/src/'; if (!isset($config['center_crop'])) { $config['center_crop'] = false; } if ($debug) { //echo APPPATH.'../'.$config['base_path'].'/'.$config['destination_folder']; } //Create destination directory if non-existent if (!is_dir(APPPATH.'../'.$config['base_path'].'/'.$config['destination_folder'])) { mkdir($config['destination_path'], 0777); } //Find the correct width and height if ($config['image_data']['image_width'] <= $config['image_data']['image_height']) { //Height is the longer side if ($config['image_data']['image_height'] > $config['desired_size']) { //Height is more than desired size, continue with resize $ratio = $config['image_data']['image_height'] / $config['image_data']['image_width']; $config['image_data']['image_width_new'] = $config['desired_size']; $config['image_data']['image_height_new'] = $ratio * $config['desired_size']; } else { //Height is less than desired size, keep original size $config['image_data']['image_width_new'] = $config['image_data']['image_width']; $config['image_data']['image_height_new'] = $config['image_data']['image_height']; } } else { //Width is the longer side if ($config['image_data']['image_width'] > $config['desired_size']) { //Width is more than desired size, continue with resize $ratio = $config['image_data']['image_width'] / $config['image_data']['image_height']; $config['image_data']['image_width_new'] = $ratio * $config['desired_size']; $config['image_data']['image_height_new'] = $config['desired_size']; } else { //Width is less than desired size, keep original size $config['image_data']['image_width_new'] = $config['image_data']['image_width']; $config['image_data']['image_height_new'] = $config['image_data']['image_height']; } } //If dimensions are forced, the longer side is set to the desired size if ($config['force_dimensions'] && $config['image_data']['image_width_new'] >= $config['desired_size'] && $config['image_data']['image_height_new'] >= $config['desired_size']) { if ($config['image_data']['image_width_new'] >= $config['image_data']['image_height_new']) { $ratio = $config['image_data']['image_height_new'] / $config['image_data']['image_width_new']; $config['image_data']['image_width_new'] = $config['desired_size']; $config['image_data']['image_height_new'] = $ratio * $config['desired_size']; } else { $ratio = $config['image_data']['image_height_new'] / $config['image_data']['image_width_new']; $config['image_data']['image_width_new'] = $ratio * $config['desired_size']; $config['image_data']['image_height_new'] = $config['desired_size']; } } //Round off the dimensions $config['image_data']['image_width_new'] = round($config['image_data']['image_width_new']); $config['image_data']['image_height_new'] = round($config['image_data']['image_height_new']); //Build the configuration file for the image library $CI->image_lib->clear(); $image_library_config['image_library'] = 'gd2'; $image_library_config['source_image'] = $config['source_path'].$config['image_data']['file_name']; $image_library_config['new_image'] = $config['destination_path']; $image_library_config['maintain_ratio'] = TRUE; $image_library_config['width'] = $config['image_data']['image_width_new']; $image_library_config['height'] = $config['image_data']['image_height_new']; //Do the resize $CI->image_lib->initialize($image_library_config); if ( !$CI->image_lib->resize()) { $data['resize_error'] = $CI->image_lib->display_errors(); $upload = false; } //If crop is set, process crop settings if ($config['crop']) { $CI->image_lib->clear(); $image_library_crop_config['image_library'] = 'gd2'; $image_library_crop_config['source_image'] = $config['destination_path'].$config['image_data']['file_name']; $image_library_crop_config['maintain_ratio'] = FALSE; if (!empty($config['crop_x'])) { $image_library_crop_config['width'] = $config['crop_x']; } else { $image_library_crop_config['width'] = $config['desired_size']; } if (!empty($config['crop_y'])) { $image_library_crop_config['height'] = $config['crop_y']; } else { $image_library_crop_config['height'] = $config['desired_size']; } if ($config['center_crop']) { $image_library_crop_config['x_axis'] = ($config['image_data']['image_width_new'] - $config['crop_x']) / 2; $image_library_crop_config['y_axis'] = ($config['image_data']['image_height_new'] - $config['crop_y']) / 2; } else { $image_library_crop_config['x_axis'] = '0'; $image_library_crop_config['y_axis'] = '0'; } $CI->image_lib->initialize($image_library_crop_config); if ( !$CI->image_lib->crop()) { $data['resize_error'] = $CI->image_lib->display_errors(); $upload = false; } } if ($debug) { echo '

'; echo $config['destination_folder']; echo '

'; echo '
';
		print_r($config);
		echo '
'; echo '
';
		print_r($image_library_config);
		echo '
'; if (isset($image_library_crop_config)) { echo '
';
			print_r($image_library_crop_config);
			echo '
'; } echo '
'; if ($config['crop']) { if ($config['center_crop']) { echo ''; } else { echo ''; } } else { echo ''; } echo '
'; } } function crop($config){ $crop = true; $resize_config['image_library'] = 'gd2'; $resize_config['source_image'] = './assets/news/photos/800/'.$data['article']->image_path; $resize_config['new_image'] = './assets/news/photos/120/'; $resize_config['maintain_ratio'] = FALSE; $resize_config['width'] = $_POST['w']; $resize_config['height'] = $_POST['h']; $resize_config['x_axis'] = $_POST['x']; $resize_config['y_axis'] = $_POST['y']; $this->image_lib->initialize($resize_config); if ( !$this->image_lib->crop()) { $data['resize_error'] = $this->image_lib->display_errors(); $crop = false; } $this->image_lib->clear(); $resize_config['image_library'] = 'gd2'; $resize_config['source_image'] = './assets/news/photos/120/'.$data['article']->image_path; $resize_config['maintain_ratio'] = TRUE; $resize_config['width'] = 120; $resize_config['height'] = 120; $this->image_lib->initialize($resize_config); if ( !$this->image_lib->resize()) { $data['resize_error'] = $this->image_lib->display_errors(); $crop = false; } if($crop){ redirect('news/article/'.$data['article']->id); } } ?>

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: class

Filename: helpers/ads_helper.php

Line Number: 25

">
'; } if ($style == 'sidebar') { echo ''; } } if ($type == 'swf') { if ($style == 'main') { echo ' '; } if ($style == 'sidebar') { echo ' '; } } } ?>