Results 1 to 10 of 1688

Threaded View

  1. #11
    Join Date
    Jul 2012
    Posts
    16,798
    Plugin Contributions
    17

    Default Re: 4 days and 8 hrs a day later - hover effect still not working

    Quote Originally Posted by niccol View Post
    Yeah, but it is probably easier to change the module than change the auto-installer :-) You've got the line number form the errors

    Code:
    [04-Feb-2015 16:25:51 America/Chicago] PHP Warning: strstr(): Empty needle in /home/enignet/public_html/includes/classes/bmz_image_handler.class.php on line 129
    You are probably going to do something like this

    Code:
    	function determine_image_sizetype() {
    		global $ihConf;
    		
    		if (strstr($this->src, $ihConf['large']['suffix'])) {
    			$this->sizetype = 'large';
    		} elseif (strstr($this->src, $ihConf['medium']['suffix'])) {
    			$this->sizetype = 'medium';
    		} elseif ((intval($this->width) == intval($ihConf['small']['width'])) && (intval($this->height) == intval($ihConf['small']['height']))) {
    			$this->sizetype = 'small';
    		} else
    		$this->sizetype = 'generic';
    	}
    changed to:

    Code:
    	function determine_image_sizetype() {
    		global $ihConf;
    		
    		$this->sizetype = 'generic';
    
    		if($ihConf['large']['suffix'] != '')
    		{
    			if (strstr($this->src, $ihConf['large']['suffix'])) {
    				$this->sizetype = 'large';
    			}			
    		}
    
    		if($ihConf['medium']['suffix'] != '')
    		{
    			if (strstr($this->src, $ihConf['medium']['suffix'])) {
    				$this->sizetype = 'medium';
    			}			
    		}		
    		
    		if($ihConf['large']['small'] != '')
    		{
    			if (strstr($this->src, $ihConf['small']['suffix'])) {
    				$this->sizetype = 'small';
    			}			
    		}
    }
    Off the top of my head and without looking at any of the other areas or consequences.
    I would suggest either of the following two depending on the desired goal. First would be to prevent the error in this section of code, but wouldn't address similar potential problems later on, the second would set the variables in this section of code but also may still have the issue later, either way, an example to address the issue and maintain existing functionality. The example above appears to lead to all images being the size of the last defined size.

    Code:
    function determine_image_sizetype() {
    global $ihConf;
    
    if (zen_not_null($ihConf['large']['suffix']) && strstr($this->src, $ihConf['large']['suffix'])) {
    $this->sizetype = 'large';
    } elseif (zen_not_null($ihConf['medium']['suffix']) && strstr($this->src, $ihConf['medium']['suffix'])) {
    $this->sizetype = 'medium';
    } elseif ((intval($this->width) == intval($ihConf['small']['width'])) && (intval($this->height) == intval($ihConf['small']['height']))) {
    $this->sizetype = 'small';
    } else
    $this->sizetype = 'generic';
    }
    Code:
    function determine_image_sizetype() {
    global $ihConf;
    if (!zen_not_null($ihConf['large']['suffix']) {
    $ihConf['large']['suffix'] = '_LRG';
    } 
    
    if (!zen_not_null($ihConf['medium']['suffix']) {
    $ihConf['medium']['suffix'] = '_MED';
    }
    
    if (strstr($this->src, $ihConf['large']['suffix'])) {
    $this->sizetype = 'large';
    } elseif (strstr($this->src, $ihConf['medium']['suffix'])) {
    $this->sizetype = 'medium';
    } elseif ((intval($this->width) == intval($ihConf['small']['width'])) && (intval($this->height) == intval($ihConf['small']['height']))) {
    $this->sizetype = 'small';
    } else
    $this->sizetype = 'generic';
    }
    Last edited by mc12345678; 5 Feb 2015 at 01:33 PM. Reason: didn't correct a copy/paste
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. v158 Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread
    By lat9 in forum All Other Contributions/Addons
    Replies: 711
    Last Post: 10 May 2025, 02:13 PM
  2. Attribute image replaces main product image on select [Support Thread]
    By exoticcorpse in forum All Other Contributions/Addons
    Replies: 160
    Last Post: 28 Oct 2024, 10:50 PM
  3. v139h Image Handler 3 Support Thread (for ZC v1.3.9)
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 1095
    Last Post: 2 Oct 2017, 12:42 PM
  4. v138a Image Handler 2 (for ZC v1.3.8 ONLY) Support
    By timkroeger in forum All Other Contributions/Addons
    Replies: 7098
    Last Post: 12 Oct 2014, 03:48 AM
  5. Image Handler Support Please
    By nadinesky in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 30 Sep 2013, 03:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR