Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Dynamic MoPics


dreamscape

Recommended Posts

Hmmmm, I wonder what I am doing wrong, I have tried loads of things...

I get the thumbnail to load, and it is clickable, but when I click it I get a popup window that says:

"Requested image was not found."

 

I wonder what I am doing wrong.

 

I have a thumbnail called "L10.jpg"

and in catalog/images/images_big/L10.jpg

 

Help please?

Link to comment
Share on other sites

  • Replies 244
  • Created
  • Last Reply

Top Posters In This Topic

Hmmmm, I wonder what I am doing wrong, I have tried loads of things...

I get the thumbnail to load, and it is clickable, but when I click it I get a popup window that says:

"Requested image was not found."

 

I wonder what I am doing wrong.

 

I have a thumbnail called "L10.jpg"

and in catalog/images/images_big/L10.jpg

 

Help please?

Try if the same happens with a longer filename and all small letter, ie. testingl10.jpg

If you rename what you have now explicitly upload that file again through your product definition.

Link to comment
Share on other sites

I got it to work now, but only if both of the images are straight under /images tree... ..I really would like to have one folder for thumbs, and one for big images, so that I have all my product pictures in those 2 folders, I have a pottery and a glasblowery, and we make too much stuff =P

 

P.S it was my own fault it didnt work last time, I forgot to install the stuff in:

Dynamic_MoPics_v3.000\changed_files\MS2\catalog, i thought that that was a backup of stuff... ...man I am a terd =)

Link to comment
Share on other sites

I got it to work now, but only if both of the images are straight under /images tree... ..I really would like to have one folder for thumbs, and one for big images, so that I have all my product pictures in those 2 folders, I have a pottery and a glasblowery, and we make too much stuff =P

 

P.S it was my own fault it didnt work last time, I forgot to install the stuff in:

Dynamic_MoPics_v3.000\changed_files\MS2\catalog, i thought that that was a backup of stuff... ...man I am a terd =)

 

I couldnt find the edit button so I did this instead...

 

How do I add more pictures of products on the page, there where it says "No other images currently available", we have many different colors of the same glasses.

 

thanks guys, you are tha bomb

Link to comment
Share on other sites

I couldnt find the edit button so I did this instead...

 

How do I add more pictures of products on the page, there where it says "No other images currently available", we have many different colors of the same glasses.

 

thanks guys, you are tha bomb

Read the instructions with this contrib carefully as it also explains how to setup Dynamic Mopics.

In the default setup you have:

Your normal catalog/images directory

A catalog/images_big directory for all your large pictures

A catalog/images/thumbs directory for all your EXTRA thumb pictures

 

So when you define a product and assign a picture to it that, thumb, picture will be the main picture. It is important you link to the thumbnail of your main picture with the product. This main thumb picture is copied to the catalog/images directory as usual.

You yourself have to make sure that the large picture for the main (thumb) picture is copied to the catalog/images/images_big directory.

Now if you have more then one picture for a product all you have to do is:

1) Make sure your picture names obey to what you defined in your Mopics setup

ie. your main picture is called mymainpic.jpg. If you have three more pictures to go with that product you should name those mymainpic_pic1.jpg, mymainpic_pic2.jpg and mymainpic_pic3.jpg

2) Copy the large pictures, called mymainpic_pic1.jpg, mymainpic_pic2.jpg and mymainpic_pic3.jpg, to catalog/images/images_big

3) Copy the thumbnails pictures, which are also called mymainpic_pic1.jpg, mymainpic_pic2.jpg and mymainpic_pic3.jpg, to catalog/images/thumbs

 

In short for the default setup:

- all your large pictures should go into catalog/images/images_big (this you have to do yourself)

- the main thumbnail picture goes automatically to the catalog/images directory when you define your product and assign it a picture

- all other thumbnails go into the catalog/images/thumbs directory (also to be done by yourself)

 

Hope this clarifies it a bit more !

Link to comment
Share on other sites

Read the instructions with this contrib carefully as it also explains how to setup Dynamic Mopics.

In the default setup you have:

Your normal catalog/images directory

A catalog/images_big directory for all your large pictures

A catalog/images/thumbs directory for all your EXTRA thumb pictures

 

So when you define a product and assign a picture to it that, thumb, picture will be the main picture. It is important you link to the thumbnail of your main picture with the product. This main thumb picture is copied to the catalog/images directory as usual.

You yourself have to make sure that the large picture for the main (thumb) picture is copied to the catalog/images/images_big directory.

Now if you have more then one picture for a product all you have to do is:

1) Make sure your picture names obey to what you defined in your Mopics setup

ie. your main picture is called mymainpic.jpg. If you have three more pictures to go with that product you should name those mymainpic_pic1.jpg, mymainpic_pic2.jpg and mymainpic_pic3.jpg

2) Copy the large pictures, called mymainpic_pic1.jpg, mymainpic_pic2.jpg and mymainpic_pic3.jpg, to catalog/images/images_big

3) Copy the thumbnails pictures, which are also called mymainpic_pic1.jpg, mymainpic_pic2.jpg and mymainpic_pic3.jpg, to catalog/images/thumbs

 

In short for the default setup:

- all your large pictures should go into catalog/images/images_big (this you have to do yourself)

- the main thumbnail picture goes automatically to the catalog/images directory when you define your product and assign it a picture

- all other thumbnails go into the catalog/images/thumbs directory (also to be done by yourself)

 

Hope this clarifies it a bit more !

 

It didnt just clarify, it is perfection, and made it work as it should =)

Thank you good good Sir! (w00t)

Link to comment
Share on other sites

Hi can anyone help me, I had mopics working for months but in the last 2 days its stopped working. Im not sure if its because I added a contribution (product sort) although I didnt edit any files mopics uses or that my webhost suffered failure on the server and reloaded it to a new one which has php 4.3.9 MySQL 4.1.10a not sure if newer than previous version.

 

Anyway it loads the background for mo pics additional images but it will not show additional image thumbs or the click to enlarge first image

 

Thanks if anyone can solve this :thumbsup:

Link to comment
Share on other sites

Hi can anyone help me, I had mopics working for months but in the last 2 days its stopped working. Im not sure if its because I added a contribution (product sort) although I didnt edit any files mopics uses or that my webhost suffered failure on the server and reloaded it to a new one which has php 4.3.9 MySQL 4.1.10a not sure if newer than previous version.

 

Anyway it loads the background for mo pics additional images but it will not show additional image thumbs or the click to enlarge first image

 

Thanks if anyone can solve this :thumbsup:

 

hi,

 

check if your additional thumbnails are in the catalog/images/thumbs folder, that all your big images are in the catalog/images/images_big folder and that they have the correct naming!

Matthias Thoen

my contribution: Photo Gallery for osCommerce

--check my homepage in my CARD--

Link to comment
Share on other sites

hi,

 

check if your additional thumbnails are in the catalog/images/thumbs folder, that all your big images are in the catalog/images/images_big folder and that they have the correct naming!

 

I have just checked and they are all correct. I copied all the files for mopics which were in my shop and put them in a 2nd oscommerce store on the same server, installed the sql text and it worked but most of the admin control panel menus for mopics were missing.

 

How can I remove mopics from my sql and reinstall it

Link to comment
Share on other sites

no one can help :(

 

The only other problem it could be is that in my sql the configuration group id is very high 6509 and compared to the installation on the test shop (16) which is working.

 

Tom,

 

To clean up your configuration entries for Dynamic Mopics go to your phpMyAdmin and select the table called configuration_group. Browse that table and if DM was your last added contrib you should see a Dynamic Mopic entree at the last row from that table. Delete it.

Then do the same for the table called configuration. Browse to the last page and delete all entries where you see Dynamic Mopics within the name. Now you have cleaned database.

 

Then run the following SQL commands instead of those provided with the contrib

INSERT INTO `configuration_group` VALUES ('', 'Dynamic MoPics', 'The options which configure Dynamic MoPics.', '1', '1');
UPDATE `configuration_group` SET sort_order = last_insert_id() WHERE `configuration_group_id` = last_insert_id();

SET @id_config = last_insert_id();

INSERT INTO configuration VALUES ('', 'Big Images Directory', 'DYNAMIC_MOPICS_BIGIMAGES_DIR', 'images_big/', 'The directory inside catalog/images where your big images are stored.', @id_config, '0', NULL, now(), NULL, NULL),
							 ('', 'Thumbnail Images Directory', 'DYNAMIC_MOPICS_THUMBS_DIR', 'thumbs/', 'The directory inside catalog/images where you extra image thumbs are stored.', @id_config, '0', NULL, now(), NULL, NULL),
															 ('', 'Main Thumbnail In "Thumbnail Images Directory"', 'DYNAMIC_MOPICS_MAINTHUMB_IN_THUMBS_DIR', 'false', 'If you store your product\'s main thumbnail in the "Thumbnail Images Directory" set this to true.  If it is in the main image directory (uploaded via osCommerce admin), set it false.', @id_config, '0', NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),'),
							 ('', 'Extra Image Pattern', 'DYNAMIC_MOPICS_PATTERN', 'imagebase_pic{1}', 'Your custom defined pattern for extra images.  imagebase is the base of the main thumbnail.  Place the counting method between brackets {}.  Current counting methods can be 1, a, or A.  See readme for more information.', @id_config, '0', NULL, now(), NULL, NULL),
							 ('', 'Thumbnail Image Types', 'DYNAMIC_MOPICS_THUMB_IMAGE_TYPES', 'jpg, gif, jpeg, tiff, png, bmp', 'The types (extensions) of extra thumbnails you use, seperated by commas.', @id_config, '0', NULL, now(), NULL, NULL),
							 ('', 'Big Image Types', 'DYNAMIC_MOPICS_BIG_IMAGE_TYPES', 'jpg, gif, jpeg, tiff, png, bmp', 'The types (extensions) of big images you use, seperated by commas.', @id_config, '0', NULL, now(), NULL, NULL);

After this you should have again a Dynamic Mopics menu in your admin->configuration but this time with all options inside the menu.

 

When running SQL commands I have experienced similar problems where on my local Xampp installation the last_insert_id() is not handled as on my hosts server.

When the menu is correct the rest should work correctly also.

 

regards,

Howard

Link to comment
Share on other sites

Thanks for your help howard.

 

Its fixed the problem of not appearing in the admin but the images are still not appearing. Its as if mopics is not linking with database. The picture filenames and settings in the admin are all the same.

Link to comment
Share on other sites

Thanks for your help howard.

 

Its fixed the problem of not appearing in the admin but the images are still not appearing. Its as if mopics is not linking with database. The picture filenames and settings in the admin are all the same.

You have a link to look at ?

Link to comment
Share on other sites

With the main picture I don't see a Click to Enlarge link either and if that should have been there I think you missed some parts in the installation of mopics or removed too much by installing something else and touching mopics parts. The main picture shows fine so it does get picked up.

Link to comment
Share on other sites

With the main picture I don't see a Click to Enlarge link either and if that should have been there I think you missed some parts in the installation of mopics or removed too much by installing something else and touching mopics parts. The main picture shows fine so it does get picked up.

 

I replaced the popup_image.php with the one from mopics. If you click on reviews, there is a click to enlarge link that when clicked says requested image was not found

Link to comment
Share on other sites

I replaced the popup_image.php with the one from mopics. If you click on reviews, there is a click to enlarge link that when clicked says requested image was not found

 

Now I am guessing a bit as it might be something I have not (yet) used in my shop and have no experience with but do you have some type of SEO contrib installed which changes the URL ?

That would explain the problem as the URL link now points to a HTML file and not an image file. That also could explain why the rest of the pictures is not picked up because the extension it is looking for is .html and not .gif, .jpg or the other possibilities.

Link to comment
Share on other sites

Yes I have ultimate seo urls but this was installed a long time ago and they were both working fine together, only 2 days ago it has stopped working.

 

That was when I was moved to a different server and the server file path was a lot short something like var/www/html/catalog

 

the only other thing I did was at custom sort order but none of the files edited are used with mopics.

Edited by TDK
Link to comment
Share on other sites

Yes I have ultimate seo urls but this was installed a long time ago and they were both working fine together, only 2 days ago it has stopped working.

 

That was when I was moved to a different server and the server file path was a lot short something like var/www/html/catalog

 

the only other thing I did was at custom sort order but none of the files edited are used with mopics.

The custom sort order won't have anything to do with it but somehow seo url's is handled differently as it seems on your new server. I am pretty sure that is where the problem lies even though they did work together before.

When you look at the properties for the empty popup where normally the full blown image should appear it says

catalog/pure-silence-silent-120mm-18dba-thermistor-fan-pi-31.html

With my shop it is saying

popup_image.php?pID=513&type=jpg
Link to comment
Share on other sites

I fixed it :D

 

Turns out the problem was that when my host changed servers they changed the address of the admin and catalog configure files but missed out one line.

 

Thanks for you help :thumbsup:

Link to comment
Share on other sites

  • 2 weeks later...

Hi. Is there anyway (i'm sure there is but I couldn't figure it out) to only show the dynamic mopics module if there are actually other images for an item? It would be much 'cleaner' to not show the 'Other images for this product', 'no other images currently available' if there are no other images.

 

I recently installed a related products contribution and it only shows that module if there are actually related products. It uses an if statement so 'if there are other images' show the module, else do not.

 

Can this be done with mopics?

 

Thanks!

Link to comment
Share on other sites

Hey,

 

I'm trying to get dynamic mopics working but have been running into a couple issues, as my product_info page has been altered several times for other contributions. When you click a product on my test site instead of popping up a new window it opens in the same window. eg: http://www.silksplash.com/test and click on the sample product and you'll see what I mean. I'm pasting the entire contents of my product_info.php file below in the hope that someone can skim over it and point out an error or two I might be missing. Thanks a lot.

 

Product_info.php:

<?php
/*
 $Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $

 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');

 //// BEGIN:  Added for Dynamic MoPics v3.000
 // include dynamic mopics functions
 require(DIR_WS_FUNCTIONS . 'dynamic_mopics.php');
 //// END:  Added for Dynamic MoPics v3.000

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

 $product_check_query = tep_db_query("select count(*) as total 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_check = tep_db_fetch_array($product_check_query);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head><?php
// BOF: WebMakers.com Changed: Header Tag Controller v2.5.2
// Replaced by header_tags.php
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?> 
 <title><?php echo TITLE; ?></title>
<?php
}
// EOF: WebMakers.com Changed: Header Tag Controller v2.5.2
?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript" type="text/javascript"><!--
/* DDB - 041031 - Form Field Progress Bar */
/***********************************************
* Form Field Progress Bar- By Ron Jonk- http://www.euronet.nl/~jonkr/
* Modified by Dynamic Drive for minor changes
* Script featured/ available at Dynamic Drive- http://www.dynamicdrive.com
* Please keep this notice intact
***********************************************/
function textCounter(field,counter,maxlimit,linecounter) {
// text width//
var fieldWidth =  parseInt(field.offsetWidth);
var charcnt = field.value.length;		
// trim the extra text
if (charcnt > maxlimit) { 
	field.value = field.value.substring(0, maxlimit);
} else { 
// progress bar percentage
var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit);
document.getElementById(counter).style.width =  parseInt((fieldWidth*percentage)/100)+"px";
document.getElementById(counter).innerHTML="Limit: "+percentage+"%"
// color correction on style from CCFFF -> CC0000
setcolor(document.getElementById(counter),percentage,"background-color");
}
}
function setcolor(obj,percentage,prop){
obj.style[prop] = "rgb(80%,"+(100-percentage)+"%,"+(100-percentage)+"%)";
}
</script>
<?php
//// BEGIN:  Added for Dynamic MoPics v3.000
?>
<link rel="stylesheet" type="text/css" href="dynamic_mopics.css">
<script language="javascript" type="text/javascript"><!--
 function popupImage(url, imageHeight, imageWidth) {
var newImageHeight = (parseInt(imageHeight) + 40);
var yPos = ((screen.height / 2) - (parseInt(newImageHeight) / 2));
var xPos = ((screen.width / 2) - (parseInt(imageWidth) / 2));

imageWindow = window.open(url,'popupImages','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,re
sizable=yes,copyhistory=no,width=' + imageWidth + ',height=' + newImageHeight + ',screenY=' + yPos + ',screenX=' + xPos + ',top=' + yPos + ',left=' + xPos);

imageWindow.moveTo(xPos, yPos);
imageWindow.resizeTo(parseInt(imageWidth), parseInt(newImageHeight));

if (window.focus) {
  imageWindow.focus();
}
 }
 </script>
<?php
//// END:  Added for Dynamic MoPics v3.000
?>
</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="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
 if ($product_check['total'] < 1) {
?>
  <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 {
$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 . "'");

if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
  $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 {
  $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="smallText">[' . $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
	//// BEGIN:  Added for Dynamic MoPics v3.000
if (tep_not_null($product_info['products_image'])) {
?>
	  <table border="0" cellspacing="0" cellpadding="2" align="right">
		<tr>
		  <td align="center" class="smallText">
<?php
		$image_lg = mopics_get_imagebase($product_info['products_image'], DIR_WS_IMAGES . DYNAMIC_MOPICS_BIGIMAGES_DIR);
		if ($lg_image_ext = mopics_file_exists(DIR_FS_CATALOG . $image_lg, DYNAMIC_MOPICS_BIG_IMAGE_TYPES)) {
			$image_size = @getimagesize(DIR_FS_CATALOG . $image_lg . '.' . $lg_image_ext);
?>
	  <script language="javascript" type="text/javascript"><!--
		document.write('<a href="javascript:popupImage(\'<?php echo tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&type=' . $lg_image_ext); ?>\',\'<?php echo ((int)$image_size[1] + 30); ?>\',\'<?php echo ((int)$image_size[0] + 5); ?>\');"><?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); ?><br /><span class="smallText"><?php echo TEXT_CLICK_TO_ENLARGE; ?></span></a>');
	  //--></script>
	  <noscript>
		<a href="<?php echo tep_href_link($image_lg . '.' . $lg_image_ext); ?>" target="_blank"><?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image'], stripslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); ?><br /><span class="smallText"><?php echo TEXT_CLICK_TO_ENLARGE; ?></span></a>
	  </noscript>
<?php
		} else {
	  echo tep_image(DIR_WS_IMAGES . $product_info['products_image'], stripslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
		}
?>
		  </td>
		</tr>
	  </table>
<?php
}
	//// END:  Added for Dynamic MoPics v3.000
?>
	  <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
		//clr 030714 update query to pull option_type
  $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment 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)) {
			//clr 030714 add case statement to check option type
	switch ($products_options_name['products_options_type']) {
	  case PRODUCTS_OPTIONS_TYPE_TEXT:
		//CLR 030714 Add logic for text option
		$products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");
		$products_attribs_array = tep_db_fetch_array($products_attribs_query);
		$tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_length'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] .'">  ' . $products_options_name['products_options_comment'];
		if ($products_attribs_array['options_values_price'] != '0') {
		  $tmp_html .= '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')';
		}
?>
		<tr>
		  <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
		  <td class="main"><?php echo $tmp_html;  ?></td>
		</tr>
<?php
		break;

	  case PRODUCTS_OPTIONS_TYPE_TEXTAREA:
		//CLR 030714 Add logic for text option
		$products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");
		$products_attribs_array = tep_db_fetch_array($products_attribs_query);
	$tmp_html = '<textarea onKeyDown="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" 
							   onKeyUp="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" 
							   onFocus="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" 
							   wrap="soft" 
							   name="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" 
							   rows=5 
							   id="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" 
							   value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] . '"></textarea>
					<div id="progressbar' . $products_options_name['products_options_id'] . '" class="progress"></div>
					<script>textCounter(document.getElementById("id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"),"progressbar' . $products_options_name['products_options_id'] . '",' . $products_options_name['products_options_length'] . ')</script>';?>	<!-- DDB - 041031 - Form Field Progress Bar //-->
		<tr>
<?php
		if ($products_attribs_array['options_values_price'] != '0') {
?>
		  <td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ' ' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ')'; ?></td>
<?php	   } else {
?>
		  <td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ')'; ?></td>
<?php		}
?>
		  <td class="main"><?php echo $tmp_html;  ?></td>
		</tr>
<?php
		break;

	  case PRODUCTS_OPTIONS_TYPE_RADIO:
		//CLR 030714 Add logic for radio buttons
		$tmp_html = '<table>';
		$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'");
		$checked = true;
		while ($products_options_array = tep_db_fetch_array($products_options_query)) {
		  $tmp_html .= '<tr><td class="main">';
		  $tmp_html .= tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options_array['products_options_values_id'], $checked);
		  $checked = false;
		  $tmp_html .= $products_options_array['products_options_values_name'];
		  $tmp_html .=$products_options_name['products_options_comment'];
		  if ($products_options_array['options_values_price'] != '0') {
			$tmp_html .= '(' . $products_options_array['price_prefix'] . $currencies->display_price($products_options_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
		  }
		  $tmp_html .= '</tr></td>';
		}
		$tmp_html .= '</table>';
?>
		<tr>
		  <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
		  <td class="main"><?php echo $tmp_html;  ?></td>
		</tr>
<?php
		break;
	  case PRODUCTS_OPTIONS_TYPE_CHECKBOX:
		//CLR 030714 Add logic for checkboxes
		$products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");
		$products_attribs_array = tep_db_fetch_array($products_attribs_query);
		echo '<tr><td class="main">' . $products_options_name['products_options_name'] . ': </td><td class="main">';
		echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']);
		echo $products_options_name['products_options_comment'];
		if ($products_attribs_array['options_values_price'] != '0') {
		  echo '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
		}
		echo '</td></tr>';
		break;
	  default:
		//clr 030714 default is select list
		//clr 030714 reset selected_attribute variable
		$selected_attribute = false;
			$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 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 . "'");
			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) . $products_options_name['products_options_comment'];  ?></td>
		</tr>
