Jump to content
spooks

Simple Multi Image Add-on (Un-Limited) with FancyBox Popups

Recommended Posts

Thanks for this contribution, it is really what I needed for the site.

 

Everything seems to be working I think but in the admin/images panel I don't see these

 

 

Tiny Image Width default 30

Tiny Image Height default 30

Additional images per row/column default 3

Additional Image Format default horizontal

 

 

also, I'm not sure if its my original size of the images but I uploaded additional images and they are huge.

 

Thanks in advance!

Share this post


Link to post
Share on other sites

Tiny Image Width default 30

Tiny Image Height default 30

Additional images per row/column default 3

Additional Image Format default horizontal

 

 

It would your sql partly failed when u ran it, apply this one, it will add those.

 

INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) 
VALUES ('Tiny Image Width', 'TINY_IMAGE_WIDTH', '30', 'Image width for additional image thumbnail', 4, 20, NULL, now(), '', '');
INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) 
VALUES ('Tiny Image Height', 'TINY_IMAGE_HEIGHT', '30', 'Image height for additional image thumbnail', 4, 21, NULL, now(), '', '');
INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) 
VALUES ('Additional images per row/column', 'TINY_IMAGE_GROUP_SIZE', '3', 'Number of additional images to show per row/column in the product display', 4, 22, NULL, now(), '', '');
INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) 
VALUES ('Additional Image Format', 'ADDITIONAL_IMAGE_FORMAT', 'horizontal', 'Show additional image in a vertical or horizontal format', 4, 23, NULL, now(), '', 'tep_cfg_select_option(array(\'horizontal\', \'vertical\'),');

 

Without that your thumbnails will be full size images, perhaps thats your issue?


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

It would your sql partly failed when u ran it, apply this one, it will add those.

 

INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) 
VALUES ('Tiny Image Width', 'TINY_IMAGE_WIDTH', '30', 'Image width for additional image thumbnail', 4, 20, NULL, now(), '', '');
INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) 
VALUES ('Tiny Image Height', 'TINY_IMAGE_HEIGHT', '30', 'Image height for additional image thumbnail', 4, 21, NULL, now(), '', '');
INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) 
VALUES ('Additional images per row/column', 'TINY_IMAGE_GROUP_SIZE', '3', 'Number of additional images to show per row/column in the product display', 4, 22, NULL, now(), '', '');
INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) 
VALUES ('Additional Image Format', 'ADDITIONAL_IMAGE_FORMAT', 'horizontal', 'Show additional image in a vertical or horizontal format', 4, 23, NULL, now(), '', 'tep_cfg_select_option(array(\'horizontal\', \'vertical\'),');

 

Without that your thumbnails will be full size images, perhaps thats your issue?

 

awesome! thanks! everything seems to be working now

Share this post


Link to post
Share on other sites

anyone managed to get the FancyBox popups to work with STS?

 

 

ivanio http://forums.oscomm.../263361-ivanio/ has stated he has it working fine with that, you could ask him for instructions, or post in the STS support thread, I believe it should be staight forward.

 

If it helps, I noticed with STS on your page was missing all the header additions. ohmy.gif

 

If you find a solution, it would be helpful to others if you would post it here. biggrin.gif


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Hello, thank you for your contribution. I installed your contribution in my osC 2.2 MS2. When I access the admin/products occurs this error:

Fatal error: Call to undefined function tep_hide_session_id () in /home/epicstor/public_html/shop/admin/categories.php on line 870

 

Someone knows this error?

 

You could get the function from 2.2RC2a as spooks mentioned or just remove

tep_hide_session_id() .

from the entire page (only if you have the old version of osc).

 

This will save you from copying and replacing as the instructions require you.

Share this post


Link to post
Share on other sites

I'm having the same problem as timmle in post #124.

 

When I click on a product to open the product_info.php page, I get this error:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /public_html/shop/includes/functions/database.php on line 103

I followed the instructions for product_info.php and redid this step twice! I'm still getting this error.

 

However, when I use the file you provided in the package I don't have this problem.

Could it be that because I am using a custom template there is some problem caused by that?

 

Btw, I'm using the old osCommerce (the milestone edition).

Share this post


Link to post
Share on other sites

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource

 

If the supplied works & yours dos'nt you have made errors, often people manage to repeat the same errors several times, try again, or try using a file compare tool.


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource

 

If the supplied works & yours dos'nt you have made errors, often people manage to repeat the same errors several times, try again, or try using a file compare tool.

 

There was some conflicts between the instructions found in the word document and the file product_info.php included in the package.

I used the compare tool to find the conflicts and managed to get it fixed.

Share this post


Link to post
Share on other sites

Hello again,

 

