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: 67

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: 378

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' || $set == 'wireframe_pink') { 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 ($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['desired_size'] / $config['image_data']['image_width']; $config['image_data']['image_width_new'] = $config['desired_size']; $config['image_data']['image_height_new'] = $ratio * $config['image_data']['image_height']; } else { $ratio = $config['desired_size'] / $config['image_data']['image_height']; $config['image_data']['image_width_new'] = $ratio * $config['image_data']['image_width']; $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']) { if (!isset($config['crop_alignment'])) { $config['crop_alignment'] = 'left'; } $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['crop_alignment'] == 'center') { $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; } elseif ($config['crop_alignment'] == 'right') { $image_library_crop_config['x_axis'] = ($config['image_data']['image_width_new'] - $config['crop_x']); $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['crop_alignment']) { echo ''; } else { echo ''; } } else { echo ''; } echo '
'; } } ?>lang->line($label); if($return) return $return; else return '(Translate me) '.$label; } */ function label($name, $vars = array()) { $CI =& get_instance(); $CI->load->model('translations/translations_model'); $CI->load->model('translations/languages_model'); if ($query = $CI->languages_model->getOne($CI->session->userdata('language'))) { $language = $query; } if ($query = $CI->translations_model->getOne($name)) { $label = $query; } else { $insert = array ( 'name' => $name ); $CI->translations_model->create($insert); $label = $CI->translations_model->getOne($name); } $label = (array) $label; if ($label['type'] == 'text') { if(!empty($label[$language->code])) { $line = $label[$language->code]; if ($vars) { $line = vsprintf($label[$language->code], (array) $vars); } return $line; } } elseif ($label['type'] == 'textarea') { $line = $label['text_'.$language->code]; if ($vars) { $line = vsprintf($label['text_'.$language->code], (array) $vars); } return $line; } return '(Translate me) '.$label['name']; } function lang($line, $vars = array()) { $CI =& get_instance(); $line = $CI->lang->line($line); if ($vars) { $line = vsprintf($line, (array) $vars); } return $line; } template->write('pageTabs', ''); } function addLink($link, $name, $extra = NULL) { $return = ''; $CI =& get_instance(); //Check if active link if ($CI->uri->uri_string() == $link) { $return .= '
  • '; } else { $return .= '
  • '; } $return .= anchor($link, $name, $extra); $return .= '
  • '; return $return; } function reorderItems($siblings, $directionOrNewOrder, $targetItem) { $orderedSiblings = array(); foreach ($siblings as $sibling) { $orderedSiblings[] = $sibling->id; } if ($directionOrNewOrder == 'up') { $newOrder = $targetItem->order-1; } elseif ($directionOrNewOrder == 'down') { $newOrder = $targetItem->order+1; } else { $newOrder = $directionOrNewOrder; } function _reorder($array, $index, $val) { //function decleration $temp = array(); // this temp array will hold the value $size = count($array); //because I am going to use this more than one time // just validate if index value is proper if (@$index) if ($index < 0 || $index > $size) { return false; } //here is the actual insertion code $temp = array_slice($array, 0, $index);//slice from 0 to index array_push($temp, $val);//add the value at the end of the array $temp = array_merge($temp, array_slice($array, $index, $size)); //reconnect the remaining of the array to the current temp $array = $temp;//swap// no need for this if you pass the array cuz you can simply return $temp, but, if u r using a class array for example, this is useful. return $array; // you can return $temp instead if you don't use class array } if ($reorderedSiblings = _reorder($orderedSiblings, $newOrder, $targetItem->id)) { return $reorderedSiblings; } } function printLanguageTabs() { ?>