/** * * Get K2 category children * @param int $catid * @param boolean $clear if true return array which is removed value construction * @return array */ public static function getK2CategoryChildren($catid, $clear = false) { static $array = array(); if ($clear) { $array = array(); } $user = JFactory::getUser(); $aid = $user->get('aid') ? $user->get('aid') : 1; $catid = (int) $catid; $db = JFactory::getDBO(); $query = "SELECT * FROM #__k2_categories WHERE parent={$catid} AND published=1 AND trash=0 AND access<={$aid} ORDER BY ordering "; $db->setQuery($query); $rows = $db->loadObjectList(); foreach ($rows as $row) { array_push($array, $row->id); if (modJABulletin::hasK2Children($row->id)) { modJABulletin::getK2CategoryChildren($row->id); } } return $array; }
defined('_JEXEC') or die('Restricted access'); if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); } $mainframe = JFactory::getApplication(); if (!defined('_MODE_JABULLETIN_ASSETS_')) { define('_MODE_JABULLETIN_ASSETS_', 1); JHTML::stylesheet('modules/' . $module->module . '/assets/style.css'); if (is_file(JPATH_SITE . DS . 'templates' . DS . $mainframe->getTemplate() . DS . 'css' . DS . $module->module . ".css")) { JHTML::stylesheet('templates/' . $mainframe->getTemplate() . '/css/' . $module->module . ".css"); } } // Include the syndicate functions only once require_once dirname(__FILE__) . DS . 'helper.php'; require_once dirname(__FILE__) . DS . 'jaimage.php'; $helper = new modJABulletin(); $useCustomText = $params->get("use_custom_text", 0); $customText = $params->get("custom_text", ""); $showcreater = $params->get('show_author', 0); $showreadmore = $params->get('show_readmore', 0); // if enable caching data $list = $helper->getListArticles($params); $app = JFactory::getApplication(); $template_name = $app->getTemplate(); require JModuleHelper::getLayoutPath('mod_jabulletin'); ?> <script type="text/javascript"> var Ja_direction = ''; var cookie_path = '/'; var cur_template_name = '<?php echo $template_name;