everytime with any template i use, the prroduct info uses 100% width of browser size. I already tried to fix that back to some pixels smaller, but it doesnt work.

is there anything i got to consider?

 

thanks

Share this post


Link to post
Share on other sites

product info uses 100% width of browser size

 

Its a standard osC file, which all use 100% of available width, u must set that, many templates use bad techniques for setting size, modifying root files for that un-neccesarily, Center & size Shop http://addons.oscommerce.com/info/1485 shows the easy way, changing the header/footer only.


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

I am having a difficult time getting product_info.php sorted.

 

I have several mods already in the file and the overlaps are tricky. I have SMI installed and no errors are being thrown.

The issue I have is simply "no picture" is showing on product_info.

The file already has snippets installed for:

Separate Pricing Per Customer

QPBPP for SPPC

MVS V1.2

HeaderTags SEO

MVS and MVS Ship Estimator

 

I also did notice a lot of differences between the intructions and the actual file. Winmerge and I had a long night.

I've posted my "almost working" product_info.php below. If anyone can suggest what might be out of place, or out of order, or missing/wrong, please help.

<?php
/*
 $Id: product_info.php 1739 2007-12-20 00:52:16Z hpdl $
 adapted for Separate Pricing Per Customer v4.2 2007/06/23, adapted for QPBPP for SPPC v2.0 2008/11/09
 $Loc: /catalog/ $
 $Mod: MVS V1.2 2009/02/28 JCK/CWG $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');
$image_group = TINY_IMAGE_GROUP_SIZE; //Number of images to show per row/column
$vertical_format = (ADDITIONAL_IMAGE_FORMAT == 'vertical');

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

// Simple multi image addon	
 $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_array, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
   $product_info = tep_db_fetch_array($product_info_query);
	$products_image_array = unserialize($product_info['products_image_array']);
   if (!is_array($products_image_array)) $products_image_array = array();
// EOF Simple multi image addon
// BOF Separate Pricing per Customer
 if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') {
   $customer_group_id = $_SESSION['sppc_customer_group_id'];
 } else {
   $customer_group_id = '0';
 }
// EOF Separate Pricing per Customer
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- Simple multi image addon -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<!-- EOF Simple multi image addon	 -->
<html <?php echo HTML_PARAMS; ?>>
<head>
<?php
/*** Begin Header Tags SEO ***/
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?>
 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
 <title><?php echo TITLE; ?></title>
<?php
}
/*** End Header Tags SEO ***/
?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<?php // MVS Shipping Estimator Start ?>
<script language="javascript" type="text/javascript"><!--
function estimatorpopupWindow(URL) {
 window.open(URL,'productsshippingestimator','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600')
}
//--></script>
<?php // MVS Shipping Estimator End ?>

<!-- Simple multi image addon -->
<script type="text/javascript" src="<?php echo DIR_WS_IMAGES ?>js/jquery.js"></script>
<script type="text/javascript" src="<?php echo DIR_WS_IMAGES ?>js/jquery.fancybox.js"></script>
<script type="text/javascript" src="<?php echo DIR_WS_IMAGES ?>js/jquery.easing.js"></script>
<script type="text/javascript" src="<?php echo DIR_WS_IMAGES ?>js/jquery.easydrag.handler.beta2.js"></script>
<link rel="stylesheet" href="<?php echo DIR_WS_IMAGES ?>js/fancybox.css" type="text/css" media="screen">
<script type="text/javascript">
	$(document).ready(function() {
		$("div#fancy a").fancybox({
	'zoomSpeedIn':	800, 
	'zoomSpeedOut':	700, 
	'hideOnContentClick' : false,
	'overlayShow':	<?php echo (DIM_BACKGROUND == 'true' ? 'true' : 'false'); ?>,
	'overlayOpacity': <?php echo (BKG_LUMA/10); ?>,
	'zoomOpacity': 	true,
	<?php if (SWING_POPUP == 'true') echo "'easingIn' : 'easeOutBack',"; ?>
	'hideOnContentClick': false

});
<?php if (DRAG_POPUP == 'true') echo '$("#fancy_outer").easydrag();'; ?>
});

</script>
<style type="text/css">
<?php if (SHOW_NAV == 'true') echo 'span#fancy_left_ico {left: 20px;}  span#fancy_right_ico {right: 20px;}';
				switch (POS_NAV) {
								case 'top':
								echo 'span.fancy_ico { top: 38px; }';
								break;
							case 'bottom':
								echo 'span.fancy_ico { bottom: 20px; }';
								break;
							default:
								echo 'span.fancy_ico { top: 50%; }';
								break;
								}		
								?>

</style>

