Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product listing


FWR Media

Recommended Posts

I read the instructions and setting the watermark size to 0 and resetting the thumbs cache afterwards did not work either.

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

Link to comment
Share on other sites

@raiwa

I did that and the problem persists in the 2 browsers I checked. However, there is a bit more to this issue. I initially did this on A Bug's Life sample prod and when I went to the home page and then checked the other product pages, they are fine and following the setting I made in the admin section for those images.

However, when I go back to that product page for A Bug's Life, the watermark is there and the image is not upsized (as per my setting to allow upsizing).

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

I opened a 3rd browser (FF, Chrome, and now IE) that does not have any cache of this page and I cleared the cache before loading the product page for A Bug's life,... same problem. For some reason the thumbs cache reset is not clearing the cache for this initial product page I loaded. This is not a browser cache problem. Any suggestions please?

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

ok, I fixed it, but this is a bug with this addon, because the fix was to go into /images/thumbs/ and delete all folders of thumbs and then regenerate them by re-loading the home page again.

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

@raiwa

hey Rainer,

Could you please check & test the tep_destroy_thumbs_dir() function in /includes/functions/general.php? I think this is where my thumbs problem is coming from. The chmod in that function is not setting anything to 777, and when I reset the thumbs in Admin > Configuration > Images, it does not remove the thumbs directory or any of its contents as I think the function is supposed to do. Thanks.

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

@Demitry,

within the tep_image_function

if(!is_dir($thumbs_dir))mkdir($thumbs_dir, 0777);

within the tep_destroy_thumbs_dir function

chmod($dir . '/' . $file, 0777); 

This add-on is published since more than a year and no one else has reported these problems. I'm using it myself on a live store and no problems.

The only possible explanation for me is that your server may need different chmod settings.

Edited by raiwa
Link to comment
Share on other sites

@Demitry,

Just checked on my demostore. All images are updated when I activate watermark and also when i switch it back to zero (deactivate).

Link to comment
Share on other sites

@raiwa

thank you for the reply, Rainer.

I've been testing this problem with changing the file permissions manually on the folders and files for that thumbs folder and it is not making a difference. My hosting server settings are to create folders with 755 permissions and files with 644. However, I have an older version of this addon for an MS2.2 site and though the chmod code does not change the file or folder permissions to 777, I've never had this problem on that site.

The way I understand this process, is that when I change the Admin > Configure > Images > KissIT Reset Thumbs setting to "reset" and save, it should delete that /image/thumbs/ directory and all of its contents. Then recreate it with each tep_image() call accessed via site page load along with the new settings from the configuration table. Is this correct? ...because it if is, this is not happening with this BS Edge install regardless of folder & file permissions.

 

Edited by Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

Link to comment
Share on other sites

@raiwa

Hi Rainer,

I solved it! ..and it was not a bug in the code. It was completely my fault. I apologize to you and everyone else following this thread.

After spending a lot of time trying to find the coding issue in tep_destroy_thumbs_dir(), I looked at tep_cfg_reset_thumbs_cache() and noticed that the $dir value of DIR_FS_CATALOG_IMAGES is for the admin image folder definition.

After that, I looked at the BootStrap installation document in the addon package and realized that I added those two functions to the /includes/functions/general.php instead of the /admin/includes/functions/general.php file.

After making this correction I tested and it solved all the issues I was having. ..really sorry, and thank you for your time.

Demitry

Edited by Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

  • 4 weeks later...
Just now, wHiTeHaT said:

Anyone encounter problems with image dimensions over 4000x4000?

Here pages even stop showing any of the products if one of them could not be converted.

Server php memory_limit!

Who pretends to use such image sizes on WEB?:biggrin::biggrin:

Link to comment
Share on other sites

size in MB is not the criteria cause they need to be uncompressed for processing. It's the dimension the limit. 

 

Edited by raiwa
Link to comment
Share on other sites

  • 2 weeks later...

Hello Lecarl @discxpress,

There is no alt tag used for the big product images in core product_info.php. Only for the small image if no big product images are available.

You can add the code to use the products name for alt tag, but if you have more than one image, you'll need to add the numbering in order to have different tags.

Try this for standard without kiss it image thumbnailer line 121:

          echo tep_image('images/' . $pi['image'], addslashes($product_info['products_name']) . ' ' . $pi_counter, '', '', 'id="piGalImg_' . $pi_counter . '"');

For kiss it image thumbnail version it is already done in the product_info.php modifications in the last version r30.

 

rgds

Rainer

Link to comment
Share on other sites

14 hours ago, raiwa said:

Hello Lecarl @discxpress,

There is no alt tag used for the big product images in core product_info.php. Only for the small image if no big product images are available.

You can add the code to use the products name for alt tag, but if you have more than one image, you'll need to add the numbering in order to have different tags.

Try this for standard without kiss it image thumbnailer line 121:


          echo tep_image('images/' . $pi['image'], addslashes($product_info['products_name']) . ' ' . $pi_counter, '', '', 'id="piGalImg_' . $pi_counter . '"');

For kiss it image thumbnail version it is already done in the product_info.php modifications in the last version r30.

 

rgds

Rainer

@raiwa where do I apply that code change? Where do I get r30?

Thank you.

Link to comment
Share on other sites

@raiwa I just discovered that the image alt tag is in the code. It's existence is proven when you hover over the image. 

However, it is not present when you view the page source on a desktop. So it will throw a red flag when ran through validators.

One question remains. Do the search engines know what the image is when the alt is empty?

Thanks

Link to comment
Share on other sites

@discxpress,

the main image is tagged for search engines in this line:

      echo tep_image('images/' . $product_info['products_image'], NULL, NULL, NULL, 'itemprop="image" style="display:none;"');

and yes, the actual version is r27, r30 is not yet released, my faut, sorry. r27 includes already the alt tag like you said.

Edited by raiwa
Link to comment
Share on other sites

  • 3 months later...

@raiwa

Hi Raiwa,

First of all thank you very much for the wonderful addon.

I installed the BS Edge version last year, I think i added addons.oscommerce.com/info/9506 ( Add-On Compatibility support for OsCommerce 2.3.4 BS EDGE versions since September 2016 )

and tried to installed some BS addons. So far so good...when i tried to install your KissIT BS version, I found the admin site and the front end after add your code, it all go BLANK. So my solution is to go download the 234.1 version, and replace catalog/includes/functions/html_output.php and admin/includes/functions/general.php and then add your codes. It then working ok.

The original code is as below: (it show the page format ok, but i notice there is one different is that the original searching box is matching with all the other skin, please find image attached so you can understand what i mean. The image captured before I replaced the 234.1 version )image.png.d1d2e07129b73138704bcab44f4f75d5.png

	<?php
/*
  $Id$
	  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
	  Copyright (c) 2010 osCommerce
	  Released under the GNU General Public License
*/
	////
// The HTML href link wrapper function
  function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
    global $request_type, $session_started, $SID;
	    $page = tep_output_string($page);
	    if (!tep_not_null($page)) {
      die('</td></tr></table></td></tr></table><br /><br /><font color="#ff0000"><strong>Error!</strong></font><br /><br /><strong>Unable to determine the page link!<br /><br />');
    }
	    if ($connection == 'NONSSL') {
      $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
    } elseif ($connection == 'SSL') {
      if (ENABLE_SSL == true) {
        $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
      } else {
        $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
      }
    } else {
      die('</td></tr></table></td></tr></table><br /><br /><font color="#ff0000"><strong>Error!</strong></font><br /><br /><strong>Unable to determine connection method on a link!<br /><br />Known methods: NONSSL SSL</strong><br /><br />');
    }
	    if (tep_not_null($parameters)) {
      $link .= $page . '?' . tep_output_string($parameters);
      $separator = '&';
    } else {
      $link .= $page;
      $separator = '?';
    }
	    while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);
	// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
    if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) {
      if (tep_not_null($SID)) {
        $_sid = $SID;
      } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {
        if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
          $_sid = tep_session_name() . '=' . tep_session_id();
        }
      }
    }
	    if (isset($_sid)) {
      $link .= $separator . tep_output_string($_sid);
    }
	    while (strpos($link, '&&') !== false) $link = str_replace('&&', '&', $link);
	    if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {
      $link = str_replace('?', '/', $link);
      $link = str_replace('&', '/', $link);
      $link = str_replace('=', '/', $link);
    } else {
      $link = str_replace('&', '&amp;', $link);
    }
	    return $link;
  }
	////
