function tadgallery_cate($options) { global $xoopsDB, $xoTheme; // $default_val="4|album|rand()||300|line-height:1.8;|0"; $options[0] = intval($options[0]); $shownum = empty($options[0]) ? '5' : $options[0]; $display_arr = array('title', 'album', 'content'); $display_mode = in_array($options[1], $display_arr) ? $options[1] : "album"; $sortby_arr = array('csn', 'rand()', 'sort'); $sortby = in_array($options[2], $sortby_arr) ? $options[2] : "rand()"; $sort_desc = $options[3] == "desc" ? "desc" : ""; $options[4] = intval($options[4]); $lengh = empty($options[4]) ? 300 : $options[4]; $content_css = (empty($options[5]) or strrpos(';', $options[5]) === false) ? 'line-height:1.8;' : $options[5]; $only_have_desc = $options[6] == "1" ? "1" : "0"; if ($display_mode != "content") { $only_have_desc = 0; } $tadgallery = new tadgallery(); $order = "{$sortby} {$sort_desc}"; $albums = $tadgallery->get_albums('return', true, $shownum, $order, true, $lengh, $only_have_desc); $block['albums'] = $albums; $block['display_mode'] = $display_mode; $block['content_css'] = $content_css; $block['count'] = sizeof($albums); $block['bootstrap_version'] = $_SESSION['bootstrap']; if ($xoTheme) { $xoTheme->addStylesheet('modules/tadgallery/module.css'); $xoTheme->addStylesheet('modules/tadgallery/class/jquery.thumbs/jquery.thumbs.css'); $xoTheme->addScript('modules/tadgallery/class/jquery.thumbs/jquery.thumbs.js'); } return $block; }