Zen Cart Logo
Forums / All Other Contributions/Addons / Configure larger images link

Configure larger images link

Locked

Views: 2,950

Results 1 to 20 of 24
This thread is locked. New replies are disabled.
26 May 2007, 2:42 PM
#1
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Configure larger images link

Hi,

Some users requested to have a feature which would allow configuration of the 'Enlarge Image' link below their products.

The MOD is now ready at my site: 'http://www.storm.ca/~oracle'

Simply follow the installation.txt file instruction and you should be all set.

For support, please post here.

Enjoy ! :cool:

MODERATOR NOTE: This mod is apparently no longer available nor supported by its author. The reasons given on the author's website are only half the story. This discussion thread remains available for reference for those who have already downloaded and attempted to use the contribution.

27 May 2007, 11:10 PM
#2
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Configure larger images link

Everything works as expected ? :smile:

28 May 2007, 11:10 AM
#4
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Configure larger images link

Glad to know it fits your needs. :cool:

31 May 2007, 9:34 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Configure larger images link

"AWOL" means absent without leave... so it isn't working at all for them.

It is quite likely that two mods affecting the same page would interfere with each other.

PS - I have no need to reconfigure the larger image link below the product image (I just edited the definition) and will not be downloading it, so could I ask you to explain what this mod is supposed to do?

1 Jun 2007, 2:52 AM
#6
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Configure larger images link

and will not be downloading it

You don't want it ? Don't take it.

As mentioned from my first post, this MOD has been built on request. Quite frankly, I do not use the lightbox MOD, so I consider myself responsible for any conflicts that might be involved. Each contributions are at own risks (also documented elsewhere on the forum).

I'm sure that others will benefit of this feature since it was in demand.

1 Jun 2007, 3:18 AM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Configure larger images link

I simply wondered what the mod is supposed to do. I'm sure there are people who haven't thought explicitly about changing that link who will be interested when they find out what they can get with it.

1 Jun 2007, 11:09 AM
#8
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Configure larger images link

they find out what they can get with it.

They will find out what they expected to have. As per the title mention, you can configure the link from the admin section. This is also fully documented from my installation.txt file from the package but since you choose not to download it, it has only result more posts to find out.

1 Jun 2007, 2:08 PM
#9
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: Configure larger images link

Hello TheOracle,

Forgive me, I should have been more descriptive in my post. I have lightbox installed, and that script is included in the same file that I have to add the code from the larger image links mod (I used winmerge to merge them correctly). I wondered if they clash, as it causes the product info page to stay blank.

Regards,

Heathenmagic

1 Jun 2007, 2:47 PM
#10
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Configure larger images link

That obviously sounds like a conflict initialization between the lightbox and mine ... it would probably required to extend the if condition statement in order for those two MODs to load accordingly.

For instance, if you remove "one of the two conditions" (old one from your lightbox ansd keep mine) will the page appear again ?

1 Jun 2007, 3:06 PM
#11
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Configure larger images link

Additionally, would it be possible to post your related template file (under php bbcode please) ? I will take a look at in in the mean time to see if something quicker could be done. :smile:

1 Jun 2007, 3:09 PM
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Configure larger images link

"Configure a link" is a broad term that could mean any or all of changing its wording, changing its location on the page, changing its destination, or changing its functionality.

Since you didn't want to be specific, I downloaded the zip and after locating the changed line in tpl_modules_main_product_image.php was able to determine that you meant turning the link on or off. That is a useful function, and one that I actually wanted at one point in setting up my store.

From examining the file, though, it appears that the switch is not implemented for the <noscript> portion of the code. Thus, anyone browsing with javascript off would see a link regardless of the setting. It would seem like a good idea to apply the switch there also.

1 Jun 2007, 3:11 PM
#13
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Configure larger images link

Excellent analysis. Very well, I will investigate this issue later day. Thanks for the catch.

1 Jun 2007, 6:45 PM
#14
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Configure larger images link

@Hathenmagic:

If you could post what you have actually done from your product info's template file, I could probably try to tweek this.

1 Jun 2007, 10:22 PM
#15
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: Configure larger images link

Hello TheOracle,

I have had a closer look at my code, I think I made a mess up with one line. The product info page shows up well now. the only thing is that if i turn off larger image link, it still remains. I am not adept at php, but I have a feeling it is the no script area that I need to refine? I could be wrong lol.