// The HTML image wrapper function
  function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '', $responsive = true, $bootstrap_css = '') {
    if ( (empty($src) || ($src == 'images/')) && (IMAGE_REQUIRED == 'false') ) {
      return false;
    }
	// 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) . '" alt="' . tep_output_string($alt) . '"';
	    if (tep_not_null($alt)) {
      $image .= ' title="' . tep_output_string($alt) . '"';
    }
	    if ( (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) {
      if ($image_size = @getimagesize($src)) {
        if (empty($width) && tep_not_null($height)) {
          $ratio = $height / $image_size[1];
          $width = (int)($image_size[0] * $ratio);
        } elseif (tep_not_null($width) && empty($height)) {
          $ratio = $width / $image_size[0];
          $height = (int)($image_size[1] * $ratio);
        } elseif (empty($width) && empty($height)) {
          $width = $image_size[0];
          $height = $image_size[1];
        }
      } elseif (IMAGE_REQUIRED == 'false') {
        return false;
      }
    }
	    if (tep_not_null($width) && tep_not_null($height)) {
      $image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';
    }
	    $image .= ' class="';
	    if (tep_not_null($responsive) && ($responsive === true)) {
      $image .= 'img-responsive';
    }
	    if (tep_not_null($bootstrap_css)) $image .= ' ' . $bootstrap_css;
	    $image .= '"';
	    if (tep_not_null($parameters)) $image .= ' ' . $parameters;
	    $image .= ' />';
	    return $image;
  }
	////
// The HTML form submit button wrapper function
// Outputs a button in the selected language
  function tep_image_submit($image, $alt = '', $parameters = '') {
    global $language;
	    $image_submit = '<input type="image" src="' . tep_output_string('includes/languages/' . $language . '/images/buttons/' . $image) . '" alt="' . tep_output_string($alt) . '"';
	    if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
	    if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
	    $image_submit .= ' />';
	    return $image_submit;
  }
	////
// Output a function button in the selected language
  function tep_image_button($image, $alt = '', $parameters = '') {
    global $language;
	    return tep_image('includes/languages/' . $language . '/images/buttons/' . $image, $alt, '', '', $parameters);
  }
	////
// Output a separator either through whitespace, or with an image
  function tep_draw_separator($image = 'pixel_black.gif', $width = '100%', $height = '1') {
    return tep_image('images/' . $image, '', $width, $height);
  }
	////
// Output a form
  function tep_draw_form($name, $action, $method = 'post', $parameters = '', $tokenize = false) {
    global $sessiontoken;
	    $form = '<form name="' . tep_output_string($name) . '" action="' . tep_output_string($action) . '" method="' . tep_output_string($method) . '"';
	    if (tep_not_null($parameters)) $form .= ' ' . $parameters;
	    $form .= '>';
	    if ( ($tokenize == true) && isset($sessiontoken) ) {
      $form .= '<input type="hidden" name="formid" value="' . tep_output_string($sessiontoken) . '" />';
    }
	    return $form;
  }
	////
// Output a form input field
  function tep_draw_input_field($name, $value = '', $parameters = '', $type = 'text', $reinsert_value = true, $class = 'class="form-control"') {
    $field = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';
	    if ( ($reinsert_value == true) && ( (isset($_GET[$name]) && is_string($_GET[$name])) || (isset($_POST[$name]) && is_string($_POST[$name])) ) ) {
      if (isset($_GET[$name]) && is_string($_GET[$name])) {
        $value = stripslashes($_GET[$name]);
      } elseif (isset($_POST[$name]) && is_string($_POST[$name])) {
        $value = stripslashes($_POST[$name]);
      }
    }
	    if (tep_not_null($value)) {
      $field .= ' value="' . tep_output_string($value) . '"';
    }
	    if (tep_not_null($parameters)) $field .= ' ' . $parameters;
	    if (tep_not_null($class)) $field .= ' ' . $class;
	    $field .= ' />';
	    return $field;
  }
/*
////
// Output a form password field
// DEPRECATED AS OF 12 June 2015
  function tep_draw_password_field($name, $value = '', $parameters = '') {
    return tep_draw_input_field($name, $value, $parameters, 'password', false);
  }
*/
	////
// Output a selection field - alias function for tep_draw_checkbox_field() and tep_draw_radio_field()
  function tep_draw_selection_field($name, $type, $value = '', $checked = false, $parameters = '') {
    $selection = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';
	    if (tep_not_null($value)) $selection .= ' value="' . tep_output_string($value) . '"';
	    if ( ($checked == true) || (isset($_GET[$name]) && is_string($_GET[$name]) && (($_GET[$name] == 'on') || (stripslashes($_GET[$name]) == $value))) || (isset($_POST[$name]) && is_string($_POST[$name]) && (($_POST[$name] == 'on') || (stripslashes($_POST[$name]) == $value))) ) {
      $selection .= ' checked="checked"';
    }
	    if (tep_not_null($parameters)) $selection .= ' ' . $parameters;
	    $selection .= ' />';
	    return $selection;
  }
	////
// Output a form checkbox field
  function tep_draw_checkbox_field($name, $value = '', $checked = false, $parameters = '') {
    return tep_draw_selection_field($name, 'checkbox', $value, $checked, $parameters);
  }
	////
// Output a form radio field
  function tep_draw_radio_field($name, $value = '', $checked = false, $parameters = '') {
    return tep_draw_selection_field($name, 'radio', $value, $checked, $parameters);
  }
	////
// Output a form textarea field
// The $wrap parameter is no longer used in the core xhtml template
  function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
    $field = '<textarea class="form-control" name="' . tep_output_string($name) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';
	    if (tep_not_null($parameters)) $field .= ' ' . $parameters;
	    $field .= '>';
	    if ( ($reinsert_value == true) && ( (isset($_GET[$name]) && is_string($_GET[$name])) || (isset($_POST[$name]) && is_string($_POST[$name])) ) ) {
      if (isset($_GET[$name]) && is_string($_GET[$name])) {
        $field .= tep_output_string_protected(stripslashes($_GET[$name]));
      } elseif (isset($_POST[$name]) && is_string($_POST[$name])) {
        $field .= tep_output_string_protected(stripslashes($_POST[$name]));
      }
    } elseif (tep_not_null($text)) {
      $field .= tep_output_string_protected($text);
    }
	    $field .= '</textarea>';
	    return $field;
  }
	////
