Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Oscthumb nearly works but not quite


mhsuffolk

Recommended Posts

Hi,

I have installed other contributions successfully on Rc2a. I am trying to install Multiple Image AutoThumbs - MIA and I think the OSCThumb section is causing my problem

 

I am getting this error on the first page Fatal error: Call to undefined function tep_image() in W:\www\oscommerce\includes\languages\english\index.php on line 28

 

Here is the code in html_output.php that I think defines the function, I have amended the file according to the instructions

 

////

// The HTML image wrapper function

function tep_image_original($src, $alt = '', $width = '', $height = '', $parameters = '') {

if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {

return false;

}

 

// START oscThumb

// If you want to call the original function, you can call tep_image_original or call this one with $original=true.

function tep_image($src, $alt = '', $width = '', $height = '', $params = '', $original = false, $thumbnail_type = 0) {

global $oscthumb;

 

Can anybody help please as I am at a total loss to understand why this will not work

 

Martin

Live shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions.

Link to comment
Share on other sites

is that the whole function as u have it? if so you've chopped a load off !!

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

is that the whole function as u have it? if so you've chopped a load off !!

 

Thank you Sam for your prompt reply, I did not include the whole string as I wanted to keep the post short and thought the problem was at the beginning, here is the complete section

 

// The HTML image wrapper function

function tep_image_original($src, $alt = '', $width = '', $height = '', $parameters = '') {

if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {

return false;

}

 

// START oscThumb

// If you want to call the original function, you can call tep_image_original or call this one with $original=true.

function tep_image($src, $alt = '', $width = '', $height = '', $params = '', $original = false, $thumbnail_type = 0) {

global $oscthumb;

 

// We are asked to return the result of the original function

if ($original || $oscthumb->enabled==false) {

return tep_image_original ($src, $alt, $width, $height, $params);

}

 

$oscthumb->set_type ($src, $width, $height, $thumbnail_type); // Detect the type of image we are currently processing

if ($oscthumb->set_size ($src, $width, $height)==false) return false; // Choose the displayed width and height of the image, and if display something

$image = $oscthumb->process($src); // Returns the beginning of the image tag, like <img src="oscthumb.php?src=... or <img src="images/logo.gif"

 

// Add remaining image parameters if they exist

if ($width) {

$image .= ' w="' . tep_output_string($width) . '"';

}

 

if ($height) {

$image .= ' h="' . tep_output_string($height) . '"';

}

 

if (tep_not_null($params)) $image .= ' ' . $params;

 

$image .= ' border="0" alt="' . tep_output_string($alt) . '"';

 

if (tep_not_null($alt)) {

$image .= ' title="' . tep_output_string($alt) . '"';

}

 

 

$image .= '>';

return $image;

}

////

// Create Image Link Function for Lightbox

function tep_image_lightbox_link($src, $alt = '', $width = '', $height = '', $thumbnail_type = 5) {

global $oscthumb;

 

$oscthumb->set_type ($src, $width, $height, $thumbnail_type); // Detect the type of image we are currently processing

if ($oscthumb->set_size ($src, $width, $height)==false) return false; // Choose the displayed width and height of the image, and if display something

$image = $oscthumb->process($src); // Returns the beginning of the image tag, like <img src="oscthumb.php?src=... or <img src="images/logo.gif"

 

$image = '<a href=' . substr($image,9);

 

if (tep_not_null($alt)) {

$image .= ' title="' . tep_output_string($alt) . '"';

}

 

$image .= ' rel="lightbox[1]">';

return $image;

}

// END oscThumb

Live shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions.

Link to comment
Share on other sites

Then iether u removed the call:

 

require(DIR_WS_FUNCTIONS . 'html_output.php');

 

in application_top, or you are'nt calling application_top prior to your language files.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Then iether u removed the call:

 

require(DIR_WS_FUNCTIONS . 'html_output.php');

 

in application_top, or you are'nt calling application_top prior to your language files.

 

These lines exist in application_top

 

// define general functions used application-wide

require(DIR_WS_FUNCTIONS . 'general.php');

require(DIR_WS_FUNCTIONS . 'html_output.php');

 

If I comment out the new lines in html_output and change tep_image_original back to tep_image then the site will start with the original image system i.e. oscthumb not working

 

Martin

Live shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions.

Link to comment
Share on other sites

Are u using version at http://addons.oscommerce.com/info/5491

 

U are also using lightbox, there are issues with some of the code, try without it.

 

I can confirm I have used oscthumb as is without issue

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Are u using version at http://addons.oscommerce.com/info/5491

 

U are also using lightbox, there are issues with some of the code, try without it.

 

I can confirm I have used oscthumb as is without issue

 

Thank you again, I think I have over egged the pudding by trying to install in effect 3 contributions at once and I note your comment regarding lightbox

 

I am going to restore my site from my backups and start again just with oscthumb, thank you for your time and interest

 

Martin

Live shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...