Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

TimThumb for OScommerce


  • You cannot reply to this topic
4 replies to this topic

#1 freakenstein

  • Community Member
  • 8 posts
  • Real Name:Frank
  • Gender:Male
  • Location:The Netherlands

Posted 01 April 2010, 12:52

In my opinion Timthumb is currently one of the better and easiest thumbnailscripts available. Often used in WordPress templates, but I decided to use it in OScommerce. With these easy steps you can actually do the same.

Let me know what you think and if this can be improved:

1. Create the thumbnailcache (/cache) in the OScommerce root and give this directory 777 rights.

2. Get timthumb.php from timthumb.googlecode.com.

3. In timthumb.php change:

if ($new_width == 0 && $new_height == 0) {
    $new_width = 100;
    $new_height = 100;
}
to
if ($new_width == 0 && $new_height == 0) {
    $new_width = $width;
    $new_height = $height;
}

4. Upload timthumb.php to your OScommerce root

3. Now we're gonna edit /includes/functions/html_output.php

// alt is added to the img tag even if it is null to prevent browsers from outputting
// the image filename as default
    $image = '<img src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"';

to
// alt is added to the img tag even if it is null to prevent browsers from outputting
// the image filename as default
$image = '<img src="/k/catalog/timthumb.php?src=' . tep_output_string($src) . '&w=' . tep_output_string($width) . '&h=' . tep_output_string($height) . '&zc=0" border="0" alt="' . tep_output_string($alt) . '"';

That's it.
More info about TimThumb:
www.darrenhoyt.com/2008/04/02/timthumb-php-script-released/
code.google.com/p/timthumb/]l]

/Frank

Edited by Jan Zonjee, 02 April 2010, 07:16.


#2 freakenstein

  • Community Member
  • 8 posts
  • Real Name:Frank
  • Gender:Male
  • Location:The Netherlands

Posted 01 April 2010, 20:47

correction:
// alt is added to the img tag even if it is null to prevent browsers from outputting
// the image filename as default
$image = '<img src="/k/catalog/timthumb.php?src=' . tep_output_string($src) . '&w=' . tep_output_string($width) . '&h=' . tep_output_string($height) . '&zc=0" border="0" alt="' . tep_output_string($alt) . '"';

should be
// alt is added to the img tag even if it is null to prevent browsers from outputting
// the image filename as default
$image = '<img src="/catalog/timthumb.php?src=' . tep_output_string($src) . '&w=' . tep_output_string($width) . '&h=' . tep_output_string($height) . '&zc=0" border="0" alt="' . tep_output_string($alt) . '"';


#3 Tini

  • Community Member
  • 4 posts
  • Real Name:Valentín López

Posted 18 May 2010, 18:21

Hi...

Not worked for me.
When I make any changes that you indicate I lose all the images on the web
Killo tu ere de Dos Hermanas... ;-))

#4 DimeNote

  • Community Member
  • 139 posts
  • Real Name:Unknown
  • Gender:Male

Posted 18 May 2010, 19:48

View PostTini, on 18 May 2010, 18:21, said:

Hi...

Not worked for me.
When I make any changes that you indicate I lose all the images on the web

Same here. Any solutions?

#5 acidvertigo

  • Community Member
  • 140 posts
  • Real Name:Luca
  • Gender:Male
  • Location:Roma

Posted 23 March 2011, 17:51

Hello i have modified this addon to work with timthumb.

Hope it helps