// Output a form hidden field
  function tep_draw_hidden_field($name, $value = '', $parameters = '') {
    $field = '<input type="hidden" name="' . tep_output_string($name) . '"';
	    if (tep_not_null($value)) {
      $field .= ' value="' . tep_output_string($value) . '"';
    } elseif ( (isset($_GET[$name]) && is_string($_GET[$name])) || (isset($_POST[$name]) && is_string($_POST[$name])) ) {
      if ( (isset($_GET[$name]) && is_string($_GET[$name])) ) {
        $field .= ' value="' . tep_output_string(stripslashes($_GET[$name])) . '"';
      } elseif ( (isset($_POST[$name]) && is_string($_POST[$name])) ) {
        $field .= ' value="' . tep_output_string(stripslashes($_POST[$name])) . '"';
      }
    }
	    if (tep_not_null($parameters)) $field .= ' ' . $parameters;
	    $field .= ' />';
	    return $field;
  }
	////
// Hide form elements
  function tep_hide_session_id() {
    global $session_started, $SID;
	    if (($session_started == true) && tep_not_null($SID)) {
      return tep_draw_hidden_field(tep_session_name(), tep_session_id());
    }
  }
	////
// Output a form pull down menu
  function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
    $field = '<select name="' . tep_output_string($name) . '"';
	    if (tep_not_null($parameters)) $field .= ' ' . $parameters;
	    $field .= ' class="form-control">';
	    if (empty($default) && ( (isset($_GET[$name]) && is_string($_GET[$name])) || (isset($_POST[$name]) && is_string($_POST[$name])) ) ) {
      if (isset($_GET[$name]) && is_string($_GET[$name])) {
        $default = stripslashes($_GET[$name]);
      } elseif (isset($_POST[$name]) && is_string($_POST[$name])) {
        $default = stripslashes($_POST[$name]);
      }
    }
	    for ($i=0, $n=sizeof($values); $i<$n; $i++) {
      $field .= '<option value="' . tep_output_string($values[$i]['id']) . '"';
      if ($default == $values[$i]['id']) {
        $field .= ' selected="selected"';
      }
	      $field .= '>' . tep_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;')) . '</option>';
    }
    $field .= '</select>';
	    if ($required == true) $field .= TEXT_FIELD_REQUIRED;
	    return $field;
  }
	////
// Creates a pull-down list of countries
  function tep_get_country_list($name, $selected = '', $parameters = '') {
    $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
    $countries = tep_get_countries();
	    for ($i=0, $n=sizeof($countries); $i<$n; $i++) {
      $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);
    }
	    return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
  }
	////
