public static function getUrl($params) { $ids = ModBannerHelper::banner_get_img_arr($params); if (count($ids[0]) == 0) { return null; } $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select(array('id,link'))->from($db->quoteName('#__menu'))->where($db->quoteName('id') . 'in(' . implode(',', $ids[1]) . ')'); try { $db->setQuery($query); $ret = $db->loadObjectList(); } catch (Exception $e) { return false; } foreach ($ret as $obj) { $data[$obj->id] = $obj->link; } return $data; }
<?php defined('_JEXEC') or die; $time = is_numeric($params->get('time')) ? $params->get('time') : 5000; $link = ModBannerHelper::getUrl($params); $banner_info = ModBannerHelper::banner_get_img_arr($params); $module_width = is_numeric($params->get('width')) ? $params->get('width') : 700; $module_height = is_numeric($params->get('height')) ? $params->get('height') : 300; $img_num = count($banner_info[0]); $document = JFactory::getDocument(); $document->addScript('media/mod_show/js/jquery.min.js'); $document->addScript('media/mod_show/js/ck_slide.js'); ?> <style> .mod-banner .ck-slidebox ul li.current em { background-color: #fe6500;} .mod-banner .ck-slidebox ul li em:hover { background-color: #fe6500;} .mod-banner { width:<?php echo $module_width; ?> px; height:<?php echo $module_height; ?> px; margin: 0 auto;} .mod-banner ul.mod-banner-wrapper { height:<?php echo $module_height; ?> px;} </style>