[[thumb? &image=`path to image` &alt=`optional, alt text` &h=`optional, height` &w=`optional, width`]]
[[thumb? &image=`tvimage` &h=`100` &w=`100`]]

<?php // Name: thumb // Version: 0.1 // Author: Thomas Wagensommerer // Date: 5.1.2007 // Description: thumb is a simplified MODx frontend for phpThumb() // Installation: // phpThumb() by James Heinrich // is required to use thumb // download phpThumb at: http://phpthumb.sourceforge.net/ // copy it into assets/snippets/phpThumb/ // create a new snippet "thumb" // paste this text into it // Parameters: // image: path to image file // alt: alt tag for the image, optional // h: height of thumbnail, optional if w is given // w: width of thumbnail, optional if h is given // Example: // [[thumb? &image=`assets/images/picture.jpg` &w=`150` &h=`150`]] // Instructions: // if the image should retain its proportions only one parameter, h or w, is required // if both parameters h and w are given, the image is zoomed and cropped to fill that area $altstring = isset($alt)? ' alt="'.$alt.'"' : ' alt="image"'; $heightstring = isset($w)? ' width="'.$w.'"' : ''; $widthstring = isset($h)? ' height="'.$h.'"' : ''; $wstring = isset($w)? '&w='.$w : ''; $hstring = isset($h)? '&h='.$h : ''; if (($w<>'') and ($h<>'')) $zcstring = '&zc=1'; return '<img src="/assets/snippets/phpThumb/phpThumb.php?src=/'.$image.$wstring.$hstring.$zcstring.$altstring.$heightstring.$widthstring.'/>'; ?>


$altstring = isset($alt)? ' alt="'.$alt.'"' : ' alt="image"'; $heightstring = isset($w)? ' width="'.$w.'"' : ''; $widthstring = isset($h)? ' height="'.$h.'"' : ''; $class = isset($class)? ' class="'.$class.'"' : ''; $wstring = isset($w)? '&w='.$w : ''; $hstring = isset($h)? '&h='.$h : ''; if (($w<>'') and ($h<>'')) $zcstring = '&zc=1'; return '<img src="/assets/snippets/phpThumb/phpThumb.php?src=/'.$image.$wstring.$hstring.$zcstring.'"'.$altstring.$heightstring.$widthstring.$class.'/>';