// Output a jQuery UI Button
  function tep_draw_button($title = null, $icon = null, $link = null, $priority = null, $params = null, $style = null) {
    static $button_counter = 1;
	    $types = array('submit', 'button', 'reset');
	    if ( !isset($params['type']) ) {
      $params['type'] = 'submit';
    }
	    if ( !in_array($params['type'], $types) ) {
      $params['type'] = 'submit';
    }
	    if ( ($params['type'] == 'submit') && isset($link) ) {
      $params['type'] = 'button';
    }
	    if (!isset($priority)) {
      $priority = 'secondary';
    }
	    $button = NULL;
	    if ( ($params['type'] == 'button') && isset($link) ) {
      $button .= '<a id="btn' . $button_counter . '" href="' . $link . '"';
	      if ( isset($params['newwindow']) ) {
        $button .= ' target="_blank"';
      }
    } else {
      $button .= '<button ';
      $button .= ' type="' . tep_output_string($params['type']) . '"';
    }
	    if ( isset($params['params']) ) {
      $button .= ' ' . $params['params'];
    }
	    $button .= ' class="btn ';
	    $button .= (isset($style)) ? $style : 'btn-default';
	    $button .= '">';
	    if (isset($icon) && tep_not_null($icon)) {
      $button .= ' <span class="' . $icon . '"></span> ';
    }
	    $button .= $title;
	    if ( ($params['type'] == 'button') && isset($link) ) {
      $button .= '</a>';
    } else {
      $button .= '</button>';
    }
	    $button_counter++;
	    return $button;
  }
	  // review stars
  function tep_draw_stars($rating = 0) {
    $stars = str_repeat('<span class="fa fa-star"></span>', (int)$rating);
    $stars .= str_repeat('<span class="fa fa-star-o"></span>', 5-(int)$rating);
    return $stars;
  }

After replaced with 234.1 version file and add your code, the search box somehow doesn't show the same, please find the attached image below:

image.png.eb4b171bb29424fb2e027ec6da89ad94.png

the below code is 234.1 version

	<?php
/*
  $Id$
	  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
	  Copyright (c) 2010 osCommerce
	  Released under the GNU General Public License
*/
	////
// The HTML href link wrapper function
  function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
    global $request_type, $session_started, $SID;
	    $page = tep_output_string($page);
	    if (!tep_not_null($page)) {
      die('</td></tr></table></td></tr></table><br /><br /><font color="#ff0000"><strong>Error!</strong></font><br /><br /><strong>Unable to determine the page link!<br /><br />');
    }
	    if ($connection == 'NONSSL') {
      $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
    } elseif ($connection == 'SSL') {
      if (ENABLE_SSL == true) {
        $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
      } else {
        $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
      }
    } else {
      die('</td></tr></table></td></tr></table><br /><br /><font color="#ff0000"><strong>Error!</strong></font><br /><br /><strong>Unable to determine connection method on a link!<br /><br />Known methods: NONSSL SSL</strong><br /><br />');
    }
	    if (tep_not_null($parameters)) {
      $link .= $page . '?' . tep_output_string($parameters);
      $separator = '&';
    } else {
      $link .= $page;
      $separator = '?';
    }
	    while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);
	// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
    if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) {
      if (tep_not_null($SID)) {
        $_sid = $SID;
      } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {
        if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
          $_sid = tep_session_name() . '=' . tep_session_id();
        }
      }
    }
	    if (isset($_sid)) {
      $link .= $separator . tep_output_string($_sid);
    }
	    while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);
	    if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {
      $link = str_replace('?', '/', $link);
      $link = str_replace('&', '/', $link);
      $link = str_replace('=', '/', $link);
    } else {
      $link = str_replace('&', '&amp;', $link);
    }
	    return $link;
  }
	////