<!--[if IE 6]> 
<style type="text/css"> 
div#fancy_bg {display: none;} 
div#fancy_content, 
div#fancy_inner, 
div#fancy_outer {background-color: transparent; background-image: url 
(); border: 1;} 
</style> 
<![endif]--> 
<!-- title fixes -->
<?php if (strlen($product_info['products_name']) > 40) {
$title = wordwrap($product_info['products_name'], 40, '<br>');
?>
<style type="text/css">
div#fancy_title {
text-align:center;
}
div#fancy_title table td {
 padding-top: 10px;
vertical-align: top;
}
td#fancy_title_left, td#fancy_title_right, td#fancy_title_main {height: 52px; background: #000 url();} 

</style>
<!--[if IE]>
<style type="text/css">
td#fancy_title_left {
background: transparent url(<?php echo DIR_WS_IMAGES ?>js/fancy_title_left.png) repeat-x;
}

td#fancy_title_main {
background: transparent url(<?php echo DIR_WS_IMAGES ?>js/fancy_title_main.png) repeat-x;
}

td#fancy_title_right {
background: transparent url(<?php echo DIR_WS_IMAGES ?>js/fancy_title_right.png) repeat-x;
}
</style>
<![endif]-->
<?php } else {$title = $product_info['products_name']; } ?>


