Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] More_pics_6 v1.1 For osC 2.2 MS2


surfalot

Recommended Posts

Your scripts will need to be modified to pull the correct image from the new table. I can't give any help with that without knowing what those scripts are.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • Replies 1.6k
  • Created
  • Last Reply

Top Posters In This Topic

Your scripts will need to be modified to pull the correct image from the new table. I can't give any help with that without knowing what those scripts are.

 

Regards

Jim

 

This is the script

 

 


<?PHP

/* Preisroboter v2 PHP Export Script */
/* Artikel-Nr.*|Artikelname*|Preis*|Deeplink*|Bild-URL|Kurzbeschreibung|Versandkosten|Lieferzeit|EAN|PZN|Hst.-Art.-Nr.|Hersteller */

require_once('includes/configure.php');
require('includes/application_top.php');

//Hier NICHTS verändern!
$host_osc	= DB_SERVER;
$db_osc		= DB_DATABASE;
$usr_osc	= DB_SERVER_USERNAME;
$pwd_osc	= DB_SERVER_PASSWORD;

$cat		= DIR_WS_HTTP_CATALOG; 
$server 	= HTTP_SERVER;
$imagepath	= $server.$cat.DIR_WS_IMAGES; 
$detailpage	= $server.$cat."product_info.php?products_id=";
$prdatei	= 'preisroboter.txt'; 

// Hier bitte Anpassungen vornehmen:
$export_typ 	= 0;			// 0 == Aufruf per CronJob (Ausgabe in txt-Datei); 1 == Direkter Aufruf (Ausgabe auf Bildschirm)
				// Hinweis: Wenn mehr als 5000 Produkte in der Datenbank vohanden sind, sollte der Aufruf per Cronjob (wenn möglich) bevorzugt werden!
$lang_id	= 2;			// SprachID, Standard ist 2 (deutsch)
$exclude 	= 0;			// Produkte, die als "nicht vorrätig" eingestellt sind, mit ausgeben?(0 = JA, 1 = NEIN)
$lz_na		= "nicht Lieferbar";	// Lieferzeit in Tagen, für "nicht vorrätig" Zahlwerte bitte OHNE Hochkomma angeben: z.B. $lz_na = 9; (entspricht 9 Tagen)
$lz_normal	= "keine Angaben";	// Standard-Lieferzeit; für Text bitte wie folgt ändern: z.B.: $lz_normal = "sofort lieferbar"; Zahlen ohne Hochkomma angeben!
$limit		= 0;
$limit_step	= 1000;			// Gruppengröße, in der die Produkte gelesen werden


/* AB HIER BITTE NICHTS MEHR ÄNDERN */

function clear_descr($descr) //(säubert die beschreibung)
{
$descr=str_replace("\n"," ",$descr);		//Zeilenumbruch entfernen
$descr=str_replace("\r","",$descr);		//CR entfernen
$descr=str_replace('|',' ',$descr);		// | entfernen
$descr=strip_tags($descr);			//HTML entfernen
if(strlen($descr) < 500) { $descr = $descr." "; }
else if(strlen($descr) > 500) 
{ 
	$descr = substr($descr,0,500);
	$pos = strrpos($descr," ");
	$descr = substr($descr,0,$pos)." ..."; 
}
return $descr;
}

function clear_name($name) //(säubert den namen)
{
$name=str_replace('|',' ',$name);		// | entfernen
$name=strip_tags($name);			// HTML entfernen
$name=htmlspecialchars($name,ENT_QUOTES);
return $name;
}

function calc_price($row) // berechnet den Preis (inkl MwSt)
{
if ($sonderpr=tep_get_products_special_price($row['products_id'])){
$price=$sonderpr;
}else{ $price=$row['products_price']; }
$tax=(100+tep_get_tax_rate($row['products_tax_class_id']))/100;
$price=number_format($price*$tax,2,".",""); //Preis formatieren und 16% MwSt. draufrechnen
return $price;
}

