Jump to content
spooks

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

Recommended Posts

I have got Fancybox working perfectly, but now I have a big problem cause I have several options in each product, it is, color, so I do not want to create 4 products for each colour...I can create attributes with a contribution, but I would like to know how I could show images associated to each option... is it possible to adapt fancybox contribution (this one from this post) to take images from attributes ??..

 

I hope anyone could give me a light about this¡¡¡¡

 

Thanks in advances,

 

 

Any image or set of images on the page could use the function, it sounds like your looking for an options add-on, there is one called smthg like options as images, look for it in add-ons


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'm getting the "Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in public_html/shop/includes/functions/database.php on line 103" when I click on a product. I've been everywhere on this forum looking for the answer. I even ran the SQL you mentioned on Nov 10. I followed the dorections perfectly and I've done stuff like this before....

 

The only thing I ran during install was on product_info.php

 

YOU SAID TO:

 

 

 

 

Find (124):


         <table border="0" cellspacing="0" cellpadding="2" align="right">
           <tr>
             <td align="center" class="smallText">
<script language="javascript"><!--
document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" 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"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript>
             </td>
           </tr>
         </table>

Replace With:

        <!-- Simple multi image addon -->
			 <div id="fancy">
			  <table border="0" cellspacing="0" cellpadding="2" align="right">
           <tr>
             <td align="center" class="smallText">

<?php if (strlen($product_info['products_name']) > $max_title_length) {  $title = wordwrap(htmlspecialchars($product_info['products_name']), $max_title_length, '<br>');
        } else { $title = htmlspecialchars($product_info['products_name']); } 
$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="'.$title.'" 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); foreach($products_image_array as $value) { 
						 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="'.$title.'" 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); foreach($products_image_array as $value) { 
						 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="'.$title.'" 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 class="smallText">' . TEXT_CLICK_TO_ENLARGE . '</td></tr>'; ?>
         </table>
				</div>
				<!-- EOF Simple multi image addon -->

____________________________________________________________________________

 

I couldnt find that??? The closest I have in this crappy TM template is:

 

<?php
   if (tep_not_null($product_info['products_image'])) {
?>
											<table cellspacing="0" cellpadding="0" border="0" class="product">
												<tr><td>
														<table cellspacing="0" cellpadding="0" border="0">
															<tr><td height="100%">
	<table cellpadding="0" cellspacing="0" border="0" align="left" class="prod_info" style="border-right:13px solid #ffffff;border-left:0px solid #ffffff;">
		<tr><td class="pic" align="center"> <br style="line-height:1px;"><br style="line-height:9px;">

<?php /*  echo tep_draw_prod_top();  */?>

<script language="javascript"><!--
document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ' style="margin:0px 0px 0px 0px;"') . ''; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ' style="margin:0px 0px 0px 0px;"') . ''; ?>
</noscript>

<?php /*  echo tep_draw_prod_bottom();  */?>

		</td></tr>
		<tr><td align="center">
<script language="javascript"><!--
document.write('<?php echo '<div><a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . TEXT_CLICK_TO_ENLARGE . '</a></div>'; ?>');
//--></script>
<noscript>
<?php echo '<div><a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank"><br style="line-height:7px">' . TEXT_CLICK_TO_ENLARGE . '</a></div>'; ?>
</noscript>
		</td></tr>
	</table>
	<table cellpadding="0" cellspacing="0" border="0">
		<tr><td style="vertical-align:middle; height:28px;"><em><?php echo $products_name; ?></em></td></tr>
	</table>

<div class="padd3"><?php echo stripslashes($product_info['products_description']); ?>
<br><br style="line-height:11px"><span class="productSpecialPrice"><?=$products_price?></span></div>																	

															   </td></tr>

														</table>
													</td>
												</tr>
											</table>
<?php
   }
?>

 

ANY HELP would be greatly appreciated!!! Thanks a bunch for this contrib and for maintaining it.

 