<!-- EOF Simple multi image addon -->
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<?php /*** Begin Header Tags SEO ***/ ?>
<a name="<?php echo $header_tags_array['title']; ?>"></a>
<?php /*** End Header Tags SEO ***/ ?>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
// Simple multi image addon	
 if (!tep_db_num_rows($product_info_query)) {
// EOF Simple multi image addon	
?>
     <tr>
       <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
<?php
 } else {
//// Simple multi image addon	section moved to line 23
//    $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
//    $product_info = tep_db_fetch_array($product_info_query);
   tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
// BOF QPBPP for SPPC
   $pf->loadProduct((int)$_GET['products_id'], (int)$languages_id);
   $products_price = $pf->getPriceString();
// EOF QPBPP for SPPC
   if (tep_not_null($product_info['products_model'])) {
     $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
   } else {
     $products_name = $product_info['products_name'];
   }

// BOF QPBPP for SPPC
 $min_order_qty = $pf->getMinOrderQty();
if ($min_order_qty > 1) {
     $products_name .= '<br><span class="smallText">' . MINIMUM_ORDER_TEXT . $min_order_qty . '</span>';
   }
// EOF QPBPP for SPPC
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <?php /*** Begin Header Tags SEO ***/ ?>
           <td valign="top"><h1><?php echo $products_name; ?></h1></td>
           <td align="right" valign="top"><h1><?php echo $products_price; ?></h1></td>
           <?php /*** End Header Tags SEO ***/ ?>
	  </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td class="main">
<?php
   if (tep_not_null($product_info['products_image'])) {
?>
                 <!-- Simple multi image addon -->
			 <div id="fancy">
			  <table border="0" cellspacing="0" cellpadding="2" align="right">
           <tr>
             <td align="center" class="smallText">

<?php $m_source = ''; $thumb = (class_exists('oscthumb') && CFG_MASTER_SWITCH == 'On'); if ($thumb) { preg_match('/"([^"]+)"/',htmlentities ( tep_image(DIR_WS_IMAGES . $product_info['products_image'],'','','','','',5), ENT_NOQUOTES), $image);  $m_source=str_replace('&','&',$image[1]); }
 echo '<a  rel="image_group" title="'.$product_info['products_name'].'" href="' . ($m_source ? $m_source : DIR_WS_IMAGES . $product_info['products_image']) . '" alt="' . $product_info['products_name'] . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"', false, 5) . '<br /></a>'; 
              if(!$vertical_format) { echo ''; $row = 1; reset($products_image_array); while (list($key, $value) = each($products_image_array)) { 
						 if ($thumb) {					 
						 $source = ''; preg_match('/"([^"]+)"/',htmlentities ( tep_image(DIR_WS_IMAGES . $value,'','','','','',5), ENT_NOQUOTES), $image);  $source=str_replace('&','&',$image[1]); 
						 } 
						 echo '<a  rel="image_group" title="'.$product_info['products_name'].'" href="' . ($source ? $source : DIR_WS_IMAGES . $value) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $value, $product_info['products_name'], TINY_IMAGE_WIDTH, TINY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; 

							++$row; if ($row > $image_group) { echo '<br />'; $row = 1; } } } 
							echo '</td>';
						 if($vertical_format) { echo '<td>'; $row = 1; reset($products_image_array); while (list($key, $value) = each($products_image_array)) { 
						 if ($thumb) {					 
						 $source = ''; preg_match('/"([^"]+)"/',htmlentities ( tep_image(DIR_WS_IMAGES . $value,'','','','','',5), ENT_NOQUOTES), $image);  $source=str_replace('&','&',$image[1]); 
						 } 
						 echo '<a  rel="image_group" title="'.$product_info['products_name'].'" href="' . ($source ? $source : DIR_WS_IMAGES . $value) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $value, $product_info['products_name'], TINY_IMAGE_WIDTH, TINY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . '</a>'; 

								++$row; if ($row > $image_group) { echo '</td><td>'; $row = 1; } } echo '</td>'; } ?>


           </tr><?php  echo '<tr><td><a  rel="image_group" title="'.$product_info['products_name'].'" href="' . tep_href_link(($m_source ? $m_source : DIR_WS_IMAGES . $product_info['products_image']), $product_info['products_name']) . '" target="_blank">' . TEXT_CLICK_TO_ENLARGE . '</a></td></tr>'; ?>
         </table>
				</div>
				<!-- EOF Simple multi image addon -->
<?php
   }
?>
         <!-- </td></tr><tr><td  class="smallText"> --><p><?php echo stripslashes($product_info['products_description']); ?></p>
<?php
// BOF SPPC Hide attributes from customer groups
   $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 ");
   $products_attributes = tep_db_fetch_array($products_attributes_query);
   if ($products_attributes['total'] > 0) {
?>
         <table border="0" cellspacing="0" cellpadding="2">
           <tr>
             <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
           </tr>
<?php
     $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 order by popt.products_options_name");
     while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
       $products_options_array = array();
       $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0");
	$list_of_prdcts_attributes_id = '';
	$products_options = array(); // makes sure this array is empty again
       while ($_products_options = tep_db_fetch_array($products_options_query)) {
	$products_options[] = $_products_options;
	$list_of_prdcts_attributes_id .= $_products_options['products_attributes_id'].",";
}

     if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') { 
        $select_list_of_prdcts_attributes_ids = "(" . substr($list_of_prdcts_attributes_id, 0 , -1) . ")";
 $pag_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES_GROUPS . " where products_attributes_id IN " . $select_list_of_prdcts_attributes_ids . " AND customers_group_id = '" . $customer_group_id . "'");
 while ($pag_array = tep_db_fetch_array($pag_query)) {
	 $cg_attr_prices[] = $pag_array;
 }

 // substitute options_values_price and prefix for those for the customer group (if available)
 if ($customer_group_id != '0' && tep_not_null($cg_attr_prices)) {
    for ($n = 0 ; $n < count($products_options); $n++) {
	 for ($i = 0; $i < count($cg_attr_prices) ; $i++) {
		 if ($cg_attr_prices[$i]['products_attributes_id'] == $products_options[$n]['products_attributes_id']) {
			$products_options[$n]['price_prefix'] = $cg_attr_prices[$i]['price_prefix'];
			$products_options[$n]['options_values_price'] = $cg_attr_prices[$i]['options_values_price'];
		 }
	 } // end for ($i = 0; $i < count($cg_att_prices) ; $i++)
    }
       } // end if ($customer_group_id != '0' && (tep_not_null($cg_attr_prices))
     } // end if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0')

  for ($n = 0 ; $n < count($products_options); $n++) {
         $products_options_array[] = array('id' => $products_options[$n]['products_options_values_id'], 'text' => $products_options[$n]['products_options_values_name']);
         if ($products_options[$n]['options_values_price'] != '0') {
           $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options[$n]['price_prefix'] . $currencies->display_price($products_options[$n]['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
         }
       }
// EOF SPPC attributes mod

       if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
         $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
       } else {
         $selected_attribute = false;
       }
?>
           <tr>
             <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
             <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
           </tr>
<?php
     }
?>
         </table>
<?php
   }
?>
       </td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
   $reviews = tep_db_fetch_array($reviews_query);
   if ($reviews['count'] > 0) {
?>
     <tr>
       <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   }

   if (tep_not_null($product_info['products_url'])) {
?>
     <tr>
       <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   }

   if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
     <tr>
       <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
     </tr>
<?php
   } else {
?>
     <tr>
       <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>
     </tr>
<?php
   }
?>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>
<?php
// MVS Shipping Estimator start
   if (SHIP_ESTIMATOR_BUTTON_PRODUCTS_INFO == 'true') {
     echo '                <td class="main" align=center><a href="javascript:estimatorpopupWindow(\'' .  tep_href_link (FILENAME_PRODUCTS_SHIP_ESTIMATOR, 'pid=' . (int) $_GET['products_id'], 'SSL') . '\')">' . tep_image_button ('button_estimate_shipping.gif', IMAGE_BUTTON_SHIP_ESTIMATOR) . '</a></td>';
   }