// The HTML image wrapper function
  function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {
    if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {
      return false;
    }
	// 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) . '" alt="' . tep_output_string($alt) . '"';
	    if (tep_not_null($alt)) {
      $image .= ' title="' . tep_output_string($alt) . '"';
    }
	    if ( (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) {
      if ($image_size = @getimagesize($src)) {
        if (empty($width) && tep_not_null($height)) {
          $ratio = $height / $image_size[1];
          $width = intval($image_size[0] * $ratio);
        } elseif (tep_not_null($width) && empty($height)) {
          $ratio = $width / $image_size[0];
          $height = intval($image_size[1] * $ratio);
        } elseif (empty($width) && empty($height)) {
          $width = $image_size[0];
          $height = $image_size[1];
        }
      } elseif (IMAGE_REQUIRED == 'false') {
        return false;
      }
    }
	    if (tep_not_null($width) && tep_not_null($height)) {
      $image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';
    }
	    if (tep_not_null($parameters)) $image .= ' ' . $parameters;
	    $image .= ' />';
	    return $image;
  }
	////
// The HTML form submit button wrapper function
// Outputs a button in the selected language
  function tep_image_submit($image, $alt = '', $parameters = '') {
    global $language;
	    $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" alt="' . tep_output_string($alt) . '"';
	    if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
	    if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
	    $image_submit .= ' />';
	    return $image_submit;
  }
	////
// Output a function button in the selected language
  function tep_image_button($image, $alt = '', $parameters = '') {
    global $language;
	    return tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $parameters);
  }
	////
// Output a separator either through whitespace, or with an image
  function tep_draw_separator($image = 'pixel_black.gif', $width = '100%', $height = '1') {
    return tep_image(DIR_WS_IMAGES . $image, '', $width, $height);
  }
	////
// Output a form
  function tep_draw_form($name, $action, $method = 'post', $parameters = '', $tokenize = false) {
    global $sessiontoken;
	    $form = '<form name="' . tep_output_string($name) . '" action="' . tep_output_string($action) . '" method="' . tep_output_string($method) . '"';
	    if (tep_not_null($parameters)) $form .= ' ' . $parameters;
	    $form .= '>';
	    if ( ($tokenize == true) && isset($sessiontoken) ) {
      $form .= '<input type="hidden" name="formid" value="' . tep_output_string($sessiontoken) . '" />';
    }
	    return $form;
  }
	////
// Output a form input field
  function tep_draw_input_field($name, $value = '', $parameters = '', $type = 'text', $reinsert_value = true) {
    global $HTTP_GET_VARS, $HTTP_POST_VARS;
	    $field = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';
	    if ( ($reinsert_value == true) && ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) ) {
      if (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) {
        $value = stripslashes($HTTP_GET_VARS[$name]);
      } elseif (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) {
        $value = stripslashes($HTTP_POST_VARS[$name]);
      }
    }
	    if (tep_not_null($value)) {
      $field .= ' value="' . tep_output_string($value) . '"';
    }
	    if (tep_not_null($parameters)) $field .= ' ' . $parameters;
	    $field .= ' />';
	    return $field;
  }
	////
// Output a form password field
  function tep_draw_password_field($name, $value = '', $parameters = 'maxlength="40"') {
    return tep_draw_input_field($name, $value, $parameters, 'password', false);
  }
	////
// Output a selection field - alias function for tep_draw_checkbox_field() and tep_draw_radio_field()
  function tep_draw_selection_field($name, $type, $value = '', $checked = false, $parameters = '') {
    global $HTTP_GET_VARS, $HTTP_POST_VARS;
	    $selection = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';
	    if (tep_not_null($value)) $selection .= ' value="' . tep_output_string($value) . '"';
	    if ( ($checked == true) || (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name]) && (($HTTP_GET_VARS[$name] == 'on') || (stripslashes($HTTP_GET_VARS[$name]) == $value))) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name]) && (($HTTP_POST_VARS[$name] == 'on') || (stripslashes($HTTP_POST_VARS[$name]) == $value))) ) {
      $selection .= ' checked="checked"';
    }
	    if (tep_not_null($parameters)) $selection .= ' ' . $parameters;
	    $selection .= ' />';
	    return $selection;
  }
	////
// Output a form checkbox field
  function tep_draw_checkbox_field($name, $value = '', $checked = false, $parameters = '') {
    return tep_draw_selection_field($name, 'checkbox', $value, $checked, $parameters);
  }
	////
// Output a form radio field
  function tep_draw_radio_field($name, $value = '', $checked = false, $parameters = '') {
    return tep_draw_selection_field($name, 'radio', $value, $checked, $parameters);
  }
	////
