function b_sitemap_d3downloads( $mydirname ) { require_once dirname( dirname(__FILE__) ).'/class/user_access.php' ; include_once dirname( dirname(__FILE__) ).'/class/mycategory.php' ; $user_access = new user_access( $mydirname ) ; $mycategory = new MyCategory( $mydirname, 'Show' ) ; $whr = "cid IN ( ".implode( ",", $user_access->can_read() )." )" ; return $mycategory->sitemap( '', $whr, 1 ) ; }
function b_d3downloads_category_show( $options ) { include_once dirname( dirname(__FILE__) ).'/class/user_access.php' ; include_once dirname( dirname(__FILE__) ).'/class/mycategory.php' ; $mydirname = empty( $options[0] ) ? 'd3downloads' : $options[0] ; $intree = empty( $options[1] ) ? 0 : 1 ; $cols= empty( $options[2] ) ? 1 : intval( $options[2] ) ; $this_template = empty( $options[3] ) ? 'db:'.$mydirname.'_block_category.html' : trim( $options[3] ) ; if( preg_match( '/[^0-9a-zA-Z_-]/' , $mydirname ) ) die( 'Invalid mydirname' ) ; $user_access = new user_access( $mydirname ) ; $whr = "cid IN ( ".implode( ",", $user_access->can_read() )." )" ; $mycategory = new MyCategory( $mydirname, 'Show' ) ; $whr_append = $mycategory->default_whr_append() ; $category = $mycategory->sitemap( 'index.php?', $whr, 0, $whr_append, $intree ) ; if( ! empty( $category ) ){ $block['category'] = $category ; $block['mydirname'] = $mydirname ; $block['mod_url'] = XOOPS_URL.'/modules/'.$mydirname ; $block['intree'] = $intree; $block['cols'] = $cols; $block['lang_total'] = _MB_D3DOWNLOADS_TOTAL; if( empty( $options['disable_renderer'] ) ) { require_once XOOPS_ROOT_PATH.'/class/template.php' ; $tpl = new XoopsTpl() ; $tpl->assign( 'block' , $block ) ; $ret['content'] = $tpl->fetch( $this_template ) ; return $ret ; } else { return $block ; } } }
$mycategory = new MyCategory( $mydirname, 'Show' ) ; $user_access = new user_access( $mydirname ) ; // ページナビの処理 $total = $mycategory->category_sum() ; $select_perpage = d3download_select_perpage( $mydirname ) ; $current_start = isset($_GET['start']) ? intval( $_GET['start'] ) : 0 ; $perpage4assign = d3download_items_perpage(); require_once XOOPS_ROOT_PATH.'/class/pagenav.php' ; $pagenav = new XoopsPageNav( $total, $select_perpage, $current_start, 'start', 'page=categorymanager&perpage='.$select_perpage ); $pagenav4assign = $pagenav->renderNav( 10 ) ; // GET CATEGORYLIST $category = $mycategory->get_categorylist( $select_perpage, $current_start ) ; $sitemap = $mycategory->sitemap( 'admin/index.php?page=categoryedit' ) ; // TITLE & WEIGHT UPDATE if( ! empty( $_POST['category_update'] ) && ! empty( $_POST['weights'] ) ) { if ( ! $xoopsGTicket->check( true , 'd3downloads' ) ) { redirect_header(XOOPS_URL.'/modules/'.$mydirname.'/admin/index.php',3,$xoopsGTicket->getErrors()); } $errors = d3download_categorymanager_data_update( $mydirname ) ; $mycategory->serialize_insertdb() ; d3download_delete_cache_of_categories( $mydirname ) ; redirect_header( XOOPS_URL."/modules/$mydirname/admin/index.php?page=categorymanager&perpage=$select_perpage" , 2 , $errors ? sprintf( _MD_D3DOWNLOADS_ERROR_MESSEAGE , implode( ',' , $errors ) ) : _MD_D3DOWNLOADS_REGSTERED ) ; exit(); } // DELETE if( ! empty( $_POST['delete'] ) ) {