X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Third Party Add-Ons for X-Cart 4 (https://forum.x-cart.com/forumdisplay.php?f=45)
-   -   Dynamic Images - a FREE mod for image resizing! (https://forum.x-cart.com/showthread.php?t=41911)

Stizerg 08-27-2008 06:29 AM

Re: Dynamic Images - a FREE mod for image resizing!
 
Thanks Jon!
I was looking for solution like this, to replace my pics resizer.
Now, page loads much faster. (I use it for detailed images only).

gennarof 08-28-2008 05:24 AM

Re: Dynamic Images - a FREE mod for image resizing!
 
Thanks Jon..I manually deleted the files I ftp's into the root, deleted the /cache/ directory I created in under the images directory and reinstalled from / at the folder level after correcting the zip file that previously only showed the files not the directory structure. In short I ftp'd the 3 folders beneath the upload folder ( /images, /include , /sq) into the root directory of the site. I manually patched the skin1/product_thumbnail.tpl. and the images seem to showing up ok now. Thanks much..

I do have one other concern..In the backend .. when I go to modules to activate the mod.. It shows the Dynamic Images module twice. When I tick one of the boxes to activate the module and then "update" both itterations of the module show as ticked. I am sure this is because I messed up the first install. and ran the patch twice. Do you have any Idea how I can get rid of the duplicate listing of the module. (see screen print attached)

http://desertvalleyelectronics.com/Public/dynamicimage.jpg

mpgyvr 08-28-2008 07:17 PM

Re: Dynamic Images - a FREE mod for image resizing!
 
Works great for my product images. But I'd like to have my thumbnails also resized, but off the product images, so there needs to be only 1 imaged stored on the system. I've tried to modify products.tpl, but I can't make it work. Has anybody got a solution like this working?

thanks kindly!


Quote:

Originally Posted by Stizerg
Thanks Jon!
I was looking for solution like this, to replace my pics resizer.
Now, page loads much faster. (I use it for detailed images only).


intel352 08-28-2008 07:44 PM

Re: Dynamic Images - a FREE mod for image resizing!
 
gennarof: this will remove the duplicate, execute in SQL Patch area of X-Cart.
Code:

DELETE FROM xcart_modules WHERE module_name LIKE "PHPSS_Dynamic_Images" LIMIT 1;

mpgyvr: I just upload 1 large image to my product's thumbnail, that same image is used for product listings or the actual product page itself. That way, there's only one original image, and it is resized as needed for each area that the image is displayed (whether product page or product listings). Also, if you haven't already, I suggest you implement the how-to for enhancing Dynamic Images further, as it gives you a nice pop-up effect to view your full-size image. (the link should be on the first page of this thread, or you can just visit my forums directly to find the thread)

Darryl 08-29-2008 04:43 PM

Re: Dynamic Images - a FREE mod for image resizing!
 
Hi,

A couple of questions.

Where do I find the watermarking feature (I did try).

Would it be possible to add "Click to enlarge" or something to that effect below the product image so people are aware they can access the detailed image.

Thanks

pcparts 08-29-2008 07:55 PM

Re: Dynamic Images - a FREE mod for image resizing!
 
It is possible to add a water mark feature to this mod.

If i get time over the weekend i will have ago.

You could try and add in skin1/customer/main/product.tpl

Under
Code:

{if $active_modules.Magnifier ne "" && $config.Magnifier.magnifier_image_popup eq 'Y' && $zoomer_images ne '' && $js_enabled eq 'Y'}
{include file="modules/Magnifier/popup_magnifier.tpl"}
{/if}


Add
Code:

<br /><br />
Click image to enlarge
<br /><br />


intel352 08-29-2008 08:30 PM

Re: Dynamic Images - a FREE mod for image resizing!
 
1 Attachment(s)
Quote:

Originally Posted by Darryl
Hi,

A couple of questions.

Where do I find the watermarking feature (I did try).

Would it be possible to add "Click to enlarge" or something to that effect below the product image so people are aware they can access the detailed image.

Thanks


Hi Darryl, here you go

Code:

{thumb file="images/D/variant_chart_Example-1_live.jpg" width=500 hint=false overlay="images/famguystewie.png" overlay_position=5 legend="Click to Enlarge"}

The image generated from this code is attached.
The "Click to Enlarge" bit is better done as suggested by PCParts, as you can style it his way. This example is just to show what is possible regarding what you requested.

Just a note, overlay_position=5 sets the overlay image to the center. Your options are 1-9 (starting from top left).

Additionally, to give people a "hint" that they can click to expand the image, you can set hint=true (or remove the reference completely, as I believe default is true), which will add a magnifier glass to the lower right of your image.

You can view the comments at the top of the file in include/templater/function.thumb_imp.php, to find out more about what's possible.

EDIT: Using my method (the default thumb_imp method), you can only submit a .png file as an overlay image

pcparts 08-29-2008 10:22 PM

Re: Dynamic Images - a FREE mod for image resizing!
 
Try this for watermark images on all products it worked ok on my local computer.

In function.thumb_imp

Change line 527 to this

Code:

$overlay = imagecreatefromgif($params['overlay']);

Under
Code:

/* load the "overlay"-image */

Create a folder watermark in your root images directory.

In skin1/product_thumbnail.tpl

Change this
Code:

{thumb file="$tfile" width="$image_x" link="false" hint="false" overlay_position="$overlay_position" overlay="$overlay" sharpen="$sharpen" get_image_path="$get_image_path" html="class=\"$class\" alt=\"`$alt`\""}

To this

Code:

{thumb file="$tfile" width="$image_x" link="false" hint="false" overlay_position="$overlay_position" overlay_position="5" overlay="images/watermark/site.gif" sharpen="$sharpen" get_image_path="$get_image_path" html="class=\"$class\" alt=\"`$alt`\""}

Create a watermark image and put it in images/watermark

To change the image name just change this (site.gif) in the product_thumbnail.tpl

There might be better ways of doing this some others might like to add to it.

polkadotninja 09-02-2008 07:24 AM

Re: Dynamic Images - a FREE mod for image resizing!
 
Just wanted to chime in and note that this is a great mod. I purchased the Telefirma mod, but it took a long while to get and is tied to a single domain. Not sure if it'll work on test localhost domains, but haven't gotten answer to this or any other basic Q's from the provider, so I'm too nervous about requiring any possible support down the road to use it. Found this mod while waiting for delivery of the Telefirma mod, though, and I love it.

I installed the Lytebox changes as suggested, and like that a lot, too. I made a few minor changes that I'd like to share in case anybody is interested. I wanted to have the image on the product editing page be resized, too, so ended changing the following files ...

skin1/main/edit_image.tpl, changed image line to the following:
PHP Code:

{if $active_modules.PHPSS_Dynamic_Images ne ""}
  <
a href="{$product.tmbn_url}title="{$product.product|escape}rel="lytebox[detailed]"><img src="/{thumb file=$product.tmbn_url width=$phpss_dyn_img_width|default:$product.image_x link=false hint=false get_image_path=true}" id="product_thumbnail" class="thumb" alt="{include file="main/image_property.tpl"}" /></a>
{else}
  <
img id="{$idtag}src="{$xcart_web_dir}/image.php?type={$type}&amp;id={$id}&amp;ts={$smarty.now}{if $already_loaded}&amp;tmp=Y{/if}"{if $image_x ne 0width="{$image_x}"{/if}{if $image_y ne 0height="{$image_y}"{/if} alt="{include file="main/image_property.tpl"}"/>
{/if} 


skin1/admin/home.tpl and skin1/provider/home.tpl, added the following to the head tag:
HTML Code:


    {* Lytebox *}
    <script type="text/javascript" language="javascript" src="{$SkinDir}/js/lytebox.js"></script>
    <link rel="stylesheet" href="{$SkinDir}/css/lytebox.css" type="text/css" media="screen" />
    {* /Lytebox *}


Now going to try to eliminate the product listing thumbnails and just replace them with a resized version of the main image ... if anybody has advice on this, please share :-)

polkadotninja 09-02-2008 08:55 AM

Re: Dynamic Images - a FREE mod for image resizing!
 
One more note ... in case anyone is interested in doing what I mentioned at the end of the last post (replacing product thumbnails with a resized version of the main product image), here's what I came up with, which, so far, seems to work ...

In include/func/func.files.php:

Modify the function call for func_get_image_url to look like the following (added one arg) -

PHP Code:

function func_get_image_url($id$type 'T'$image_path false$no_url false) { 


Then modify the line in that same function which looks like this -

PHP Code:

if (is_url($image_path)) { 


to this -

PHP Code:

if (is_url($image_path) || $no_url) { 


In include/search.php:

Modify the section that looks like this -

PHP Code:

# Get thumbnail URL
       
$products[$k]["tmbn_url"] = false;
                
        if (!
is_null($v['image_path_T'])) { 


to this -

PHP Code:

# Get thumbnail URL
       
$products[$k]["tmbn_url"] = false;
        
        if (
$active_modules.PHPSS_Dynamic_Images != "") {
          
$products[$k]["tmbn_url"] = func_get_image_url($v['productid'], "P"falsetrue);
        }
        
        else if (!
is_null($v['image_path_T'])) { 



Oh, one last thing, you might as well hide the thumbnail rows in skin1/main/product_details.tpl. I think that's it. Everything else just works once that's done ... the trick was to make the tmbn_url property point to the product's main image URL.

- Sam


All times are GMT -8. The time now is 09:35 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.