if( empty( $historydata ) ) { redirect_header( XOOPS_URL."/modules/$mydirname/" , 2 , _MD_D3DOWNLOADS_NOMATCH ) ; exit(); } $lid = $historydata['lid']; $history4assign = $historydata['historydata']; // GET HISTORY lIST $historylist = array() ; $historylist = $history->get_history_list( $lid, $id ); // GET DOWNLOADDATA include_once dirname(dirname(__FILE__)).'/class/mydownload.php' ; $mydownload = new MyDownload( $mydirname, $lid ); $download4assign = $mydownload->get_downdata_for_singleview( 0, $lid, 0, 0, 1 ); $invisibleinfo = $mydownload->Invisible_Info(); // HISTORY RESTORE if( ! empty( $_POST['restore'] ) ) { if ( ! $xoopsGTicket->check( true , 'd3downloads' ) ) { redirect_header(XOOPS_URL.'/modules/'.$mydirname.'/admin/index.php',3,$xoopsGTicket->getErrors()); } require_once dirname( dirname(__FILE__) ).'/include/common_functions.php' ; $errors = ''; $id = isset( $_POST['id'] ) ? intval( $_POST['id'] ) : 0 ; $lid = isset( $_POST['lid'] ) ? intval( $_POST['lid'] ) : 0 ; $cid = isset( $_POST['cid'] ) ? intval( $_POST['cid'] ) : 0 ; $new_id = $history->history_Insert_DB( $lid ) ; $result = $history->history_Restore( $id, $lid );
// SCREEN SHOTS DATA $shots_help = ''; $canuseshots = $unapproval->can_useshots() ; $usealbum = $unapproval->can_albumselect() ; if( ! empty( $canuseshots ) ){ $shots_dir = d3download_shots_dir( $mydirname, $cid4assign ); $img_ar = $unapproval->shots_img_ar( $cid4assign, $shots_dir ) ; if( empty( $usealbum ) ){ $shots_help = sprintf( _MD_D3DOWNLOADS_SUBMIT_LOGOURL_DESC , $shots_dir ); } } // GET DOWNLOADDATA $mydownload = new MyDownload( $mydirname ); $nowdata = $mydownload->get_downdata_for_singleview( 0, $aprovalid, 0, 1, 1 ); // TRANSACTION PART if( isset( $_POST['makedownload_post'] ) || isset( $_POST['makedownload_preview'] ) ) { if ( ! $xoopsGTicket->check( true , 'd3downloads' ) ) { redirect_header(XOOPS_URL.'/modules/'.$mydirname.'/admin/index.php',3,$xoopsGTicket->getErrors()); } $params_array = array( 'category' , 'usealbum' , 'downdata' ) ; foreach( $params_array as $key ) { $params[$key] = $$key ; } $submit_result = d3download_submit_execution( $mydirname, 'approval', $params ) ; $download4assign = $submit_result['download4assign'] ; $iserror = $submit_result['iserror'] ; $error_message = $submit_result['error_message'] ; if( isset( $_POST['makedownload_preview'] ) ){ $ispreview = true ; $preview_title = $submit_result['preview_title'] ;
if( empty( $cid ) ) $cid = $mydownload->return_cid(); // 閲覧できないカテゴリの場合はリダイレクト $canread = $user_access->user_access_for_cat( $cid, $whr_cat ); if( empty( $canread ) ) { redirect_header( XOOPS_URL.'/modules/'.$mydirname.'/',3, _MD_D3DOWNLOADS_NOREADLINKPERM ); exit(); } // 閲覧可能なリンクのみの登録件数を取得しアサイン $total = $mydownload->Total_Num( $whr_cat, $cid ); $total_num = sprintf( _MD_D3DOWNLOADS_CATEGORY_NUM , $total ); $xoopsTpl->assign( 'download_total_num' , $total_num ) ; // 登録データを取得 $download4assign = $mydownload->get_downdata_for_singleview( $whr_cat4read, $lid, $cid, 1 ); $mod_url = XOOPS_URL.'/modules/'.$mydirname ; // 閲覧可能なカテゴリのリストを SELECTボックス用に取得 $category4assin = d3download_makecache_for_selbox( $mydirname, $whr_cat, 0, 1 ); $lang_directcatsel = _MD_D3DOWNLOADS_SEL_CATEGORY; $d3comment_dirname = $xoopsModuleConfig['comment_dirname'] ? $xoopsModuleConfig['comment_dirname'] : ""; $d3comment_forum_id = $xoopsModuleConfig['comment_forum_id'] ? $xoopsModuleConfig['comment_forum_id'] : ""; $comment_view = $xoopsModuleConfig['comment_view'] ? $xoopsModuleConfig['comment_view'] : ""; // スクリーンショット画像を使用するかどうか $canuseshots = ! empty( $xoopsModuleConfig['useshots'] ) ? 1 : 0 ; $xoops_module_header = d3download_dbmoduleheader( $mydirname ); $xoopsTpl->assign('xoops_module_header', $xoops_module_header . "\n" . $xoopsTpl->get_template_vars('xoops_module_header'));
function b_d3downloads_download_show( $options ) { include_once dirname( dirname(__FILE__) ).'/class/mydownload.php' ; include_once dirname( dirname(__FILE__) ).'/class/user_access.php' ; $mydirname = empty( $options[0] ) ? 'd3downloads' : $options[0] ; $download_id = intval( @$options[1] ) ; $this_template = empty( $options[2] ) ? 'db:'.$mydirname.'_block_download.html' : trim( $options[2] ) ; if( preg_match( '/[^0-9a-zA-Z_-]/' , $mydirname ) ) die( 'Invalid mydirname' ) ; $mod_url = XOOPS_URL.'/modules/'.$mydirname ; $module_handler =& xoops_gethandler('module'); $config_handler =& xoops_gethandler('config'); $module =& $module_handler->getByDirname( $mydirname ); $mod_config =& $config_handler->getConfigsByCat(0, $module->getVar('mid')); $user_access = new user_access( $mydirname ) ; $whr_cat4read = "d.cid IN (".implode(",", $user_access->can_read() ).")" ; $mydownload = new MyDownload( $mydirname ); $download4assign = $mydownload->get_downdata_for_singleview( $whr_cat4read, $download_id, 0, 0, 0, 1 ) ; $canuseshots = ! empty( $mod_config['useshots'] ) ? 1 : 0 ; $use_license = ! empty( $mod_config['use_license'] ) ? 1 : 0 ; $show_postname = ! empty( $mod_config['show_postname'] ) ? 1 : 0 ; if( ! empty( $download4assign ) ){ global $xoopsModule; $dirname = is_object( @$xoopsModule ) ? $xoopsModule->getVar('dirname') : '' ; if( is_object( $GLOBALS['xoopsTpl'] ) && $dirname != $mydirname ) { require_once dirname( dirname(__FILE__) ).'/include/common_functions.php' ; $my_module_header = d3download_dbmoduleheader( $mydirname ); $GLOBALS['xoopsTpl']->assign('xoops_module_header', $my_module_header . "\n" . $GLOBALS['xoopsTpl']->get_template_vars( "xoops_module_header" ) ); } $block['download'] = $download4assign ; $block['mydirname'] = $mydirname ; $block['mod_url'] = $mod_url ; $block['canuseshots'] = $canuseshots ; $block['use_license'] = $use_license ; $block['show_postname'] = $show_postname ; $block['lang_title'] = _MB_D3DOWNLOADS_LANG_TITLE; $block['lang_ctitle'] = _MB_D3DOWNLOADS_LANG_CTITLE; $block['lang_version'] = _MB_D3DOWNLOADS_LANG_VERSION; $block['lang_updated'] = _MB_D3DOWNLOADS_LANG_DATE; $block['lang_description'] = _MB_D3DOWNLOADS_LANG_DESCRIPTION; $block['lang_hits'] = _MB_D3DOWNLOADS_LANG_HITS; $block['lang_size'] = _MB_D3DOWNLOADS_LANG_SIZE; $block['lang_kb'] = _MB_D3DOWNLOADS_LANG_KB; $block['lang_platform'] = _MB_D3DOWNLOADS_LANG_PLATFORM; $block['lang_license'] = _MB_D3DOWNLOADS_LICENSE; $block['lang_homepage'] = _MB_D3DOWNLOADS_LANG_HOMEPAGE; $block['lang_broken'] = _MB_D3DOWNLOADS_BROKEN_FILE; 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 ; } } }