// Output a form textarea field
// The $wrap parameter is no longer used in the core xhtml template
  function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
    global $HTTP_GET_VARS, $HTTP_POST_VARS;
	    $field = '<textarea name="' . tep_output_string($name) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';
	    if (tep_not_null($parameters)) $field .= ' ' . $parameters;
	    $field .= '>';
	    if ( ($reinsert_value == true) && ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) ) {
      if (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) {
        $field .= tep_output_string_protected(stripslashes($HTTP_GET_VARS[$name]));
      } elseif (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) {
        $field .= tep_output_string_protected(stripslashes($HTTP_POST_VARS[$name]));
      }
    } elseif (tep_not_null($text)) {
      $field .= tep_output_string_protected($text);
    }
	    $field .= '</textarea>';
	    return $field;
  }
	////
// Output a form hidden field
  function tep_draw_hidden_field($name, $value = '', $parameters = '') {
    global $HTTP_GET_VARS, $HTTP_POST_VARS;
	    $field = '<input type="hidden" name="' . tep_output_string($name) . '"';
	    if (tep_not_null($value)) {
      $field .= ' value="' . tep_output_string($value) . '"';
    } elseif ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) {
      if ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) ) {
        $field .= ' value="' . tep_output_string(stripslashes($HTTP_GET_VARS[$name])) . '"';
      } elseif ( (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) {
        $field .= ' value="' . tep_output_string(stripslashes($HTTP_POST_VARS[$name])) . '"';
      }
    }
	    if (tep_not_null($parameters)) $field .= ' ' . $parameters;
	    $field .= ' />';
	    return $field;
  }
	////
// Hide form elements
  function tep_hide_session_id() {
    global $session_started, $SID;
	    if (($session_started == true) && tep_not_null($SID)) {
      return tep_draw_hidden_field(tep_session_name(), tep_session_id());
    }
  }
	////
// Output a form pull down menu
  function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
    global $HTTP_GET_VARS, $HTTP_POST_VARS;
	    $field = '<select name="' . tep_output_string($name) . '"';
	    if (tep_not_null($parameters)) $field .= ' ' . $parameters;
	    $field .= '>';
	    if (empty($default) && ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) ) {
      if (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) {
        $default = stripslashes($HTTP_GET_VARS[$name]);
      } elseif (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) {
        $default = stripslashes($HTTP_POST_VARS[$name]);
      }
    }
	    for ($i=0, $n=sizeof($values); $i<$n; $i++) {
      $field .= '<option value="' . tep_output_string($values[$i]['id']) . '"';
      if ($default == $values[$i]['id']) {
        $field .= ' selected="selected"';
      }
	      $field .= '>' . tep_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;')) . '</option>';
    }
    $field .= '</select>';
	    if ($required == true) $field .= TEXT_FIELD_REQUIRED;
	    return $field;
  }
	////
// Creates a pull-down list of countries
  function tep_get_country_list($name, $selected = '', $parameters = '') {
    $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
    $countries = tep_get_countries();
	    for ($i=0, $n=sizeof($countries); $i<$n; $i++) {
      $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);
    }
	    return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
  }
	////
// Output a jQuery UI Button
  function tep_draw_button($title = null, $icon = null, $link = null, $priority = null, $params = null) {
    static $button_counter = 1;
	    $types = array('submit', 'button', 'reset');
	    if ( !isset($params['type']) ) {
      $params['type'] = 'submit';
    }
	    if ( !in_array($params['type'], $types) ) {
      $params['type'] = 'submit';
    }
	    if ( ($params['type'] == 'submit') && isset($link) ) {
      $params['type'] = 'button';
    }
	    if (!isset($priority)) {
      $priority = 'secondary';
    }
	    $button = '<span class="tdbLink">';
	    if ( ($params['type'] == 'button') && isset($link) ) {
      $button .= '<a id="tdb' . $button_counter . '" href="' . $link . '"';
	      if ( isset($params['newwindow']) ) {
        $button .= ' target="_blank"';
      }
    } else {
      $button .= '<button id="tdb' . $button_counter . '" type="' . tep_output_string($params['type']) . '"';
    }
	    if ( isset($params['params']) ) {
      $button .= ' ' . $params['params'];
    }
	    $button .= '>' . $title;
	    if ( ($params['type'] == 'button') && isset($link) ) {
      $button .= '</a>';
    } else {
      $button .= '</button>';
    }
	    $button .= '</span><script type="text/javascript">$("#tdb' . $button_counter . '").button(';
	    $args = array();
	    if ( isset($icon) ) {
      if ( !isset($params['iconpos']) ) {
        $params['iconpos'] = 'left';
      }
	      if ( $params['iconpos'] == 'left' ) {
        $args[] = 'icons:{primary:"ui-icon-' . $icon . '"}';
      } else {
        $args[] = 'icons:{secondary:"ui-icon-' . $icon . '"}';
      }
    }
	    if (empty($title)) {
      $args[] = 'text:false';
    }
	    if (!empty($args)) {
      $button .= '{' . implode(',', $args) . '}';
    }
	    $button .= ').addClass("ui-priority-' . $priority . '").parent().removeClass("tdbLink");</script>';
	    $button_counter++;
	    return $button;
  }