// MVS Shipping Estimator end
?>
<?php // BOF QPBPP for SPPC ?>
               <td class="main" align="right">
                 <table border="0" align="right">
                   <tr><td class="main" align="center">
                     <?php echo TEXT_ENTER_QUANTITY . ":" . tep_draw_input_field('cart_quantity', $pf->adjustQty(1), 'size="6"'); ?>
                   </td></tr>
                   <tr><td align="center">
                     <?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>
                   </td></tr>
          </table>
               </td>
<?php // EOF QPBPP for SPPC ?>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <!--- BEGIN Header Tags SEO Social Bookmarks -->
     <?php if (HEADER_TAGS_DISPLAY_SOCIAL_BOOKMARKS == 'true')
      include(DIR_WS_MODULES . 'header_tags_social_bookmarks.php');
     ?>
     <!--- END Header Tags SEO Social Bookmarks -->
     <tr>
       <td>
<?php
   if ((USE_CACHE == 'true') && empty($SID)) {
     echo tep_cache_also_purchased(3600);
   } else {
     include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
   }
 }
?>
       </td>
     </tr>
     <?php /*** Begin Header Tags SEO ***/ ?>
     <tr>
      <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
      <td class="smallText" align="center"><?php echo TEXT_VIEWING; ?> 
      <?php echo '<a title="' . $header_tags_array['title'] . '" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id'], 'NONSSL') . '"/# ' . $header_tags_array['title'] . '">' . $header_tags_array['title']; ?></a></td>
     </tr>
     <?php /*** End Header Tags SEO ***/ ?>
   </table></form></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

Thank you for the assistance


-Dave

Share this post


Link to post
Share on other sites

No pics with sppc

 

The differences to the instructions is the title fixes are missing there, as they are temporary.

 