<?php
/**
 * Module Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_modules_main_product_image.php 3208 2006-03-19 16:48:57Z birdbrain $
 */
?>
<?php require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE)); ?>

<div id="productMainImage" class="centeredContent back">
    <!-- begin zen lightbox v1.3 aclarke 2006-10-20 -->
    <script language="javascript" type="text/javascript"><!--
document.write('<?php echo '<a href="' . zen_image_lightbox_IH2_url($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT) . '" rel="lightbox[gallery]" title="' . addslashes($products_name) . '">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>');
//--></script>
  <!-- end zen lightbox v1.3 aclarke 2006-10-20 -->
  <noscript>
  <script language="javascript" type="text/javascript"><!--
document.write('<?php if (IMAGE_LARGER_LINK == 'true') { echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; } else { echo zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT); } ?>');
//--></script>
<noscript>
  <?php
  echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" target="_blank">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>';
?>
  </noscript>
</div>

Thanks :smile:

2 Jun 2007, 12:02 AM
#16
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Configure larger images link

I am not adept at php, I have a feeling it is the no script area that I need to refine?

Then, in that case, your feeling says true. :wink2:

Let's try a little something here.

Replace your code above

with this one:

<?php
/**
 * Module Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_modules_main_product_image.php 3208 2006-03-19 16:48:57Z birdbrain $
 */
?>
<?php require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE)); ?>

<div id="productMainImage" class="centeredContent back">
    <!-- begin zen lightbox v1.3 aclarke 2006-10-20 -->
    <script language="javascript" type="text/javascript"><!--
document.write('<?php echo '<a href="' . zen_image_lightbox_IH2_url($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT) . '" rel="lightbox[gallery]" title="' . addslashes($products_name) . '">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>');
//--></script>
  <!-- end zen lightbox v1.3 aclarke 2006-10-20 -->
  <noscript>
  <script language="javascript" type="text/javascript"><!--
document.write('<?php if (IMAGE_LARGER_LINK == 'true') { echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; } else { echo zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT); } ?>');
//--></script>
<noscript>
  <?php 
  if (IMAGE_LARGER_LINK == 'true') {
  echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" target="_blank">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>';
  } elseif (IMAGE_LARGER_LINK == 'false') {
  echo zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT);      
  } // End of if statement.  
?>
  </noscript>
</div>

Will it work as expected ? :wink2:

2 Jun 2007, 12:17 AM
#17
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: Configure larger images link

Hello there,

I have tried your code. It doesn't break anything. Unfortunately, the larger link remains if you disable it. Sorry. Maybe it is specific to my system - a heavily modded zencart, maybe other zen users have this working? Hopefully they could mention it and that might confirm my suspicion.

Thanks for your help so far Oracle.

2 Jun 2007, 12:26 AM
#18
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Configure larger images link

I think I just noticed why.

Try this one instead:

<?php
/**
 * Module Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_modules_main_product_image.php 3208 2006-03-19 16:48:57Z birdbrain $
 */
?>
<?php require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE)); ?>

<div id="productMainImage" class="centeredContent back">
    <!-- begin zen lightbox v1.3 aclarke 2006-10-20 -->    
<noscript>
    <script language="javascript" type="text/javascript"><!--
document.write('<?php if (IMAGE_LARGER_LINK == 'true') ? echo '<a href="' . zen_image_lightbox_IH2_url($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT) . '" rel="lightbox[gallery]" title="' . addslashes($products_name) . '">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>' } else { zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT); ?>');
//--></script>
</noscript>
  <!-- end zen lightbox v1.3 aclarke 2006-10-20 -->  
  <noscript>
  <script language="javascript" type="text/javascript"><!--
document.write('<?php if (IMAGE_LARGER_LINK == 'true') { echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; } else { echo zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT); } ?>');
//--></script>
</noscript>
<noscript>
  <?php 
  if (IMAGE_LARGER_LINK == 'true') {
  echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" target="_blank">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>';
  } elseif (IMAGE_LARGER_LINK == 'false') {
  echo zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT);      
  } // End of if statement.  
?>
  </noscript>
</div>
3 Jun 2007, 2:49 AM
#19
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Configure larger images link

What is the conclusion of my modifications right above ? :smile: