function Joom_OpenImage($open, $id, $catpath, $catid, $imgfilename, $imgtitle = '', $imgdescription = '') { global $func; $config = Joom_getConfig(); // Sanitize $catpath for robustness: // assumed to have no starting and one trailing slash aftewards $catpath = preg_replace("/^[\\/]*(.*[^\\/])[\\/]*\$/", "\$1/", $catpath); $picturepath = _JOOM_LIVE_SITE . $config->jg_pathimages; $origpicturepath = _JOOM_LIVE_SITE . $config->jg_pathoriginalimages; // TODO: switch to interface when completed if (!defined('_JOOM_ITEMID')) { $Itemid_jg = joommodule::getJoomId(); define('_JOOM_ITEMID', $Itemid_jg); } // TODO: necessary? $Itemid = ''; if (defined('_JOOM_ITEMID')) { $Itemid_array = explode('=', _JOOM_ITEMID); if (isset($Itemid_array[1])) { $Itemid = $Itemid_array[1]; } } $Itemid_jg = $Itemid != '' ? "&Itemid=" . $Itemid : ""; if ($func == 'detail' && !defined('_JOOM_PARENT_MODULE')) { $imgpath = $config->jg_pathoriginalimages . $catpath; } else { $imgpath = $config->jg_pathimages . $catpath; } if ($config->jg_watermark == 1) { if ($config->jg_detailpic_open > 3 && $config->jg_lightboxbigpic) { $orig = 1; } else { $orig = $func == 'detail' ? 1 : 0; } $js_imgpath = _JOOM_LIVE_SITE . 'index.php?option=com_joomgallery&func=watermark&id=' . $id . '&catid=' . $catid . '&orig=' . $orig . '&no_html=1' . $Itemid_jg; } else { if ($config->jg_detailpic_open > 3 && $config->jg_lightboxbigpic) { $js_imgpath = $origpicturepath . $catpath; } else { $js_imgpath = $func == 'detail' ? $origpicturepath . $catpath : $picturepath . $catpath; } $js_imgpath .= $imgfilename; } switch ($open) { case 1: $link = $js_imgpath . "\" target=\"_blank"; break; case 2: $imginfo = getimagesize(JPath::clean(JPATH_ROOT . DS . $imgpath . $imgfilename)); $link = "javascript:joom_openjswindow('" . $js_imgpath . "','" . Joom_FixForJS($imgtitle) . "', '" . $imginfo[0] . "','" . $imginfo[1] . "')"; break; case 3: $imginfo = getimagesize(JPath::clean(JPATH_ROOT . DS . $imgpath . $imgfilename)); $link = "javascript:joom_opendhtml('" . $js_imgpath . "','" . Joom_FixForJS($imgtitle) . "','"; if ($config->jg_show_description_in_dhtml) { $link .= Joom_FixForJS($imgdescription, 1) . "','"; } else { $link .= "','"; } $link .= $imginfo[0] . "','" . $imginfo[1] . "')"; break; case 5: //thickbox3 $link = $js_imgpath . "\" class=\"thickbox\" rel=\"joomgallery\" title=\"" . $imgtitle; break; case 6: //slimbox $link = $js_imgpath . "\" rel=\"lightbox[joomgallery]\" title=\"" . $imgtitle; break; default: $link = JRoute::_('index.php?option=com_joomgallery&func=detail&id=' . $id . $Itemid_jg); break; } return $link; }
$jg_slideshow_data .= $jg_between; $jg_slideshow_data .= $fileinfo['source'][$i]; $jg_slideshow_data .= $jg_between; $jg_slideshow_data .= Joom_FixForJS($fileinfo['title'][$i]); $jg_slideshow_data .= $jg_between; $jg_slideshow_data .= Joom_FixForJS($fileinfo['description'][$i]); $jg_slideshow_data .= $jg_between; if ($fileinfo['date'][$i] != '') { $jg_slideshow_data .= strftime($config->jg_dateformat, $fileinfo['date'][$i]); } else { $jg_slideshow_data .= ''; } $jg_slideshow_data .= $jg_between; $jg_slideshow_data .= $fileinfo['hits'][$i]; $jg_slideshow_data .= $jg_between; if ($fileinfo['rating1'][$i] > 0) { $jg_slideshow_data .= number_format($fileinfo['rating2'][$i] / $fileinfo['rating1'][$i], 2, ",", ".") . "(" . $fileinfo['rating1'][$i] . JText::_('JGS_VOTES') . ")"; } else { $jg_slideshow_data .= JText::_('JGS_NO_VOTES'); } $jg_slideshow_data .= $jg_between; $jg_slideshow_data .= number_format($fileinfo['filesize'][$i] / 1024, 2, ",", ".") . " KB"; $jg_slideshow_data .= $jg_between; $jg_slideshow_data .= Joom_FixForJS($fileinfo['author'][$i]); $jg_slideshow_data .= "\");\n"; } echo $jg_slideshow_data; ?> //--> </script>