Jump to content
Sign in to follow this  

Image Zoom with xml generator and Flash player

Recommended Posts

Hi all


I became intrested in the Yofla Multi Image zoomer which can be found at the same site ( .com ), i would like to build this one out to the product_info page so visitors can zoom in on the products.


It would be a nice contribution for us all, i have tested it with the OS version, and with the Contri automatic image shrink, so i have a small and a big image.


The problem i ran into is to compile the temp. xml file which tells the flash to display the large image and then after showing deleting the temp. xml file, it also has to do something with a session id, so if a xml file is ceated it is linked to the session from the visitor.


If any intrested ... we could make this new contri get to work together,



If anyone has this already working i think we all want to know how




Frogger 34

Edited by Frogger34

Share this post

Link to post
Share on other sites



I am currently working on this. So far I can write a temporary XML file, write most infos in there except the correct picture path and filename...


I also embedded the Yofla player in the popup_image.php


so the only thing which needs to be done is get the product ID and possibly the subimages ID (if someone uses a contrib like MorePics) and write this information in the XML file which is generated ....



check out the code:


first get the product IDs from the DB:




 $products_query = tep_db_query("select pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'");
 $products = tep_db_fetch_array($products_query);
// BOF: More Pics 6
$invis = $HTTP_GET_VARS['invis'];
$result = mysql_query("select * from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");
// EOF: More Pics 6



this is from MorePics (checks if more pics have been uploaded):


$image = tep_db_fetch_array($result);
if ($image['products_subimage6'] != ''){	   
$last = '6';
}elseif ($image['products_subimage5'] != ''){
$last = '5';
}elseif ($image['products_subimage4'] != ''){
$last = '4';
}elseif ($image['products_subimage3'] != ''){	   
$last = '3';
}elseif ($image['products_subimage2'] != ''){	   
$last = '2';
}elseif ($image['products_subimage1'] != ''){	   
$last = '1';
}elseif ($image['products_image'] != ''){	   
$last = '0';
$next = $invis + '1';
$back = $invis - '1';
if (($invis == '0') || ($invis == '')){
$insert = $image['products_image'];
} else  {
$insert = $image['products_subimage' . $invis. ''];

$img = DIR_WS_IMAGES . $insert;




Create XML:


function savefile($xmldata, $filename){
  $directory = "../shop/images/";


	$directory = "../shop/images/";;
	//$directory = DIR_WS_IMAGES .'/';;
	$filename_dir  = $directory . $filename;
	//$filename_dir  = DIR_FS_CATALOG . $directory . $filename;
	if ($fp = fopen($filename_dir, 'w+')){
			  fwrite($fp, $xmldata);
			  return true;
	else  return false;

function build_xml($data){		
$xmlfile='<?xml version="1.0" encoding="'.CHARSET.'"?>'."\n";




			//$xmlfile.=DIR_WS_CATALOG . DIR_WS_IMAGES . $product_image['products_image'];
			//$xmlfile.=DIR_FS_CATALOG_IMAGES . $product_image['products_image'];



			$xmlfile.=tep_image(DIR_WS_IMAGES . $insert);

			$xmlfile.=DIR_WS_IMAGES . $products['products_image'];


		$xmlfile.="	</images>\n";


savefile($xmlfile, 'config.xml');






be sure to have correct write permissions to the folders and files...


So far this writes me a XML file but still I need to let the XML know the current product picture...


If anyone knows how to to this please let us know


this here:


$xmlfile.=DIR_WS_IMAGES . $products['products_image'];


doesn't work ....

Share this post

Link to post
Share on other sites
$xmlfile.=DIR_WS_IMAGES . $products['products_image'];

Do thumbs work? The equivalent of your thumb code would be
$xmlfile.=tep_image(DIR_WS_IMAGES . $products['products_image']);

If that doesn't work, can you make the XML manually and give an example of how you want it to come out?

Always back up before making changes.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this