Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Dynamic MoPics


dreamscape

Recommended Posts

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

I don't know the 'normal' Mopics but using Dynamic Mopics myself it's definitely on my wishlist to get it working with a prev/next button. Also a proper delete for all pictures when removing products would be nice to have. I have no problem with the image upload from admin while using the latest version. But as discussed earlier it might be going wrong when you want all thumbs together which feature I have never tried nor used. With the basic settings it should give no trouble.

Link to comment
Share on other sites

  • Replies 244
  • Created
  • Last Reply

Top Posters In This Topic

I don't know the 'normal' Mopics but using Dynamic Mopics myself it's definitely on my wishlist to get it working with a prev/next button. Also a proper delete for all pictures when removing products would be nice to have. I have no problem with the image upload from admin while using the latest version. But as discussed earlier it might be going wrong when you want all thumbs together which feature I have never tried nor used. With the basic settings it should give no trouble.

i'll add on the latest update and give it another go, maybe it was me that coded something wrong so i'll try to get it going.

 

the previous/next buttons would be advantageous - i'm going to download the MOPICS contribution and see how the previous/next works in that, then try to make the additions to fit into DYNAMIC MOPICS.... if it has anything to do with SQL then I will be useless as that is my weakness but i'll give it a shot.

 

BTW: this is an awesome contribution :-)

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

  • 5 weeks later...

i realy loved this contrib!

 

but for the main picture, osCommerce still would take the large picture and just resize it to show a thumbnail.

 

i made a little contrib to change this, using a REAL thumbnail additional to the large image (for the MAIN image).

 

just follow the link to the contrib in my signature ;)

let me know if you liked it, through private messages =)

contrib: Dynamic MoPics BandWith Saver:

http://www.oscommerce.com/community/contributions,1114

Link to comment
Share on other sites

Hi,

 

Running into a bit of trouble when I try to import the sql file (INSTALL_v3.000.sql) for Dynamic Mopics v3.000. I'm using phpmyadmin to import it to a mySQL 5.0 DB (new install). Couldn't find a similiar error when I did a search in the forums.

 

I get the following error:

 

Error

SQL query:

 

INSERT INTO `configuration_group`

VALUES (

 

'', 'Dynamic MoPics', 'The options which configure Dynamic MoPics.', '1', '1'

);

 

 

 

MySQL said:

 

#1264 - Out of range value adjusted for column 'configuration_group_id' at row 1

 

 

Thanks in advance.

Link to comment
Share on other sites

  • 3 weeks later...
well I still didnt get mine to work, but I found an alternate solution.

I changed the configuration to show only one thumb and changed the big_Images extension to _pic1 and so now when someone clicks on the front cover thumb image - the big back cover opens.

I also changed the link below to read "Click for back cover"

 

 

FROM TOM: Numerous hints - yours helped me to solve my problem. Thanks so much, man!

 

-- TOM -- http://www.catwalktci.de

Link to comment
Share on other sites

I recently installed version 3.000 of the MoPics contribution. I'm encountering some strange behavior.

 

In the readme and installation notes it seems to suggest that I go into the administration side and configure it to know where to find the big image and thumbnails as well as additional thumbnails. In my administration I only see the option to pick a place where the big images are. It does not give me an option to pick where the thumbnails go.

 

So I thought, no big deal, I'll just use the regular images folder and it should be fine. Well it semi-works in that I can get one thumbnail to work and it blows up into the bigger image but I can't get any of the additional images to show up. The box that says "Other Images for This Product" remains empty. The naming convention I'm using is just as it's specified for testing I called the file testimage.jpg for addtional pictures I named it testimage_a.jpg.

 

Later I noticed in the instructions it mentions putting the "a" in {} brackets so I tried that using testimage_{a}.jpg and it's still not functioning.

 

I think it has something to do with the first thing I talked about where in the admin side it doesn't give me the option to choose a thumbnails folder.

 

I'd appreciate any help. Thanks!

Link to comment
Share on other sites

Upon further investigation it looks like something is happening with the install of the SQL script. It's adding the big image directory selection in the admin panel but nothing else. Here's the code

 

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();
INSERT INTO configuration VALUES ('', 'Big Images Directory', 'DYNAMIC_MOPICS_BIGIMAGES_DIR', 'images_big/', 'The directory inside catalog/images where your big images are stored.', last_insert_id(), '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.', last_insert_id(), '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.', last_insert_id(), '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.', last_insert_id(), '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.', last_insert_id(), '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.', last_insert_id(), '0', NULL, now(), NULL, NULL);

 

I don't know sql that well but comparing it with the one thing that IS working it appears everything else should also work as it's identical more or less. Again thanks in advance for any help.

Link to comment
Share on other sites