function make_link($id) // Gibt Link zur Seite des Produktes zurück
{	global $detailpage;
return $detailpage.$id;
}

function make_imglink($img) // Gibt Bilder-Link des Produktes zurück
{	global $imagepath;
if($img <> "") return $imagepath.$img;
else return " ";	
}

function check_lzeit($zeit) 
{
if(is_string($zeit))
       {
               return $zeit;
       }
else if(is_int($zeit))
{
	if($zeit == 1) { return $zeit." Tag";}
	else { return $zeit." Tage";}
}
}

function make_lzeit($status) // gibt lieferzeit in Tagen zurück (4 Tage, 12 Tage, etc)
{	global $lz_na,$lz_normal;
if($status == 0) $lz = check_lzeit($lz_na);
else if($status == 1) $lz = check_lzeit($lz_normal);
return $lz;
}

function get_ean($ean) // Gibt evtl vorhandene EAN zurück
{
if($ean <> "") return $ean;
else return "";
}

function check_val($val) // Prüft ob Wert vorhanden und gibt in dem Fall den Wert zurück
{
if($val <> "") return $val;
}

(USE_PCONNECT == true) ? $con = mysql_connect($host_osc, $usr_osc, $pwd_osc) or die("Keine Verbindung zur Datenbank möglich") : $con = mysql_pconnect($host_osc, $usr_osc, $pwd_osc) or die("Keine Verbindung zur Datenbank möglich");  
mysql_select_db($db_osc, $con);
$sql = "SELECT count(*) FROM products";
$res2 = mysql_query($sql,$con);
$cnt = mysql_fetch_row($res2);
$count = $cnt[0];
$count2 = $cnt[0];
$x = 0;
if($count > $limit_step) 
{
$x = floor($count/$limit_step); 
}
for($i=0;$i<=$x;$i++)
{
$limit = ($i * $limit_step);
if($exclude) 
{
$sql = "SELECT p.products_status, p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_description, m.manufacturers_name ".
   "FROM products p ".
   "LEFT JOIN products_description pd ON p.products_id=pd.products_id ".
   "LEFT JOIN manufacturers m ON m.manufacturers_id = p.manufacturers_id ". 
   "WHERE pd.language_id=".$lang_id." AND p.products_status > 0 ".
   "LIMIT $limit,$limit_step";
} 
else
{
$sql = "SELECT p.products_status, p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_description, m.manufacturers_name ".
   "FROM products p ".
   "LEFT JOIN products_description pd ON p.products_id=pd.products_id ".
   "LEFT JOIN manufacturers m ON m.manufacturers_id = p.manufacturers_id ". 
   "WHERE pd.language_id=".$lang_id." ".
   "LIMIT $limit, $limit_step";
}



$res = mysql_query($sql,$con);
if($export_typ == 0)
{
$fp = fopen ($prdatei, 'w' );
 	flock($fp,2);
}

while($row = mysql_fetch_array($res))
{
$artikel['nr']		    = $row['products_id'];
$artikel['name']	    = clear_name($row['products_name']);
$artikel['preis']	    = calc_price($row);
$artikel['link']    	= make_link($row['products_id']);
$artikel['imglink']	    = make_imglink($row['products_image']);
$artikel['descr']	    = clear_descr($row['products_description']);
$artikel['versand']	    = '';	// von OSC _NICHT_ unterstützt, deshalb leer!
$artikel['lieferzeit']	= make_lzeit($row['products_status']);
$artikel['ean']		    = get_ean($row['products_ean']); // von OSC _NICHT_ unterstützt, deshalb leer!
$artikel['pzn']		    = check_val($row['products_pzn']);
$artikel['hstartnr']	= check_val($row['products_hst_art_nr']);
$artikel['hst']		    = check_val($row['manufacturers_name']);

$export = $artikel['nr'] ."|". $artikel['name']."|". $artikel['preis'] ."|". $artikel['link'] ."|". $artikel['imglink'] ."|". $artikel['descr'] ."|". $artikel['versand'] ."|". $artikel['lieferzeit'] ."|". $artikel['ean'] ."|". $artikel['pzn'] ."|". $artikel['hstartnr'] ."|". $artikel['hst'] ."\n";

if($export_typ == 1) echo $export;
else if($export_typ == 0) fwrite($fp,$export);

}
if($export_typ == 0)
{
flock($fp,3);
fclose($fp);
}

};
?>



 

