Hola muchachos,
He subido cantidad de productos a virtuemart usando csv improved, todo bien.
Sin embargo las imagenes no aparecen
las he subido como
12345.jpg
virtuemart las llama como
http://localhost/temasrar/eshop/dec2...name=12345.jpg
pero no aparece nada.
les envío el show_image_in_imgtag.php
Código PHP:
Ver original<?php
// Get the Joomla! configuration file
$config_file = '../../configuration.php';
include_once( $config_file );
if( !isset( $mosConfig_absolute_path ) ) { // We are in J! 1.5
$mosConfig_absolute_path = dirname( $config_file ); }
include_once("../../administrator/components/com_virtuemart/virtuemart.cfg.php");
// Image2Thumbnail - Klasse einbinden
include( CLASSPATH . "ps_main.php");
include( CLASSPATH . "class.img2thumb.php");
$filenames[] = IMAGEPATH."product/".$basefilename;
$resized_filenames[] = IMAGEPATH."product/resized/".$basefilename;
$filenames[] = IMAGEPATH."category/".$basefilename;
$resized_filenames[] = IMAGEPATH."category/resized/".$basefilename;
$newxsize = (int)@$_REQUEST['newxsize'] == 0 ? PSHOP_IMG_WIDTH : (int)@$_REQUEST['newxsize'];
$newysize = (int)@$_REQUEST['newysize'] == 0 ? PSHOP_IMG_WIDTH : (int)@$_REQUEST['newysize'];
// Don't allow sizes beyond 2000 pixels
$newxsize = min( $newxsize, 2000 ); $newysize = min( $newysize, 2000 );
$maxsize = false;
$bgred = 255;
$bggreen = 255;
$bgblue = 255;
/*
if( !isset($fileout) )
$fileout="";
if( !isset($maxsize) )
$maxsize=0;
*/
/* Minimum security */
$file_exists = false;
$i = 0;
foreach ( $filenames as $file ) {
$file_exists = true;
$filename = $file;
break;
$file_exists = true;
$filename = $resized_filenames[$i];
break;
}
++$i;
}
$file_exists or
die('File does not exist');
$filename2 = $resized_filenames[$i];
$file = str_replace(".".$fileinfo['extension'], "", $fileinfo['basename']); // In class.img2thumb in the function NewImgShow() the extension .jpg will be added to .gif if imagegif does not exist.
// If the image is a gif, and imagegif() returns false then make the extension ".gif.jpg"
if( $fileinfo['extension'] == "gif") {
$ext = ".".$fileinfo['extension'];
$noimgif="";
}
else {
$ext = ".jpg";
$noimgif = ".".$fileinfo['extension'];
}
}
else {
$ext = ".".$fileinfo['extension'];
$noimgif="";
}
$fileout = $filename2;
} else {
$fileout = dirname( $filename2 ) .'/'.$file."_".$newxsize."x".$newysize.$noimgif.$ext; }
// Tell the user agent to cache this script/stylesheet for an hour
$age = 3600;
header( 'Cache-Control: max-age='.$age.', must-revalidate' );
/* We already have a resized image
* So send the file to the browser */
{
case ".gif":
header ("Content-type: image/gif"); break;
case ".jpg":
header ("Content-type: image/jpeg"); break;
case ".png":
header ("Content-type: image/png"); break;
}
}
else {
/* We need to resize the image and Save the new one (all done in the constructor) */
$neu = new Img2Thumb($filename,$newxsize,$newysize,$fileout,$maxsize,$bgred,$bggreen,$bgblue);
/* Send the file to the browser */
switch($ext)
{
case ".gif":
header ("Content-type: image/gif"); break;
case ".jpg":
header ("Content-type: image/jpeg"); break;
case ".png":
header ("Content-type: image/png"); break;
}
}
?>