I`ve checked your file & its fine, with the sppc disabled (I don't have that)

 

Either your images are missing (check in admin that products have main images at least) or sppc is interfering with the dbase read, i note its doing smthg on line 197

 

try commenting that part of the file to check if that is the case.


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

No pics with sppc

 

The differences to the instructions is the title fixes are missing there, as they are temporary.

 

I`ve checked your file & its fine, with the sppc disabled (I don't have that)

 

Either your images are missing (check in admin that products have main images at least) or sppc is interfering with the dbase read, i note its doing smthg on line 197

 

try commenting that part of the file to check if that is the case.

 

I found that if I uncomment line 194 and 195 the image comes back.

The query in 194 is the original without the p.products_image_array added as it is up at line 23

 

What changes would you suggest to make it all proper...

 

Awesome support! thank you!


-Dave

Share this post


Link to post
Share on other sites

I found that if I uncomment line 194 and 195 the image comes back.

The query in 194 is the original without the p.products_image_array added as it is up at line 23

 

What changes would you suggest to make it all proper...

 

Awesome support! thank you!

 

 

Does'nt make a lot of sense! the query being moved should make no differences, u could use the query ealier plus additions in that position, it implies smthg is interfering with the resource, as I said I suspect sppc.

 

The reasons for the move are.

 

1. the original head query is just to check if item exist, since that can be done with the tep_db_num_rows function on the final query, it makes little sense to have the old.

 

2. Placeing the query in the head means you have access for tags etc within the head to the data, you will note on the version you have installed the data is accessed in the head for checking the product name.

 

you could try moving

 

// BOF QPBPP for SPPC

$pf->loadProduct((int)$_GET['products_id'], (int)$languages_id);

$products_price = $pf->getPriceString();

// EOF QPBPP for SPPC

 

to above the query in the head, (move the seesions stuff above it too) see what that does.

 

 


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Hello again,

 

everytime with any template i use, the prroduct info uses 100% width of browser size. I already tried to fix that back to some pixels smaller, but it doesnt work.

is there anything i got to consider?

 

thanks

 

I think this is because you are using the products_info.php provided with the package. I had that same problem.

 

What you need to do is take the original product_info.php from the template you are using and add the changes from the instructions.

If that gives you an error "Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /public_html/shop/includes/functions/database.php on line 103" then just let me know and I can fix it for you as I had to do the same thing yesterday.

Share this post


Link to post
Share on other sites

 

2. Placeing the query in the head means you have access for tags etc within the head to the data, you will note on the version you have installed the data is accessed in the head for checking the product name.

 

 

Please clarify - should the query you've moved to the top of the file be "above" <head>?

 

or "between" <head></head>

 

Your file has it above <head>

 

Just wish to clarify - Thanks!


-Dave

Share this post


Link to post
Share on other sites

Please clarify - should the query you've moved to the top of the file be "above" <head>?

 

or "between" <head></head>

 

 

Sorry, yes, I ment at the top of the file be "above" <head>


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

hi,

 

 

the contri is great the image is showing but i have 1 issue when i click the product image from homepage the page body size changed it becames uncenterd but the header an footer remain.. please check.. but if you click home. everything is normal....

 

 

sample picture

 

thanks and takecare

br,

parot

Edited by loneparot

Share this post


Link to post
Share on other sites

 

 

What u meant was the product_info page body is shrunk.

 

You have made errors in the install, this does not change any page dimensions.

 

Go over the install again, or try the included file, or use a file compare tool to install on existing page (often easier than the manual install.


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

i just decided to try this contribution and i really like it. everything is fine except for one small error. on my product_info page i get this message at the top of the page.

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/monstes5/public_html/catalog/includes/functions/database.php on line 88

 

i think this error is in the product_info.php file because the error popped up after i edited it. i never messed with the database.php file. i double checked the modifications i made to the product_info file to see if i did something wrong during the installation but i didn't find anything wrong. my product_info page does have a few other contributions on it, so that might have caused the problem.

 

here is my product_info code:

<?php
 require('includes/application_top.php');

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

// Simple multi image addon
$image_group = TINY_IMAGE_GROUP_SIZE; //Number of images to show per row/column
$vertical_format = (ADDITIONAL_IMAGE_FORMAT == 'vertical');  
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_array, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
   $product_info = tep_db_fetch_array($product_info_query);
	$products_image_array = unserialize($product_info['products_image_array']);
   if (!is_array($products_image_array)) $products_image_array = array();
// EOF Simple multi image addon

 $product_check = tep_db_fetch_array($product_check_query);

// BOF Separate Pricing per Customer
 if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') {
   $customer_group_id = $_SESSION['sppc_customer_group_id'];
 } else {
   $customer_group_id = '0';
 }
// EOF Separate Pricing per Customer

$navigation->set_snapshot();
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<?php
# cDynamic Meta Tags
/*<title><?php echo TITLE; ?>*/
require(DIR_WS_INCLUDES . 'meta_tags.php');
#
?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<!-- Simple multi image addon -->
<script type="text/javascript" src="<?php echo DIR_WS_IMAGES ?>js/jquery.js"></script>
<script type="text/javascript" src="<?php echo DIR_WS_IMAGES ?>js/jquery.fancybox.js"></script>
<script type="text/javascript" src="<?php echo DIR_WS_IMAGES ?>js/jquery.easing.js"></script>
<script type="text/javascript" src="<?php echo DIR_WS_IMAGES ?>js/jquery.easydrag.handler.beta2.js"></script>
<link rel="stylesheet" href="<?php echo DIR_WS_IMAGES ?>js/fancybox.css" type="text/css" media="screen">
<script type="text/javascript">
	$(document).ready(function() {
		$("div#fancy a").fancybox({
	'zoomSpeedIn':	800, 
	'zoomSpeedOut':	700, 
	'hideOnContentClick' : false,
	'overlayShow':	<?php echo (DIM_BACKGROUND == 'true' ? 'true' : 'false'); ?>,
	'overlayOpacity': <?php echo (BKG_LUMA/10); ?>,
	'zoomOpacity': 	true,
	<?php if (SWING_POPUP == 'true') echo "'easingIn' : 'easeOutBack',"; ?>
	'hideOnContentClick': false

});
<?php if (DRAG_POPUP == 'true') echo '$("#fancy_outer").easydrag();'; ?>
});

</script>
<style type="text/css">
<!--
<?php if (SHOW_NAV == 'true') echo 'span#fancy_left_ico {left: 20px;}  span#fancy_right_ico {right: 20px;}';
				switch (POS_NAV) {
								case 'top':
								echo 'span.fancy_ico { top: 38px; }';
								break;
							case 'bottom':
								echo 'span.fancy_ico { bottom: 20px; }';
								break;
							default:
								echo 'span.fancy_ico { top: 50%; }';
								break;
								}		
								?>
// -->
</style>

<!--[if IE 6]> 
<style type="text/css"> 
div#fancy_bg {display: none;} 
div#fancy_content, 
div#fancy_inner, 
div#fancy_outer {background-color: transparent; background-image: url 
(); border: 1;} 
</style> 
<![endif]--> 
<!-- EOF Simple multi image addon -->

</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<div id="wrapper">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<table width="942" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
  <td style="background: url(images/template/left_border.gif) repeat-y;width:7px;height:100%;"></td>
	<td colspan="11" bgcolor="#0A0909"><!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
 // Simple multi image addon
 if (!tep_db_num_rows($product_info_query)) {
 // EOF Simple multi image addon
?>
     <tr>
       <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
<?php
 } else {
   // Simple multi image addon	section moved

   tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

   if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
// BOF Separate Pricing per Customer
     if ($customer_group_id > 0) { // only need to check products_groups if customer is not retail
       $scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id =  '" . $customer_group_id . "'");
       if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
         $product_info['products_price']= $scustomer_group_price['customers_group_price'];
      }
     } // end if ($customer_group_id > 0)