I know with php and mysql is not good enough out to change that.

Can you help me?

 

 

Regards

 

Jo

Link to comment
Share on other sites

In the file that you posted, find this on Line 129

p.products_image,

(this is only part of the line) and change that to

pi.image_filename,

Then AFTER line 132 add the following new line

left join " . TABLE_PRODUCTS_IMAGES . " pi on p.products_id = pi.products_id and pi.category_page = '1',

Then on Line 161 -- Change this

$artikel['imglink'] = make_imglink($row['products_image']);

to this:

$artikel['imglink'] = make_imglink($row['image_filename']);

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Thanks for the support.

I made the changes.

But now I get the error message

Parse error: syntax error, unexpected T_STRING in /var/www/html/XXX/XXX/XXX/preisroboter2.php on line 133

 

 

Have your line

left join " . TABLE_PRODUCTS_IMAGES . " pi on p.products_id = pi.products_id and pi.category_page = '1',

modified with quote

"left join " . TABLE_PRODUCTS_IMAGES . " pi on p.products_id = pi.products_id and pi.category_page = '1',".

 

 

But the syntax does not seem quite right.

Su Can you please look at the syntax?

I still do not understand enough of it.

I need not also the changes in the lines 138 and 141?

 

Regards

Jo

Link to comment
Share on other sites

That should work. Try making the whole SQL section look like this:

$sql = "SELECT p.products_status, p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_description, m.manufacturers_name ".
"FROM products p ".
"LEFT JOIN products_description pd ON p.products_id=pd.products_id ".
"LEFT JOIN manufacturers m ON m.manufacturers_id = p.manufacturers_id ".
"left join products_images pi on p.products_id = pi.products_id and pi.category_page = '1',".
"WHERE pd.language_id=".$lang_id." AND p.products_status > 0 ".
"LIMIT $limit,$limit_step";

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

 Hallo Jim,

 

Unfortunately, it still does not work.

Now I get the following error.

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/xxx/xxx/xxx/preisroboter2.php on line 158

 

 

will probably be here

while($row = mysql_fetch_array($res))

 

 

Here again the entire code.



/* Preisroboter v2 PHP Export Script */

/* Artikel-Nr.*|Artikelname*|Preis*|Deeplink*|Bild-URL|Kurzbeschreibung|Versandkosten|Lieferzeit|EAN|PZN|Hst.-Art.-Nr.|Hersteller */



require_once('includes/configure.php');

require('includes/application_top.php');



//Hier NICHTS verändern!

$host_osc	= DB_SERVER;

$db_osc		= DB_DATABASE;

$usr_osc	= DB_SERVER_USERNAME;

$pwd_osc	= DB_SERVER_PASSWORD;



$cat		= DIR_WS_HTTP_CATALOG; 

$server 	= HTTP_SERVER;

$imagepath	= $server.$cat.DIR_WS_IMAGES; 

$detailpage	= $server.$cat."product_info.php?products_id=";

$prdatei	= 'preisroboter.txt'; 



// Hier bitte Anpassungen vornehmen:

$export_typ 	= 0;			// 0 == Aufruf per CronJob (Ausgabe in txt-Datei); 1 == Direkter Aufruf (Ausgabe auf Bildschirm)

				// Hinweis: Wenn mehr als 5000 Produkte in der Datenbank vohanden sind, sollte der Aufruf per Cronjob (wenn möglich) bevorzugt werden!

$lang_id	= 2;			// SprachID, Standard ist 2 (deutsch)

$exclude 	= 0;			// Produkte, die als "nicht vorrätig" eingestellt sind, mit ausgeben?(0 = JA, 1 = NEIN)