?>
	

I am not sure which part of the code change the appearance of the search box area....

can you please advise me how i can change it to match the format as first image?

 

Thanks!  Lyn

Link to comment
Share on other sites

Hello @ce7,

I'm sorry, but the search box has nothing to do with the changes of KissIT image thumbnailer. There is no tep_image function or image used in the search box.

For the blank pages you get, you should check your error log files to see which error is thrown, then post it and I'll see what happens.

The actual KissIT image thumbnailer has in the admin support instructions still the hardoded image directory constant DIR_WS_IMAGES in the code. You should replace all instances by 'images/'. This will be fixed in the already prepared next update. But anyway if you have the compatibility add-on installed and the blank page shows in bot, admin and store, there must be another reason for the error.

rgds

Rainer

Edited by raiwa
Link to comment
Share on other sites

On 3/13/2018 at 6:19 PM, raiwa said:

Hello @ce7,

I'm sorry, but the search box has nothing to do with the changes of KissIT image thumbnailer. There is no tep_image function or image used in the search box.

For the blank pages you get, you should check your error log files to see which error is thrown, then post it and I'll see what happens.

The actual KissIT image thumbnailer has in the admin support instructions still the hardoded image directory constant DIR_WS_IMAGES in the code. You should replace all instances by 'images/'. This will be fixed in the already prepared next update. But anyway if you have the compatibility add-on installed and the blank page shows in bot, admin and store, there must be another reason for the error.

rgds

Rainer

@raiwa

Thank you very much! I think my knowledge of coding is not good enough to understand all what you said, but i will do some more searching online and try to understand and change the images/ you mentioned. Once again, thank you for your wonderful addon and support!   Lyn

Link to comment
Share on other sites

@cupidare, sorry, only the formats mentionerd in the instructions: jpg, gif and png

Link to comment
Share on other sites

Greetings,

I have been trying to use the "Auto Out of Stock" with the KISSIT and i need a help with the funcion tep_image(); call

How do i call the:

  function tep_image($src, $alt = '', $width = '', $height = '', $products_id = null, $stock_check = '', $parameters = '', $responsive = true, $bootstrap_css = '') {

 

in the product_info.php:

 <?php echo tep_image('images/' . $product_info['products_image'], addslashes($product_info['products_name']), KISSIT_MAIN_PRODUCT_IMAGE_WIDTH, KISSIT_MAIN_PRODUCT_IMAGE_HEIGHT, ((KISSIT_MAIN_PRODUCT_WATERMARK_SIZE > 0)? preg_replace('%<img width="[0-9 ]+" height="[0-9 ]+" src="(.*)title=.+%', 'data-highres="$1', tep_image('images/' . $product_info['products_image'], null, $width, $height)) : 'data-highres="'. 'images/' . $product_info['products_image'] . '"')); ?>

 

$products_id has to pass the $product_info['products_id'] to the tep_image() at html_output.php in functions.

Thanks in advance.

 

Link to comment
Share on other sites

try this:

 <?php echo tep_image('images/' . $product_info['products_image'], addslashes($product_info['products_name']), KISSIT_MAIN_PRODUCT_IMAGE_WIDTH, KISSIT_MAIN_PRODUCT_IMAGE_HEIGHT, ((KISSIT_MAIN_PRODUCT_WATERMARK_SIZE > 0)? preg_replace('%<img width="[0-9 ]+" height="[0-9 ]+" src="(.*)title=.+%', 'data-highres="$1', tep_image('images/' . $product_info['products_image'], null, $width, $height, $product_info['products_id'])) : 'data-highres="'. 'images/' . $product_info['products_image'] . '"' . $product_info['products_id'])); ?> 

 

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...