We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26085
    • 494 Posts
    # Usage: [!getImg? &folder=`papka` &name=`image` &alt=`picture alt` !]
    # &name - file name
    # &folder - folder with images
    # &alt - picture alt
    check small image in modx change
    and show it
    to be continue...

    
    
    
    <?php
    /*
    #   Name:    getImg
    #   Version: 1.0.0
    #   Author:  SamZ  ([email protected])
    #   Date:    Nov 8, 2007
    #   Usage:    [!getImg? &folder=`papka` &name=`image` &alt=`picture alt` !]
    #   &name  - file name 
    #   &folder - folder with images  
    #   &alt      - picture alt
    */
    
    if(!function_exists("getImg"))
    {
     function getImg($i="", $f="", $a="")
     {
     	if (@file_exists($f."/.thumb_".$i.".jpg"))
    	{
    		$out = '<img src="'.$f.'/.thumb_'.$i.'.jpg" alt="'.$a.'"/>';
    		return $out;
    	}
    	if (@file_exists($f."/".$i.".jpg"))
    	{
    		$out = '<img src="'.$f.'/'.$i.'.jpg" alt="'.$a.'"/>';
    		return $out;
    	}
    
     }
    } 
    
    return getImg($name, $folder, $alt);
    ?>