$lz_na		= "nicht Lieferbar";	// Lieferzeit in Tagen, für "nicht vorrätig" Zahlwerte bitte OHNE Hochkomma angeben: z.B. $lz_na = 9; (entspricht 9 Tagen)

$lz_normal	= "keine Angaben";	// Standard-Lieferzeit; für Text bitte wie folgt ändern: z.B.: $lz_normal = "sofort lieferbar"; Zahlen ohne Hochkomma angeben!

$limit		= 0;

$limit_step	= 1000;			// Gruppengröße, in der die Produkte gelesen werden





/* AB HIER BITTE NICHTS MEHR ÄNDERN */



function clear_descr($descr) //(säubert die beschreibung)

{

$descr=str_replace("\n"," ",$descr);		//Zeilenumbruch entfernen

$descr=str_replace("\r","",$descr);		//CR entfernen

$descr=str_replace('|',' ',$descr);		// | entfernen

$descr=strip_tags($descr);			//HTML entfernen

if(strlen($descr) < 500) { $descr = $descr." "; }

else if(strlen($descr) > 500) 

{ 

	$descr = substr($descr,0,500);

	$pos = strrpos($descr," ");

	$descr = substr($descr,0,$pos)." ..."; 

}

return $descr;

}



function clear_name($name) //(säubert den namen)

{

$name=str_replace('|',' ',$name);		// | entfernen

$name=strip_tags($name);			// HTML entfernen

$name=htmlspecialchars($name,ENT_QUOTES);

return $name;

}



function calc_price($row) // berechnet den Preis (inkl MwSt)

{

if ($sonderpr=tep_get_products_special_price($row['products_id'])){

$price=$sonderpr;

}else{ $price=$row['products_price']; }

$tax=(100+tep_get_tax_rate($row['products_tax_class_id']))/100;

$price=number_format($price*$tax,2,".",""); //Preis formatieren und 16% MwSt. draufrechnen

return $price;

}



function make_link($id) // Gibt Link zur Seite des Produktes zurück

{	global $detailpage;

return $detailpage.$id;

}



function make_imglink($img) // Gibt Bilder-Link des Produktes zurück

{	global $imagepath;

if($img <> "") return $imagepath.$img;

else return " ";	

}



function check_lzeit($zeit) 

{

if(is_string($zeit))

       {

               return $zeit;

       }

else if(is_int($zeit))

{

	if($zeit == 1) { return $zeit." Tag";}

	else { return $zeit." Tage";}

}

}



function make_lzeit($status) // gibt lieferzeit in Tagen zurück (4 Tage, 12 Tage, etc)

{	global $lz_na,$lz_normal;

if($status == 0) $lz = check_lzeit($lz_na);

else if($status == 1) $lz = check_lzeit($lz_normal);

return $lz;

}



function get_ean($ean) // Gibt evtl vorhandene EAN zurück

{

if($ean <> "") return $ean;

else return "";

}



function check_val($val) // Prüft ob Wert vorhanden und gibt in dem Fall den Wert zurück

{

if($val <> "") return $val;

}



(USE_PCONNECT == true) ? $con = mysql_connect($host_osc, $usr_osc, $pwd_osc) or die("Keine Verbindung zur Datenbank möglich") : $con = mysql_pconnect($host_osc, $usr_osc, $pwd_osc) or die("Keine Verbindung zur Datenbank möglich");  

mysql_select_db($db_osc, $con);

$sql = "SELECT count(*) FROM products";

$res2 = mysql_query($sql,$con);

$cnt = mysql_fetch_row($res2);

$count = $cnt[0];

$count2 = $cnt[0];

$x = 0;

if($count > $limit_step) 

{

$x = floor($count/$limit_step); 

}

for($i=0;$i<=$x;$i++)

