View Single Post
  #33  
Old 09-17-2008, 09:47 AM
  davidsaldana's Avatar 
davidsaldana davidsaldana is offline
 

Senior Member
  
Join Date: Oct 2005
Posts: 187
 

Default 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?
__________________
4.4
Code:
Hello World
Reply With Quote