示例#1
0
 function showImage(&$row, &$params, &$menuImgStr, &$spanStyle)
 {
     /**
     /* Function Desc- If an image can be displayed it will set $menuImgStr to
     /* a string of html to be used
     */
     $menuImage = mygosu_menus::getMenuImage($row->params);
     /*echo ("<script type='text/javascript'>alert ('name = ".$row->name." image = ".$menuImage."');</script>");*/
     $imgLoc = $GLOBALS["mosConfig_absolute_path"] . "/images/stories/" . $menuImage;
     if (!file_exists($imgLoc)) {
         return "";
     }
     // if image doesn't exist then return ""
     if ($menuImage != "" && $menuImage != "-1") {
         $spanStyle = " style='margin:0px 0px 0px " . ($params->get('img_resizew') + 2) . "px;'";
         if ($params->get('img_resize')) {
             $thumb = mygosu_menus::resizeMenuImage($imgLoc, $params->get('img_resizew'), $params->get('img_resizeh'));
             if ($thumb) {
                 $menuImgStr = "<img class='lftImg' border='0' src='" . htmlspecialchars($thumb) . "' alt='menu_thumb'/>";
             }
         }
         if ($menuImgStr == "") {
             $menuImgStr = "<span><img class='lftImg' border='0' src='" . $GLOBALS["mosConfig_live_site"] . "/images/stories/" . htmlspecialchars($menuImage) . "' alt='menu_thumb'/></span>";
         }
     }
 }