{

$limit = ($i * $limit_step);

if($exclude) 

{

$sql = "SELECT p.products_status, p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_description, m.manufacturers_name ".

"FROM products p ".

"LEFT JOIN products_description pd ON p.products_id=pd.products_id ".

"LEFT JOIN manufacturers m ON m.manufacturers_id = p.manufacturers_id ".

"left join products_images pi on p.products_id = pi.products_id and pi.category_page = '1',".

"WHERE pd.language_id=".$lang_id." AND p.products_status > 0 ".

"LIMIT $limit,$limit_step";

} 

else

{

$sql = "SELECT p.products_status, p.products_id, p.products_model, pi.image_filename, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_description, m.manufacturers_name ".

   "FROM products p ".     

   "LEFT JOIN products_description pd ON p.products_id=pd.products_id ".

   "LEFT JOIN manufacturers m ON m.manufacturers_id = p.manufacturers_id ".

   "LEFT JOIN products_images pi on pi.products_id = pi.products_id and pi.category_page = '1',".

 "left join products_images pi on p.products_id = pi.products_id and pi.category_page = '1',".

   "WHERE pd.language_id=".$lang_id." ".

   "LIMIT $limit, $limit_step";

}







$res = mysql_query($sql,$con);

if($export_typ == 0)

{

$fp = fopen ($prdatei, 'w' );

 	flock($fp,2);

}



while($row = mysql_fetch_array($res))

{

$artikel['nr']		    = $row['products_id'];

$artikel['name']	    = clear_name($row['products_name']);

$artikel['preis']	    = calc_price($row);

$artikel['link']    	= make_link($row['products_id']);

$artikel['imglink'] = make_imglink($row['image_filename']);

$artikel['descr']	    = clear_descr($row['products_description']);

$artikel['versand']	    = '';	// von OSC _NICHT_ unterstützt, deshalb leer!

$artikel['lieferzeit']	= make_lzeit($row['products_status']);

$artikel['ean']		    = get_ean($row['products_ean']); // von OSC _NICHT_ unterstützt, deshalb leer!

$artikel['pzn']		    = check_val($row['products_pzn']);

$artikel['hstartnr']	= check_val($row['products_hst_art_nr']);

$artikel['hst']		    = check_val($row['manufacturers_name']);



$export = $artikel['nr'] ."|". $artikel['name']."|". $artikel['preis'] ."|". $artikel['link'] ."|". $artikel['imglink'] ."|". $artikel['descr'] ."|". $artikel['versand'] ."|". $artikel['lieferzeit'] ."|". $artikel['ean'] ."|". $artikel['pzn'] ."|". $artikel['hstartnr'] ."|". $artikel['hst'] ."\n";



if($export_typ == 1) echo $export;

else if($export_typ == 0) fwrite($fp,$export);



}

if($export_typ == 0)

{

flock($fp,3);

fclose($fp);

}



};

?>

 

 

Would not somewhere in the database query the Tabell prodacts_image and the field image_filename be contained?

 

 

Regards

Jo

Link to comment
Share on other sites

You missed a change in the first $sql =. Other than that, I can't see the problem. Somewhere you've made another error that needs to be found and fixed. I can't do debugging from here.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hello. I install more_pics_advanced_2.0.6. All work good unless 2 errors : 1. When I open category I saw product name, price but no images and when I click on product name - new window open to me where are images for product. How can I do that when users open category they can see product images.

2. I change my products_new.php file but when I open new products some error report me. I used template from Templatemonsters and its very diffiicultly make changes in this file . Can you help me? Here my products_new.php :

<?php

/*

$Id: products_new.php,v 1.27 2003/06/09 22:35:33 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCTS_NEW);

 

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW));

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="col_left">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</td>

<!-- body_text //-->

<td width="100%" class="col_center">

 

<?php /* require(DIR_WS_BOXES . 'panel_top.php'); */ ?>

 

<? tep_draw_heading_top();?>

 

<? new contentBoxHeading_ProdNew($info_box_contents);?>

 

<? tep_draw_heading_top_3();?>

 

<?php

$products_new_array = array();

 

$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";