// EOF Separate Pricing per Customer

     $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
   } else {
// BOF Separate Pricing per Customer
     if ($customer_group_id > 0) { // only need to check products_groups if customer is not retail
       $scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id =  '" . $customer_group_id . "'");
       if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
       $product_info['products_price']= $scustomer_group_price['customers_group_price'];
    }
   } // end if ($customer_group_id > 0)
// EOF Separate Pricing per Customer
     $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   }

   if (tep_not_null($product_info['products_model'])) {
     $products_name = $product_info['products_name'] . '<br><span class="modelText">[' . $product_info['products_model'] . ']</span>';
   } else {
     $products_name = $product_info['products_name'];
   }
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
           <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td class="main">
<?php
   if (tep_not_null($product_info['products_image'])) {
?>
<!-- Simple multi image addon -->
			 <div id="fancy">
			  <table border="0" cellspacing="0" cellpadding="2" align="right">
           <tr>
             <td align="center" class="smallText">

<?php $m_source = ''; $thumb = (class_exists('oscthumb') && CFG_MASTER_SWITCH == 'On'); if ($thumb) { preg_match('/"([^"]+)"/',htmlentities ( tep_image(DIR_WS_IMAGES . $product_info['products_image'],'','','','','',5), ENT_NOQUOTES), $image);  $m_source=str_replace('&','&',$image[1]); }
 echo '<a  rel="image_group" title="'.$product_info['products_name'].'" href="' . ($m_source ? $m_source : DIR_WS_IMAGES . $product_info['products_image']) . '" alt="' . $product_info['products_name'] . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"', false, 5) . '<br /></a>'; 
              if(!$vertical_format) { echo ''; $row = 1; reset($products_image_array); while (list($key, $value) = each($products_image_array)) { 
						 if ($thumb) {					 
						 $source = ''; preg_match('/"([^"]+)"/',htmlentities ( tep_image(DIR_WS_IMAGES . $value,'','','','','',5), ENT_NOQUOTES), $image);  $source=str_replace('&','&',$image[1]); 
						 } 
						 echo '<a  rel="image_group" title="'.$product_info['products_name'].'" href="' . ($source ? $source : DIR_WS_IMAGES . $value) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $value, $product_info['products_name'], TINY_IMAGE_WIDTH, TINY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; 

							++$row; if ($row > $image_group) { echo '<br />'; $row = 1; } } } 
							echo '</td>';
						 if($vertical_format) { echo '<td>'; $row = 1; reset($products_image_array); while (list($key, $value) = each($products_image_array)) { 
						 if ($thumb) {					 
						 $source = ''; preg_match('/"([^"]+)"/',htmlentities ( tep_image(DIR_WS_IMAGES . $value,'','','','','',5), ENT_NOQUOTES), $image);  $source=str_replace('&','&',$image[1]); 
						 } 
						 echo '<a  rel="image_group" title="'.$product_info['products_name'].'" href="' . ($source ? $source : DIR_WS_IMAGES . $value) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $value, $product_info['products_name'], TINY_IMAGE_WIDTH, TINY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . '</a>'; 

								++$row; if ($row > $image_group) { echo '</td><td>'; $row = 1; } } echo '</td>'; } ?>


           </tr><?php  echo '<tr><td><a  rel="image_group" title="'.$product_info['products_name'].'" href="' . tep_href_link(($m_source ? $m_source : DIR_WS_IMAGES . $product_info['products_image']), $product_info['products_name']) . '" target="_blank">' . TEXT_CLICK_TO_ENLARGE . '</a></td></tr>'; ?>
         </table>
				</div>
<!-- EOF Simple multi image addon -->
<?php
   }
?>
         <p><?php echo stripslashes($product_info['products_description']); ?></p>
