www.gusucode.com > 同城苏州黄页系统php源码程序 > lib/smarty/plugins/modifier.zoompic.php
<? function smarty_modifier_zoompic($picname,$w,$h,$type='mini',$flash=false,$imgTagAttr='') { if(empty($picname)) return false; global $app; if( !preg_match("|^http://|i",$picname) and !preg_match("|^[a-z]:\\\\|i",$picname) ) $picname=$app->upload_url.$picname; $size=@getimagesize($picname);//pp($size); if( ( $size[2]==4 or $size[2]==13 ) and $flash ) { if( $size[0]>0 or $size[1]>0 ) { if($size[0]/$size[1]>=$w/$h) $h=($w/$size[0])*$size[1]; else $w=($h/$size[1])*$size[0]; } $r="<object CLASSID='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' CODEBASE='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' WIDTH='{$w}' HEIGHT='{$h}'><param NAME='flash_component' VALUE='ImageViewer.swc'><param NAME='movie' VALUE='{$picname}'><param NAME='quality' VALUE='high'><param NAME='FlashVars' VALUE='flashlet={imageLinkTarget:'_blank',captionFont:'Verdana',titleFont:'Verdana',showControls:true,frameShow:false,slideDelay:5,captionSize:10,captionColor:#333333,titleSize:10,transitionsType:'Random',titleColor:#333333,slideAutoPlay:false,imageURLs:['img1.jpg','img2.jpg','img3.jpg'],slideLoop:false,frameThickness:2,imageLinks:['http://macromedia.com/','http://macromedia.com/','http://macromedia.com/'],frameColor:#333333,bgColor:#FFFFFF,imageCaptions:[]}'><embed SRC='{$picname}' quality='high' flashvars='flashlet={imageLinkTarget:'_blank',captionFont:'Verdana',titleFont:'Verdana',showControls:true,frameShow:false,slideDelay:5,captionSize:10,captionColor:#333333,titleSize:10,transitionsType:'Random',titleColor:#333333,slideAutoPlay:false,imageURLs:['img1.jpg','img2.jpg','img3.jpg'],slideLoop:false,frameThickness:2,imageLinks:['http://macromedia.com/','http://macromedia.com/','http://macromedia.com/'],frameColor:#333333,bgColor:#FFFFFF,imageCaptions:[]}' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' WIDTH='{$w}' HEIGHT='{$h}'></embed></object>"; } elseif( $size[0]>$w or $size[1]>$h ) { $r=$app->site_url.'mod.php/piczoom.php?pic='.urlencode($picname).'&type='.$type.'&w='.$w.'&h='.$h; if($flash) $r="<img src='{$r}' $imgTagAttr>"; } else { $r=$picname; if($flash) $r="<img src='{$r}' $imgTagAttr>"; } if($ifFlash) { } return $r; } ?>