public static function getUrl($params) { $ids = ModShowHelper::show_get_img_arr($params); if (count($ids[1]) == 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') : 10000; $module_width = is_numeric($params->get('width')) ? $params->get('width') : 950; $module_height = is_numeric($params->get('height')) ? $params->get('height') : 250; $suffix = ModShowHelper::show_get_img_arr($params)[0]; $menu_ids = ModShowHelper::show_get_img_arr($params)[1]; $img_num = count(ModShowHelper::show_get_img_arr($params)[0]); $href = ModShowHelper::getUrl($params); $page_num = ceil($img_num / 3); $document = JFactory::getDocument(); $document->addScript('media/mod_show/js/jquery.min.js'); $document->addScript('media/mod_show/js/ck_slide.js'); ?> <style type="text/css"> .ck-slide .ck-prev, .ck-slide .ck-next { position: absolute; top: 50%; z-index: 2; width: 35px; height: 70px; margin-top: -35px; border-radius: 3px; opacity: .15; background: red; text-indent: -9999px; background-repeat: no-repeat; transition: opacity .2s linear 0s;} .ck-slide .ck-prev { display:none;left: 5px; background: url(<?php echo JURI::base(true) . '/media/mod_show/image/arrow-left.png'; ?> ) #000 50% no-repeat;} .ck-slide .ck-next { display:none;right: 5px; background: url(<?php echo JURI::base(true) . '/media/mod_show/image/arrow-right.png'; ?> ) #000 50% no-repeat;} .ck-slide { width:<?php echo $module_width; ?> px; height:<?php
<?php defined('_JEXEC') or die; //var_dump($params);die; $mudel_width = $params->get('width'); $mudel_height = $params->get('height'); $time = $params->get('time'); if ($time == null) { $time = 10000; } $inner_width = ($mudel_width - 110) / 3; $img_height = $mudel_height / 2.8; $img_width = ($mudel_width - 110) / 3; $show_start = $params->get('auto'); JHtml::_('bootstrap.tooltip'); $img_info = ModShowHelper::show_get_img_arr($params); $href = ModShowHelper::getUrl($params); $suffix = $img_info[0]; $menu_ids = $img_info[1]; $img_num = count($img_info[0]); //echo $img_num;die; $page_num = ceil($img_num / 3); // JHtml::_('jquery.framework'); $document = JFactory::getDocument(); $document->addScript('media/mod_show/js/jquery.min.js'); $document->addScript('media/mod_show/js/ck_slide.js'); ?>