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)

jheard 09-16-2008 06:07 AM

Re: Dynamic Images - a FREE mod for image resizing!
 
Can anyone tell me how to use this add-on? Everything appears setup correctly but I can not find where to add the images. If I use the image adding feature within the products, it works like the old one only the images WILL NOT show up. Where are you supposed to add images to a product and is there anymore documentation for this add-on other than the limited setup readme file?

Thanks for any help and I really need to decide if this module works or if I need to work with X-Cart subpar image handling features.

Thanks so much,
-J

amsruned 09-17-2008 09:37 AM

Re: Dynamic Images - a FREE mod for image resizing!
 
i am having a problem with this mod. i installed it and it said could not patch product_tumbail.tpl

Here is what is in the patch txt box. i am lost on what to do next.

Index: image.php
================================================== =================
--- image.php (revision 15)
+++ image.php (working copy)
@@ -88,10 +88,13 @@
# counting attempts to prevent infinite loop
$_table = $sql_tbl['images_'.$type];
$_field = (($config['available_images'][$type] == "U") ? "id" : "imageid");
-
- $result = db_query("SELECT image, image_path, image_type, md5, image_size, filename FROM $_table WHERE $_field='$id' LIMIT 1");
+ /* PHP Site Solutions - Dynamic Images */
+ $result = db_query("SELECT image, image_path, image_type, md5, image_size, filename, date FROM $_table WHERE $_field='$id' LIMIT 1");
+ /* / PHP Site Solutions - Dynamic Images */
if ($result && db_num_rows($result) > 0) {
- list($image,$image_path,$image_type,$md5,$image_si ze,$_filename) = db_fetch_row($result);
+ /* PHP Site Solutions - Dynamic Images */
+ list($image,$image_path,$image_type,$md5,$image_si ze,$_filename, $date) = db_fetch_row($result);
+ /* / PHP Site Solutions - Dynamic Images */

if (zerolen($image) && zerolen($image_path) && !zerolen($_filename)) {
x_load("image");
@@ -167,6 +168,11 @@
}

header("Content-Type: ".$image_type);
+/* PHP Site Solutions - Dynamic Images */
+if ($date > 0) {
+ header('Last-Modified: '.gmdate('D, d M Y H:i:s', $date) . ' GMT');
+}
+/* / PHP Site Solutions - Dynamic Images */
if ($image_size > 0) {
header("Content-Length: ".$image_size);
if (defined("BENCH") && constant("BENCH")) {
Index: skin1/customer/main/product.tpl
================================================== =================
--- skin1/customer/main/product.tpl (revision 15)
+++ skin1/customer/main/product.tpl (working copy)
@@ -13,12 +13,21 @@
<tr>
<td class="PImgBox" rowspan="2">

+{* PHP Site Solutions - Dynamic Images *}
+{if $active_modules.PHPSS_Dynamic_Images ne ""}
+ {assign var=phpss_dyn_img_width value=$config.PHPSS_Dynamic_Images.phpss_dyn_img_p rodtpl_img_width}
+{/if}
+{* / PHP Site Solutions - Dynamic Images *}
{if $active_modules.Detailed_Product_Images ne "" && $config.Detailed_Product_Images.det_image_popup eq 'Y' && $images ne '' && $js_enabled eq 'Y'}
{include file="modules/Detailed_Product_Images/popup_image.tpl"}
{elseif $product.force_image_type eq 'W' && $product.variantid}
-{include file="product_thumbnail.tpl" productid=$product.variantid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="W"}&nbsp;
+{* PHP Site Solutions - Dynamic Images *}
+{include file="product_thumbnail.tpl" productid=$product.variantid image_x=$phpss_dyn_img_width|default:$product.imag e_x product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="W"}&nbsp;
+{* / PHP Site Solutions - Dynamic Images *}
{else}
-{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="P"}&nbsp;
+{* PHP Site Solutions - Dynamic Images *}
+{include file="product_thumbnail.tpl" productid=$product.productid image_x=$phpss_dyn_img_width|default:$product.imag e_x product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="P"}&nbsp;
+{* / PHP Site Solutions - Dynamic Images *}
{/if}
{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"}
Index: skin1/product_thumbnail.tpl
================================================== =================
--- skin1/product_thumbnail.tpl (revision 15)
+++ skin1/product_thumbnail.tpl (working copy)
@@ -1,2 +1,44 @@
{* $Id: product_thumbnail.tpl,v 1.19.2.1 2007/07/09 05:00:35 svowl Exp $ *}
-{if $config.Appearance.show_thumbnails eq "Y" or ($type ne "T" and $type ne "")}<img{if $id ne ''} id="{$id}"{/if} src="{if $tmbn_url}{$tmbn_url}{else}{if $full_url}{$http_location}{else}{$xcart_web_dir}{/if}/image.php?type={$type|default:"T"}&amp;id={$produc tid}{/if}"{if $image_x ne 0} width="{$image_x}"{/if}{if $image_y ne 0} height="{$image_y}"{/if} alt="{$product|escape}" />{/if}
+{strip}
+{* PHP Site Solutions - Dynamic Images *}
+{if $active_modules.PHPSS_Dynamic_Images ne ""}
+ {if $config.Appearance.show_thumbnails eq "Y" or ($type ne "T" and $type ne "")}
+ {if $main eq "catalog" || $main eq "search" || $main eq "manufacturer_products" || $main eq "download_home"}
+ {if !$alt}
+ {assign var=alt value=$product}
+ {/if}
+ {/if}
+
+ {if $tmbn_url}
+ {if $usertype eq 'A' || $usertype eq 'P'}
+ {assign var="tfile" value=$tmbn_url|replace:"`$http_location`/":"../"|replace:"`$https_location`/":"../"}
+ {else}
+ {assign var="tfile" value=$tmbn_url|replace:"`$http_location`/":""|replace:"`$https_location`/":""}
+ {/if}
+ {if !$class}
+ {assign var="class" value="thumb"}
+ {/if}
+ {if !$sharpen}
+ {assign var="sharpen" value="true"}
+ {/if}
+ {if !hint}
+ {assign var="hint" value="false"}
+ {/if}
+ {if !overlay_position}
+ {assign var="overlay_position" value="5"}
+ {/if}
+
+ {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`\""}
+ {else}
+ {* Capture the image tag and clean out extra whitespaces *}
+ {capture assign="img_cln"}
+ <img {if $id}id="{$id}"{/if} src="{if $full_url}{$http_location}{else}{$xcart_web_dir}{/if}/image.php?type={$type|default:"T"}&amp;id={$produc tid}{if $file_upload_data.file_path}&tmp=y{/if}" {if $image_x ne 0}width="{$image_x}"{/if} {if $image_y ne 0}height="{$image_y}"{/if} alt="{$product|escape}" {if $align}align="{$align}"{/if} {if $class}class="{$class}"{/if} />
+ {/capture}
+ {$img_cln|strip}
+ {/if}
+ {/if}
+{else}
+ {if $config.Appearance.show_thumbnails eq "Y" or ($type ne "T" and $type ne "")}<img{if $id ne ''} id="{$id}"{/if} src="{if $tmbn_url}{$tmbn_url}{else}{if $full_url}{$http_location}{else}{$xcart_web_dir}{/if}/image.php?type={$type|default:"T"}&amp;id={$produc tid}{/if}"{if $image_x ne 0} width="{$image_x}"{/if}{if $image_y ne 0} height="{$image_y}"{/if} alt="{$product|escape}" />{/if}
+{/if}
+{* / PHP Site Solutions - Dynamic Images *}
+{/strip}

davidsaldana 09-17-2008 09:47 AM

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

Originally Posted by amsruned
i am having a problem with this mod. i installed it and it said could not patch product_tumbail.tpl

Here is what is in the patch txt box. i am lost on what to do next.

Index: image.php
================================================== =================
--- image.php (revision 15)
+++ image.php (working copy)
@@ -88,10 +88,13 @@
# counting attempts to prevent infinite loop
$_table = $sql_tbl['images_'.$type];
$_field = (($config['available_images'][$type] == "U") ? "id" : "imageid");
-
- $result = db_query("SELECT image, image_path, image_type, md5, image_size, filename FROM $_table WHERE $_field='$id' LIMIT 1");
+ /* PHP Site Solutions - Dynamic Images */
+ $result = db_query("SELECT image, image_path, image_type, md5, image_size, filename, date FROM $_table WHERE $_field='$id' LIMIT 1");
+ /* / PHP Site Solutions - Dynamic Images */
if ($result && db_num_rows($result) > 0) {
- list($image,$image_path,$image_type,$md5,$image_si ze,$_filename) = db_fetch_row($result);
+ /* PHP Site Solutions - Dynamic Images */
+ list($image,$image_path,$image_type,$md5,$image_si ze,$_filename, $date) = db_fetch_row($result);
+ /* / PHP Site Solutions - Dynamic Images */

if (zerolen($image) && zerolen($image_path) && !zerolen($_filename)) {
x_load("image");
@@ -167,6 +168,11 @@
}

header("Content-Type: ".$image_type);
+/* PHP Site Solutions - Dynamic Images */
+if ($date > 0) {
+ header('Last-Modified: '.gmdate('D, d M Y H:i:s', $date) . ' GMT');
+}
+/* / PHP Site Solutions - Dynamic Images */
if ($image_size > 0) {
header("Content-Length: ".$image_size);
if (defined("BENCH") && constant("BENCH")) {
Index: skin1/customer/main/product.tpl
================================================== =================
--- skin1/customer/main/product.tpl (revision 15)
+++ skin1/customer/main/product.tpl (working copy)
@@ -13,12 +13,21 @@
<tr>
<td class="PImgBox" rowspan="2">

+{* PHP Site Solutions - Dynamic Images *}
+{if $active_modules.PHPSS_Dynamic_Images ne ""}
+ {assign var=phpss_dyn_img_width value=$config.PHPSS_Dynamic_Images.phpss_dyn_img_p rodtpl_img_width}
+{/if}
+{* / PHP Site Solutions - Dynamic Images *}
{if $active_modules.Detailed_Product_Images ne "" && $config.Detailed_Product_Images.det_image_popup eq 'Y' && $images ne '' && $js_enabled eq 'Y'}
{include file="modules/Detailed_Product_Images/popup_image.tpl"}
{elseif $product.force_image_type eq 'W' && $product.variantid}
-{include file="product_thumbnail.tpl" productid=$product.variantid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="W"}&nbsp;
+{* PHP Site Solutions - Dynamic Images *}
+{include file="product_thumbnail.tpl" productid=$product.variantid image_x=$phpss_dyn_img_width|default:$product.imag e_x product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="W"}&nbsp;
+{* / PHP Site Solutions - Dynamic Images *}
{else}
-{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="P"}&nbsp;
+{* PHP Site Solutions - Dynamic Images *}
+{include file="product_thumbnail.tpl" productid=$product.productid image_x=$phpss_dyn_img_width|default:$product.imag e_x product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="P"}&nbsp;
+{* / PHP Site Solutions - Dynamic Images *}
{/if}
{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"}
Index: skin1/product_thumbnail.tpl
================================================== =================
--- skin1/product_thumbnail.tpl (revision 15)
+++ skin1/product_thumbnail.tpl (working copy)
@@ -1,2 +1,44 @@
{* $Id: product_thumbnail.tpl,v 1.19.2.1 2007/07/09 05:00:35 svowl Exp $ *}
-{if $config.Appearance.show_thumbnails eq "Y" or ($type ne "T" and $type ne "")}<img{if $id ne ''} id="{$id}"{/if} src="{if $tmbn_url}{$tmbn_url}{else}{if $full_url}{$http_location}{else}{$xcart_web_dir}{/if}/image.php?type={$type|default:"T"}&amp;id={$produc tid}{/if}"{if $image_x ne 0} width="{$image_x}"{/if}{if $image_y ne 0} height="{$image_y}"{/if} alt="{$product|escape}" />{/if}
+{strip}
+{* PHP Site Solutions - Dynamic Images *}
+{if $active_modules.PHPSS_Dynamic_Images ne ""}
+ {if $config.Appearance.show_thumbnails eq "Y" or ($type ne "T" and $type ne "")}
+ {if $main eq "catalog" || $main eq "search" || $main eq "manufacturer_products" || $main eq "download_home"}
+ {if !$alt}
+ {assign var=alt value=$product}
+ {/if}
+ {/if}
+
+ {if $tmbn_url}
+ {if $usertype eq 'A' || $usertype eq 'P'}
+ {assign var="tfile" value=$tmbn_url|replace:"`$http_location`/":"../"|replace:"`$https_location`/":"../"}
+ {else}
+ {assign var="tfile" value=$tmbn_url|replace:"`$http_location`/":""|replace:"`$https_location`/":""}
+ {/if}
+ {if !$class}
+ {assign var="class" value="thumb"}
+ {/if}
+ {if !$sharpen}
+ {assign var="sharpen" value="true"}
+ {/if}
+ {if !hint}
+ {assign var="hint" value="false"}
+ {/if}
+ {if !overlay_position}
+ {assign var="overlay_position" value="5"}
+ {/if}
+
+ {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`\""}
+ {else}
+ {* Capture the image tag and clean out extra whitespaces *}
+ {capture assign="img_cln"}
+ <img {if $id}id="{$id}"{/if} src="{if $full_url}{$http_location}{else}{$xcart_web_dir}{/if}/image.php?type={$type|default:"T"}&amp;id={$produc tid}{if $file_upload_data.file_path}&tmp=y{/if}" {if $image_x ne 0}width="{$image_x}"{/if} {if $image_y ne 0}height="{$image_y}"{/if} alt="{$product|escape}" {if $align}align="{$align}"{/if} {if $class}class="{$class}"{/if} />
+ {/capture}
+ {$img_cln|strip}
+ {/if}
+ {/if}
+{else}
+ {if $config.Appearance.show_thumbnails eq "Y" or ($type ne "T" and $type ne "")}<img{if $id ne ''} id="{$id}"{/if} src="{if $tmbn_url}{$tmbn_url}{else}{if $full_url}{$http_location}{else}{$xcart_web_dir}{/if}/image.php?type={$type|default:"T"}&amp;id={$produc tid}{/if}"{if $image_x ne 0} width="{$image_x}"{/if}{if $image_y ne 0} height="{$image_y}"{/if} alt="{$product|escape}" />{/if}
+{/if}
+{* / PHP Site Solutions - Dynamic Images *}
+{/strip}



Yeah, 4.1.11 branch is not working with this mod. I had the same problems, got the program to slightly work, but not the way it was intended.

Anyone have a fix for this branch yet?

xtestedx 10-04-2008 05:24 PM

Re: Dynamic Images - a FREE mod for image resizing!
 
the pluses (+) in front of the code mean add to the template the minuses (-) mean delete. Im still working on this one 2.

davidsaldana 10-04-2008 05:28 PM

Re: Dynamic Images - a FREE mod for image resizing!
 
figured that out. I can get the mod to work, but not the lytebox portion of it, which is really the bread of butter. Please post your changes so I can confirm that I have done it correctly.

Thanks,
David

xtestedx 10-04-2008 05:44 PM

Re: Dynamic Images - a FREE mod for image resizing!
 
ok i got it working in 4.11.1 or watever (its the latest)
for The thumbnail
product_thumbnail.tpl

just replace the whole lot

Code:

{* $Id: product_thumbnail.tpl,v 1.19 2005/11/17 06:55:36 max Exp $ *}
 {strip}
 {* PHP Site Solutions - Dynamic Images *}
 {if $active_modules.PHPSS_Dynamic_Images ne ""}
        {if $config.Appearance.show_thumbnails eq "Y" or ($type ne "T" and $type ne "")}
                {if $main eq "catalog" || $main eq "search" || $main eq "manufacturer_products" || $main eq "download_home"}
                        {if !$alt}
                                {assign var=alt value=$product}
                        {/if}
                {/if}
 
                {if $tmbn_url}
                        {if $usertype eq 'A' || $usertype eq 'P'}
                                {assign var="tfile" value=$tmbn_url|replace:"`$http_location`/":"../"|replace:"`$https_location`/":"../"}
                        {else}
                                {assign var="tfile" value=$tmbn_url|replace:"`$http_location`/":""|replace:"`$https_location`/":""}
                        {/if}
                        {if !$class}
                                {assign var="class" value="thumb"}
                        {/if}
                        {if !$sharpen}
                                {assign var="sharpen" value="true"}
                        {/if}
                        {if !hint}
                                {assign var="hint" value="false"}
                        {/if}
                        {if !overlay_position}
                                {assign var="overlay_position" value="5"}
                        {/if}
 
                        {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`\""}
                {else}
                        {* Capture the image tag and clean out extra whitespaces *}
                        {capture assign="img_cln"}
                                <img {if $id}id="{$id}"{/if} src="{if $full_url}{$http_location}{else}{$xcart_web_dir}{/if}/image.php?type={$type|default:"T"}&amp;id={$productid}{if $file_upload_data.file_path}&tmp=y{/if}" {if $image_x ne 0}width="{$image_x}"{/if} {if $image_y ne 0}height="{$image_y}"{/if} alt="{$product|escape}" {if $align}align="{$align}"{/if} {if $class}class="{$class}"{/if} />
                        {/capture}
                        {$img_cln|strip}
                {/if}
        {/if}
 {else}
        {if $config.Appearance.show_thumbnails eq "Y" or ($type ne "T" and $type ne "")}<img{if $id ne ''} id="{$id}"{/if} src="{if $tmbn_url}{$tmbn_url}{else}{if $full_url}{$http_location}{else}{$xcart_web_dir}{/if}/image.php?type={$type|default:"T"}&amp;id={$productid}{/if}"{if $image_x ne 0} width="{$image_x}"{/if}{if $image_y ne 0} height="{$image_y}"{/if} alt="{$product|escape}" />{/if}
 {/if}
 {* / PHP Site Solutions - Dynamic Images *}
 {/strip}


for skin1/customer/main/product.tpl if you have cartlabs css template just think of ' Pimg box' as ==> <div class="product_thumb">

[code]
Copying what someone said earlier cause it works

Quote:

Originally Posted by pcparts
And i just tried this on a stock 4.1.11 product.tpl

change this part

Code:

{if $active_modules.Detailed_Product_Images ne "" && $config.Detailed_Product_Images.det_image_popup eq 'Y' && $images ne '' && $js_enabled eq 'Y'}
{include file="modules/Detailed_Product_Images/popup_image.tpl"}
{else}
{include file="product_thumbnail.tpl" productid=$product.image_id image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.image_url id="product_thumbnail" type=$product.image_type}&nbsp;
{/if}
{if $active_modules.Magnifier ne "" and $config.Magnifier.magnifier_image_popup eq 'Y' and $zoomer_images ne '' and $js_enabled eq 'Y' and $printable neq 'Y'}
{include file="modules/Magnifier/popup_magnifier.tpl"}
{/if}


With this

Code:

{* PHP Site Solutions - Dynamic Images *}
{if $active_modules.PHPSS_Dynamic_Images ne ""}
{assign var=phpss_dyn_img_width value=$config.PHPSS_Dynamic_Images.phpss_dyn_img_prodtpl_img_width}
{/if}
{* / PHP Site Solutions - Dynamic Images *}
{if $active_modules.Detailed_Product_Images ne "" && $config.Detailed_Product_Images.det_image_popup eq 'Y' && $images ne '' && $js_enabled eq 'Y'}
{include file="modules/Detailed_Product_Images/popup_image.tpl"}
{else}
{include file="product_thumbnail.tpl" productid=$product.variantid image_x=$phpss_dyn_img_width|default:$product.image_x product=$product.product tmbn_url=$product.image_url id="product_thumbnail" type=$product.image_type}&nbsp;
{/if}
{if $active_modules.Magnifier ne "" and $config.Magnifier.magnifier_image_popup eq 'Y' and $zoomer_images ne '' and $js_enabled eq 'Y' and $printable neq 'Y'}
{include file="modules/Magnifier/popup_magnifier.tpl"}
{/if}


Hope this helps.


This is what it comes out as http://www.slixaustralia.com.au/xcart4.1/xcart1/product.php?productid=16133&cat=3&page=1#

davidsaldana 10-04-2008 05:46 PM

Re: Dynamic Images - a FREE mod for image resizing!
 
Any luck with the Lytebox portion?

-DS

xtestedx 10-04-2008 05:55 PM

Re: Dynamic Images - a FREE mod for image resizing!
 
working on it now ok

KeithXtreme 12-27-2008 10:55 AM

Re: Dynamic Images - a FREE mod for image resizing!
 
Anything with the Lytebox part....same problem as everyone else....

If I uncheck detailed images in popup, and click the image in the detailed images box lytebox works.....
But the actual product image thumb, will not use Lytebox

pfarcus 01-16-2009 07:46 AM

Re: Dynamic Images - a FREE mod for image resizing!
 
Yeah, I'm 4.1.11 too and I couldn't get it to work so I'll be watching this thread for any new versions or patches. (i'm not as advanced as you guys who can get it to work in 4.1.11)


All times are GMT -8. The time now is 12:19 AM.

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