I've installed everything it looks like properly, but something's still really confusing me that reading through these posts I don't think I found the explanation for entirely. The dynamic regcognition of thumnails occurs during upload, or you have to ftp the files into the folders right, each product has to have it's own directory then within that thumb and bigpicture directories right. But then how from the add new product page do you get it to reconize the images? There's only an upload area it seems from that page, am I missing something there? Should there be a way to link images from that page by a directory call inside oscommerce?

Link to comment
Share on other sites

TabulaRasa,

The script did the same thing to me. I fixed the sql script. This one will work (assuming the ID of 17 is ok with you. If 17 is already in use pick another number.

 

INSERT INTO `configuration_group` VALUES ('17', 'Dynamic MoPics', 'The options which configure Dynamic MoPics.', '17', '1');

 

INSERT INTO configuration VALUES ('', 'Big Images Directory', 'DYNAMIC_MOPICS_BIGIMAGES_DIR', 'images_big/', 'The directory inside catalog/images where your big images are stored.', '17', '17', NULL, now(), NULL, NULL);

 

INSERT INTO configuration VALUES ('', 'Thumbnail Images Directory', 'DYNAMIC_MOPICS_THUMBS_DIR', 'thumbs/', 'The directory inside catalog/images where you extra image thumbs are stored.', '17', '17', NULL, now(), NULL, NULL);

 

INSERT INTO configuration VALUES ('', '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.', '17', '17', NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

 

INSERT INTO configuration VALUES ('', '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.', '17', '17', NULL, now(), NULL, NULL);

 

INSERT INTO configuration VALUES ('', '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.', '17', '17', NULL, now(), NULL, NULL);

 

INSERT INTO configuration VALUES ('', '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.', '17', '17', NULL, now(), NULL, NULL);

Link to comment
Share on other sites

TabulaRasa,

The script did the same thing to me. I fixed the sql script. This one will work (assuming the ID of 17 is ok with you. If 17 is already in use pick another number.

 

INSERT INTO `configuration_group` VALUES ('17', 'Dynamic MoPics', 'The options which configure Dynamic MoPics.', '17', '1');

 

INSERT INTO configuration VALUES ('', 'Big Images Directory', 'DYNAMIC_MOPICS_BIGIMAGES_DIR', 'images_big/', 'The directory inside catalog/images where your big images are stored.', '17', '17', NULL, now(), NULL, NULL);

 

INSERT INTO configuration VALUES ('', 'Thumbnail Images Directory', 'DYNAMIC_MOPICS_THUMBS_DIR', 'thumbs/', 'The directory inside catalog/images where you extra image thumbs are stored.', '17', '17', NULL, now(), NULL, NULL);

 

INSERT INTO configuration VALUES ('', '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.', '17', '17', NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

 

INSERT INTO configuration VALUES ('', '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.', '17', '17', NULL, now(), NULL, NULL);

 

INSERT INTO configuration VALUES ('', '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.', '17', '17', NULL, now(), NULL, NULL);

 

INSERT INTO configuration VALUES ('', '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.', '17', '17', NULL, now(), NULL, NULL);

As installations differ from person to person it can be dangerous to just pick a number. Read one page back, post #211, where you will find a proper solution in case the SQL statements give trouble.

Link to comment
Share on other sites

This makes MoPics go away if there aren't any additional pics for the product. Just put this in catalog/product_info.php.

 

<?php

//// BEGIN: Added for Dynamic MoPics v3.000

// Backwards support for older osCommerce versions

if (isset($product_info_values) && is_object($product_info_values)) {

$product_info =& $product_info_values;

}

 

// Set the thumbnail basename; replaces "imagebase" in the user's pattern

$image_base = mopics_get_imagebase($product_info['products_image'], DIR_WS_IMAGES . DYNAMIC_MOPICS_THUMBS_DIR);

 

// Set the large image's basename; replaces "imagebase" in the user's pattern

$image_base_lg = mopics_get_imagebase($product_info['products_image'], DIR_WS_IMAGES . DYNAMIC_MOPICS_BIGIMAGES_DIR);

 

// Get the counting method for the user's pattern (1,2,3; a,b,c; A,B,C; etc)

$i = mopics_getmethod(DYNAMIC_MOPICS_PATTERN);

 

// Set the search for the str_replace pattern search/replace

$search = array('imagebase', mopics_match_pattern(DYNAMIC_MOPICS_PATTERN));

 

// Set the initial replace for the str_replace pattern search/replace

$replace = array($image_base, $i);

 

if (mopics_file_exists(DIR_FS_CATALOG . str_replace($search, $replace, DYNAMIC_MOPICS_PATTERN))) {

?>

<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

?>

Link to comment
Share on other sites

  • 3 months later...

I have been trying to install this contrib for the past day or so and I seem to be chasing my own tail.

 

I have HeaderTags_v2.5.9.1 installed and I don't think it likes playing with MoPics. I used Beyond Compare as well as the instructions from the zip file and everything seems to be fine - code wise - yet the "click image to enlarge" has vanished and the only currency symbol that now appears is a $ sign (I also use ? and ? ).

 

Can anyone give me any advice please as I would like to implement this on a new site.

 

Thanks in advance :'(

Link to comment
Share on other sites

  • 5 months later...

Hi,

 

Can anyone help me. I've installed the contrib and only recently started to use it to display extra pictures of the products (pictures sent in by customers of the products in action to be exact). The problem is that if I have more than 1 extra picture, the images start to overlap (second one is placed over part of the first one) even though there is at least 500px of free space left for the picture to fit in.

 

I don't know why the images overlap when there is so much free space to the right. Any ideas why they overlap? I've using a high resolution so it should display with lots of free space by technically it should display in 600x800 with no overlapping as the thumbnails and pages are small enough to fit on that without scrolling or anything overlapping.

 

Anyone else have this problem?

 

Thanks

Link to comment
Share on other sites

  • 2 months later...

I'm receiving this occasionally in my apache error_log:

 

[Thu Jun 14 05:25:45 2007] [error] PHP Warning: main(includes/languages//popup_image.php): failed to open stream: No such file or directory in /htdocs/catalog/popup_image.php on line 26

[Thu Jun 14 05:25:45 2007] [error] PHP Fatal error: main(): Failed opening required 'includes/languages//popup_image.php' (include_path='.:/pear/lib:/var/www/pear/lib') in /htdocs/catalog/popup_image.php on line 26

 

So I look at line 26 of catalog/popup_image.php and this line is there:

 

require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . FILENAME_POPUP_IMAGE);

 

Looks ok to me. Does anyone know why I'm seeing this error? Why the double slashes?

 

TIA!

Link to comment
Share on other sites

  • 1 month later...

Is anyone using this?

It looks like there hasn't been an update in a while, and there haven't been many posts to the forum thread lately. So is there another contrib people are using?

I'm looking for a contribution, so I can put 1 to 12 photos on each item page. Each photo MUST have a label or caption.

What should I use?

Thanks, Matt

Link to comment
Share on other sites

  • 7 months later...
Is anyone using this?

It looks like there hasn't been an update in a while, and there haven't been many posts to the forum thread lately. So is there another contrib people are using?

I'm looking for a contribution, so I can put 1 to 12 photos on each item page. Each photo MUST have a label or caption.

What should I use?

Thanks, Matt

 

 

This is your best bet if you want to work on the backend via FTP and such. If you want to manage your pics (add/remove) via admin panel, this is not for you.

mmmmmmmmmmmm. Doughnuts . . . haha. i said nuts.

Link to comment
Share on other sites

  • 3 months later...

I am having problems with this contribution. Since moving servers the extra pics do not work. After some investigation and debugging I found that the mopics_file_exists() function was not working. the php file_exists() function seems to be the problem. I have tried replacing file_exists() with my own function but I end up with a never ending loop of thumbnail pictures. It seems to return true even if the image does not exist.

 

Here is my version of the function taken from a PHP resource site:

 

function file_exists_2($filePath)
{
return ($ch = curl_init($filePath)) ? @curl_close($ch) || true : false;
}
	function mopics_file_exists($file_base, $file_types = DYNAMIC_MOPICS_THUMB_IMAGE_TYPES) {
	$file_types = str_replace(' ', '', $file_types);
	$file_types = split('[,]', $file_types);

	foreach ($file_types as $file_type) {
		if (file_exists_2($file_base . '.' . $file_type)) {
			return $file_type;
		}
	}

	return false;
}

 

The code before I modified (that returned False even if the image exists):

 

function mopics_file_exists($file_base, $file_types = DYNAMIC_MOPICS_THUMB_IMAGE_TYPES) {
	$file_types = str_replace(' ', '', $file_types);
	$file_types = split('[,]', $file_types);

	foreach ($file_types as $file_type) {
		if (file_exists($file_base . '.' . $file_type)) {
			return $file_type;
		}
	}

	return false;
}

 

 

Note: I am using php5.

 

 

Please help..

 

Thanks, Gareth.

Link to comment
Share on other sites

Has anyone else got this working with PHP 5.. I have just tried it with safe_mode off and its still not working ....

 

I have had to bypass the code that works out which files are on the server and used count (glob()) to limit the number of times it loops to find all the product images.

 

 

$num_of_images = count (glob($image_base_lg .  '*.jpg'));
$number_of_images_thumb = count (glob($image_base_lg .  '*.thumb*')); /// I have thumps resized that are counted! hence count the ones with thumb.
$number_of_images = $num_of_images - $number_of_images_thumb;

 

while ($image_ext = mopics_file_exists(DIR_FS_CATALOG .  str_replace($search, $replace, DYNAMIC_MOPICS_PATTERN)) AND $row < $number_of_images) {

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