Jump to content



- - - - -

$osC_Image->show() show image form a different folder


This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1   new.Matrix

new.Matrix
  • Members
  • 27 posts

Posted 17 April 2009 - 06:27 AM

Hi @ll

If someone wants to have picture in a different folder as products and the would like to include the image with $osC_Image->show(), he has to extend the image.php class.
Open includes/classes/image.php

search (line 62)

	function show($image, $title, $parameters = '', $group = '') {

and replace

	function show($image, $title, $parameters = '', $group = '', $folder = '') {

then search: (line 76)

	  if (empty($image)) {
		$image = 'pixel_trans.gif';
	  } else{
		$image = 'products/' . $this->_groups[$group_id]['code'] . '/' . $image;
	  }

and replace

	  if (empty($image)) {
		$image = 'pixel_trans.gif';
	  } elseif (empty($folder)) {
		$image = 'products/' . $this->_groups[$group_id]['code'] . '/' . $image;
	  } else{
		  $image = $folder.'/' . $image;
	  }

thats it!

now you can show images from a different folder like this:
$osC_Image->show('picturepath', 'name','parameter','','folder')

notice that this is for special images without thumbnail.

Edited by new.Matrix, 17 April 2009 - 06:36 AM.


#2   bhavatmaj

bhavatmaj
  • Members
  • 53 posts

Posted 26 April 2009 - 07:04 AM

Thanks
bhavatmaj