$products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_PRODUCTS_NEW);

 

if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '2'))) {

?>

<?php echo tep_draw_result_top_1(); ?>

<table border="0" cellspacing="0" cellpadding="0" class="result">

<tr>

<td><?php echo $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?></td>

<td class="result_right"><?php echo TEXT_RESULT_PAGE . ' ' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

</tr>

</table>

 

<?php echo tep_draw_result_top(); ?>

<?php echo tep_draw_result_bottom_1(); ?>

 

<?php

}

?>

<?php

if ($products_new_split->number_of_rows > 0) {

$products_new_query = tep_db_query($products_new_split->sql_query);

$row = 0;

$col = 0;

$info_box_contents = array();

while ($products_new = tep_db_fetch_array($products_new_query)) {

 

$product_query = tep_db_query("select products_description, products_id from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_new['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

$product = tep_db_fetch_array($product_query);

 

$p_desc = substr($product['products_description'], 0, MAX_DESCR_1);

$p_id = $product['products_id'];

$p_pic = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';

$p_name = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . substr( $products_new['products_name'],0,MAX_DESCR_NAME) . '</a>';

 

 

 

if ($new_price = tep_get_products_special_price($products_new['products_id'])) {

$products_price = '<s>' . $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($products_new['products_tax_class_id'])) . '</span>';

} else {

$products_price = '<span class="productSpecialPrice">'.$currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id']).'</span>');

}

 

$p_price = $products_price;

 

$products_new['products_name'] = tep_get_products_name($products_new['products_id']);

$info_box_contents[$row][$col] = array('align' => 'center',

'params' => ' style="width:50%;"',

'text' => ''.tep_draw_prod_top().'

<table cellpadding="0" cellspacing="0" border="0">

<tr>

<td style="height:40px">'.$p_name.'</td>

</tr>

<tr>

<td>'.tep_draw_prod_top_1().''.$p_pic.''.tep_draw_prod_bottom_1().'</td>

</tr>

<tr>

<td class="middle" style="height:26px">'.$p_price.'</td>

</tr>

<tr>

<td class="middle" style="height:54px">

<a href="' . tep_href_link('product_info.php?products_id='.$p_id) . '">'.tep_image_button("button_details.gif").'</a><br style="line-height:1px;"><br style="line-height:2px;"><a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'">'.tep_image_button('button_add_to_cart2.gif').'</a> </td>

</tr>

</table>

'.tep_draw_prod_bottom().'');

 

 

$col ++;

if ($col > 1) {

$col = 0;

$row ++;

}

}

new contentBox($info_box_contents);

 

} else {

?>

<table border="0" cellspacing="0" cellpadding="0" class="box_width_cont">

<tr><td class="main"><?php echo TEXT_NO_NEW_PRODUCTS; ?></td></tr>

<tr><td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td></tr>

</table>

<?php

}

?>

 

<?php echo tep_draw_result_bottom(); ?>

 

<?php

if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {

?>

<?php echo tep_draw_result_top_2(); ?>

<table border="0" width="100%" cellspacing="0" cellpadding="0" class="result">

<tr>

<td><?php echo $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?></td>

<td class="result_right"><?php echo TEXT_RESULT_PAGE . ' ' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

</tr>

</table>

<?php echo tep_draw_result_bottom_2(); ?>

 

<?php

}

?>

 

<? tep_draw_heading_bottom_3();?>

 

<? tep_draw_heading_bottom();?>

 

</td>

<!-- body_text_eof //-->

<td class="col_right">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //--></body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

1. You missed an edit in catalog/index.php or in catalog/includes/modules/product_listing.php. Use your comparison program and look for the changes. All changes in More Pics are marked as per the instructions.

 

2. That file is very similar to the stock catalog/products_new.php. Use your comparison program and look for the changes.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I have searched this post and still cant find the info I need, so sorry if it has been covered.

 

in IE or firefox when I click on the pop up it opens the pop up about 1/4th of the way down the screen. When that happens I don't see the full image or the arrows for the next picture. Is there a way I can set the x,y position of the pop up, and set the pixel height for the pop up window. It seems to auto adjust in googles chrome just fine. but other web browsers it does not.

 

Thanks for the help.

 

Tim

Edited by TimSykes
Link to comment
Share on other sites

The popup is set by the Javascript in the head of the file. Take a look at:

<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le
ft=150')
}
//--></script>