Thanks!

Edited by DeanDesign

Share this post


Link to post
Share on other sites

 

 

1 please read the FAQ

2 its impossible to support tgemplates as their code is too bad/altered

3 Its against forum rules to support commercial products

4 Compare your 'hacked' file with the original from the rc2a distrib, find out what is supposed to be there.


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

One easy question for those who know how this contribution works....

 

How can I get (write down code if possible) the name of each aditional image, that is, inside the field called "products_name_array" in products table.I need to show in the pop up layer showing aditional images , the name of the image, not the product one (for example, if the image is called "red shoes.jpg", I want to display below the image, in the popup, "red shoes". In the contribution, the name shown is the product`s name.

 

Thanks in advance.

Edited by javibmw

Share this post


Link to post
Share on other sites

One easy question for those who know how this contribution works....

 

How can I get (write down code if possible) the name of each aditional image, that is, inside the field called "products_name_array" in products table.I need to show in the pop up layer showing aditional images , the name of the image, not the product one (for example, if the image is called "red shoes.jpg", I want to display below the image, in the popup, "red shoes". In the contribution, the name shown is the product`s name.

 

Thanks in advance.

 

 

Within product info.php the array $products_image_array contains all the additional image file names, it contains no other data. when that array is read each entry is placed into the $value string in turn, use that.


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

This add-on is really great! Just have 3 questions:

 

1. How can I adjust the size of the "New Products" images on the homepage?

2. How can I adjust the size of the images on the actual product info page?

3. Is there anyway to add a border to each image? E.g. a 1px black border so the images look nicer in the random "What's New?" section on the left of the page? The images I am going to use will have a white background that stands out against the grey on my template. I have seen the border that comes with oscThumb but it's 3D...

 

Thank you!

Share this post


Link to post
Share on other sites

This add-on is really great! Just have 3 questions:

 

1. How can I adjust the size of the "New Products" images on the homepage?

2. How can I adjust the size of the images on the actual product info page?

3. Is there anyway to add a border to each image? E.g. a 1px black border so the images look nicer in the random "What's New?" section on the left of the page? The images I am going to use will have a white background that stands out against the grey on my template. I have seen the border that comes with oscThumb but it's 3D...

 

Thank you!

 

Image thumbnail sizes are set in admin

borders can be set via your css


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

Image thumbnail sizes are set in admin

borders can be set via your css

Thanks for the reply!

 

Which part of the admin changes the thumbnail size? I've played around with the settings but nothing seems to do it...

 

Borders in the css...okay, I'll give that a go - thanks!

Share this post


Link to post
Share on other sites

Which part of the admin changes the thumbnail size? I've played around with the settings but nothing seems to do it...

 

admin-> images

 

unless u have a thumbnailer installed, if so could be elsewhere.


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

admin-> images

 

unless u have a thumbnailer installed, if so could be elsewhere.

Ah...I installed oscThumb as recommended...

Share this post


Link to post
Share on other sites

What a great contribution, I can't wait to take some more pictures!

 

One issue I have...I should be able to find this, but man...Know when you are looking so hard for something, you look right past it?

 

Check this out...Click Here

 

See the ''; ?> sneaking a peek from behind the picture?

 

I can't find this to save my life...any ideas?

Share this post


Link to post
Share on other sites

I've a problem now it's different then before:

 

first it was:

preious and next image where always displaying at the middle

 

now:

the 2 images are only displaying if you're on that side of the image and at the top:O

 

How can i fix this to normal

 

Link to my website to see it:

http://kawaiishop.nl/oscommerce/catalog/product_info.php?products_id=1

Share this post


Link to post
Share on other sites

 

 

I cant tell what u mean, and do'nt see any issue on the page??


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

 

See the ''; ?> sneaking a peek from behind the picture?

 

 

 

u have placed a php close tag after a php close tag, no idea where, u have the code!!


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 spooks,

 

just wanna say THANKS! Downloaded, installed (little changes because a previous mod

already changed the admin/categories.php), but all running well :) Perfect! :thumbsup:

Share this post


Link to post
Share on other sites

I installed this addon. After that i installed STS 4.5.9. After that it was working not the way iit was owrking first (the good way)? How can I fix that? So it's good again?

Share this post


Link to post
Share on other sites

Thanks you very much for your replies, I used $values to get the name and everything is ok....but.....now, I have one question, i don`t know if anybody has had this problem or not...

 

When I upload an additional image, it is saved , but, if i decide to change this image by another, this change is not made, and it is shown the first image again.... what is happening?? any idea??

Edited by javibmw

Share this post


Link to post
Share on other sites

I installed this addon. After that i installed STS 4.5.9. After that it was working not the way iit was owrking first (the good way)? How can I fix that? So it's good again?

 

 

And you though not to mention that!!!! rolleyes.gif

 

If you look ealier in this thread there are instructions for STS. wink.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

Personally know peopl your help so to adjust the position of the window facybox on my page it is working out perfectly the action

So I need this change I tried but I can not succeed.

I know many here are very experienced and therefore I appeal to you please!

 

Thank you!

Share this post


Link to post
Share on other sites

Personally know peopl your help so to adjust the position of the window facybox on my page it is working out perfectly the action

So I need this change I tried but I can not succeed.

I know many here are very experienced and therefore I appeal to you please!

 

Thank you!

 

imagem-loja2.jpg

 

My store

 

My script.php

 

My css

Edited by Crash®

Share this post


Link to post
Share on other sites

Bad page stucture makes bad layout!!

 

 

 

You must ensure you correctly open/close all table elements

 

w3c will help find errors. http://validator.w3....roducts_id%3D46

 

HTML Tuition http://www.w3schools...tml/default.asp

 

 


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,

 

I am in the middle of installing this contribution and have run into a bit of difficulty. In the installation details where it says to find and replace the following code in catalog/admin/categories.php

 

The code to find is this;

'products_price' => '',
                      'products_weight' => '',
                      'products_date_added' => '',
                      'products_last_modified' => '',
                      'products_date_available' => '',
                      'products_status' => '',
                      'products_tax_class_id' => '',
                      'manufacturers_id' => '');

   $pInfo = new objectInfo($parameters);

   if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
// Simple multi image addon
     $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
     $product = tep_db_fetch_array($product_query);

 

As I have several other contributions installed on my system, my code looks a little different, see bellow;

 

'products_price' => '',
                      'products_weight' => '',
                      'products_date_added' => '',
                      'products_last_modified' => '',
                      'products_date_available' => '',
                      'products_status' => '',
                          'products_tax_class_id' => '',
                      'manufacturers_id' => '');
// begin Extra Product Fields
   foreach ($xfields as $f) {
     $parameters = array_merge($parameters, array($f => ''));
   }
// end Extra Product Fields

   $pInfo = new objectInfo($parameters);

   if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
    // begin Extra Product Fields
    // Peter Milner - Add p.products_bundle for Bundled Products Contribution
  $query = "select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id, p.products_bundle";
     foreach ($xfields as $f) {
       $query .= ', pd.' . $f;
     }
     $query .= " from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'";
     $product_query = tep_db_query($query);
     // end Extra Product Fields

     $product = tep_db_fetch_array($product_query);

 

My question, is what is the best way to merge these contributions?

 

Thanks in advance for your help

Share this post


Link to post
Share on other sites

Hey Guys. im new to the forum but have used many random mods from the site.

 

I have installed this mod on my site and spotted a bug.

If you install this mod and do not put a primary ADDITIONAL image then press preview in the admin area it will loop on the spanish language file and never allow you to insert.

However if you put your first image in the Additional images (1) box it will work fine just with no primary image.

 

Thanks

Andre

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

×