<?php
	}  //clr 030714 end switch
  } //clr 030714 end while
?>
	  </table>
<?php
} //clr 030714 end if
?>
	</td>
  </tr>
  <?php
	//// BEGIN:  Added for Dynamic MoPics v3.000
?>
		<tr>
			<td>
			<div class="screenshotsHeader">
				<div class="screenshotsHeaderText"><?php echo TEXT_OTHER_PRODUCT_IMAGES; ?></div>
			</div>
			<div class="screenshotsBlock">
				<?php include(DIR_WS_MODULES . 'dynamic_mopics.php'); ?>
			</div>
			</td>
		</tr>
<?php
	//// END:  Added for Dynamic MoPics v3.000
if ($reviews['count'] > 0) {
?>
   <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);
?>
  <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>
			<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>
<?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>
<!-- 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'); ?>

Link to comment
Share on other sites

  • 1 month later...
Hi. Is there anyway (i'm sure there is but I couldn't figure it out) to only show the dynamic mopics module if there are actually other images for an item? It would be much 'cleaner' to not show the 'Other images for this product', 'no other images currently available' if there are no other images.

 

I recently installed a related products contribution and it only shows that module if there are actually related products. It uses an if statement so 'if there are other images' show the module, else do not.

 

Can this be done with mopics?

 

Thanks!

 

Just wondering if anyone had any thoughts on this?

 

Thanks!

Link to comment
Share on other sites

  • 1 month later...

I searched high and low and didn't find this thread till a moderator pointed it out to me!

 

Has anyone worked out a way to have the pop-up images to appear with a 'previous/next' button like in the similar Mopics Contribution?

 

My Dynamic Mopics is working fine but I was wondering if anyone has fiddled with the code to getthe images to show up like they do in Mopics.

 

Also, is anyone actually got the 'upload images from admin' part working because the last update doesn't work.

 

Thanks

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

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...