Width and Height are the dimensions of the popup. I believe that screenX and screenY are the coordinates of the top left corner of the popup. The top and left variables also need to be set the same.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hey Jim thanks for the reply. I put in this code into popup_image.php and it changes nothing. Am I missing something? Also I am using the classic version of the contribution.

 

function popupWindow(url) {
 window.open(url,width=800,height=600,screenX=30,screenY=30,top=30,left=30)
}

 

 

thanks again

Edited by TimSykes
Link to comment
Share on other sites

also this is my full java script area

 

 

<script language="javascript"><!--

function popupWindow(url) {
 window.open(url,width=800,height=600,screenX=30,screenY=30,top=30,left=30)
}


var i=0;
function resize() {
<?php // BOF: More Pics 6 ?>
 if (document.layers) i=40;
 if (document.images[0]) window.resizeTo(document.images[0].width +1, document.images[0].height+160-i);
<?php // EOF: More Pics 6 ?>
 self.focus();
}

//--></script>

Link to comment
Share on other sites

  • 2 weeks later...

I was just wondering if anyone has ever got this contribution to work with "customer add products". I have the images going into the database but I can not get the images to upload to my server.

 

Does anyone have any suggestions?

Link to comment
Share on other sites

Okay, I know the answer is out there, but with 14 pages worth of posts to go through, I'm having issues finding it.

 

In my shop I'm using More Pics 2.0.6 (among other addons).

 

Almost everything works perfectly. The one exception is the width on secondary, tertiary, etc, images. The width (and height) always match whatever the first image is. So if the width of the first pic is 100 pixels, all the other images for that product will also be set to 100 pixels, no matter what the original width actually is.

 

An example for you to check is here

 

Please help.

 

Naloomi

Link to comment
Share on other sites

Can anyone tell me what part of the code makes the image upload to the server? I am trying to install customer add product with more pics. I have the customer add product working and now i am trying to add more pics to it.

 

Can anyone help?

Link to comment
Share on other sites

Does anyone know how when an image is on the server and someone uploads another image with the same name but different image to make it rename the second file.

 

This is a big issue that I have had with the more pics I used about a year or more ago. Everything else works good. Just that!

Link to comment
Share on other sites

More pics doesn't add to this code that i can see.

 

Is there something that I would be missing in the more pics that I can not get the images to upload to the server. They are going in the database but I can not get them to do to the server.

Link to comment
Share on other sites

That's correct, More Pics uses the standard code in exactly the same fashion as the stock image upload. It checks that the image has been saved to the server, using the save() method of the upload class, before it inserts the data in the database.

 

The only problem that I can see would be if the images directory has been renamed. Try changing Line 90 of admin/images.php to the following:

          $products_image->set_destination (DIR_FS_CATALOG_IMAGES);

 

Please let me know if that makes any difference.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I am using an older version of more pics. Where I can only upload 6 more images. This is the code that is on page that I think is similar to what would be in image.php, I have only provided two image codes but I do have more.

 

// copy image only if modified

$products_image = new upload('products_image');

$products_image->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image->parse() && $products_image->save()) {

$products_image_name = $products_image->filename;

} else {

$products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');

}

// BOF: More Pics 6

// copy subimage1 only if modified

$products_subimage1 = new upload('products_subimage1');

$products_subimage1->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_subimage1->parse() && $products_subimage1->save()) {

$products_subimage1_name = $products_subimage1->filename;

} else {

$products_subimage1_name = (isset($HTTP_POST_VARS['products_previous_subimage1']) ? $HTTP_POST_VARS['products_previous_subimage1'] : '');

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...