<?php
   $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
   $products_attributes = tep_db_fetch_array($products_attributes_query);
   if ($products_attributes['total'] > 0) {
?>
         <table border="0" cellspacing="0" cellpadding="2">
           <tr>
             <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
           </tr>
<?php
     $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
     while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
       $products_options_array = array();
       // BOF Linkmatics attributes sets plus
         $products_options_query = tep_db_query("
         SELECT pov.products_options_values_id, pov.products_options_values_name, 
              pa.options_values_price, pa.price_prefix , pase.sort_order
             FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . 
                   TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS . " pas2pa, " . 
                   TABLE_PRODUCTS_ATTRIBUTES_SETS . " pas, " .
                   TABLE_PRODUCTS_ATTRIBUTES_SETS_ELEMENTS . " pase, " .
                   TABLE_PRODUCTS_OPTIONS_VALUES . " pov
                   WHERE      pa.products_id = '" . (int)$_GET['products_id'] . "'           
               AND pa.options_id = '" . $products_options_name['products_options_id'] . "'
               AND pas2pa.products_id = pa.products_id
               AND pas.products_attributes_sets_id = pas2pa.products_attributes_sets_id
               AND pas.products_options_id = pa.options_id
               AND pase.products_attributes_sets_id = pas.products_attributes_sets_id
               AND pase.options_values_id = pa.options_values_id
               AND pov.products_options_values_id = pa.options_values_id
               AND pov.language_id = '" . $languages_id . "'
               ORDER BY pase.sort_order, pa.options_values_price");
				 // >>>>> BOF Linkmatics attributes sets plus patch v1.01
          if (tep_db_num_rows($products_options_query)== 0 ) {
				   $products_options_query = tep_db_query("
              SELECT pov.products_options_values_id, pov.products_options_values_name,
                     pa.options_values_price, pa.price_prefix , pa.options_values_id
                FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " .
                         TABLE_PRODUCTS_OPTIONS_VALUES . " pov
                WHERE pa.products_id = '" . (int)$_GET['products_id'] . "'
                  AND pa.options_id = '" . $products_options_name['products_options_id'] . "'
                  AND pov.products_options_values_id = pa.options_values_id
                  AND pov.language_id = '" . $languages_id . "'
                ORDER BY pa.options_values_price");
          }
         // <<<<< EOF Linkmatics attributes sets plus patch v1.01      
         // EOF Linkmatics attributes sets plus
       while ($products_options = tep_db_fetch_array($products_options_query)) {
         $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
         if ($products_options['options_values_price'] != '0') {
           $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
         }
       }

       if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
         $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
       } else {
         $selected_attribute = false;
       }
?>
           <tr>
             <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
             <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
           </tr>
<?php
     }
?>
         </table>
         <?php echo 'Quantity:   '?><input type="text" name="quantity" value="1" maxlength="2" size="2">
<?php
   }
?>
       </td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
   $reviews = tep_db_fetch_array($reviews_query);
   if ($reviews['count'] > 0) {
?>
     <tr>
       <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   }

   if (tep_not_null($product_info['products_url'])) {
?>
     <tr>
       <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   }

   if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
     <tr>
       <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
     </tr>
<?php
   } else {
?>
     <tr>
       <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>
     </tr>
<?php
   }
?>      <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main"><?php echo '<a href="javascript: history.go(-1)">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
               <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td>
<tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td>
<?php
   //if ((USE_CACHE == 'true') && empty($SID)) {
     //echo tep_cache_also_purchased(3600);
   //} else {
     //include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
   //}
 }
?>
       </td>
     </tr>
   </table></form></td>
       </td>
     </tr>
   </table></form></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
     </td>
  <td style="background: url(images/template/right_border.gif) repeat-y;width:7px;height:100%;"></td>
</tr>
</table>
</div>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

and just in case it is needed, here is the code for lines 88-90 on my database.php file:

 function tep_db_fetch_array($db_query) {
   return mysql_fetch_array($db_query, MYSQL_ASSOC);
 }

Share this post


Link to post
Share on other sites

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

 

 

You have made errors in the install, often people manage to repeat the same errors several times, try again, or try using a file compare tool, or use the supplied file.smile.gif


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

 

 

You have made errors in the install, often people manage to repeat the same errors several times, try again, or try using a file compare tool, or use the supplied file.smile.gif

 

i double checked manually and with a file compare program and still managed to miss the error.

 

i just checked manually for the third time and found the error in the first 10 lines of the file. <_<

 

i missed one of the lines when replacing. now i feel stupid.

Share this post


Link to post
Share on other sites

What u meant was the product_info page body is shrunk.

 

You have made errors in the install, this does not change any page dimensions.

 

Go over the install again, or try the included file, or use a file compare tool to install on existing page (often easier than the manual install.thanks

 

 

thanks for the reply SAm

 

i used the included file i also try the winmerge. but still the same...

 

any idea?

 

 

please help

 

 

br,

parot

Share this post


Link to post
Share on other sites

 

 

I'm afraid your site is all messed up, you must ensure you follow the basic html rules to ensure compatibility with standard files (the supplied aqre stanard 2.2rc2a versions)

 

I see 2 sets of <head> 2 sets of <body> & 2 of <html> you must have only one of each, your header section also opens a table it fails to close.

 

It is imperative you fix these errors, as if you even descide to revert, google will not like your site in this state as it will display wildley different on different browsers.


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

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

×