form = array("myform","dlform"); // form id of the form that will have it's values saved. $pst->page = array("download.php?create","download.php?cat"); // display preset options on which page(s). $pst->id = array("admin_downloads","admin_dl_cat"); // ------------------------------- $download = new download(); // $adminDownload = new adminDownload(); new plugin_download_admin(); require_once(e_ADMIN."auth.php"); /* $rs = new form; $subAction = ''; if (e_QUERY) { $tmp = explode(".", e_QUERY); $action = $tmp[0]; $subAction = varset($tmp[1],''); $id = varset($tmp[2],''); $from = varset($tmp[3], 0); $maintPage = varset($tmp[4], ''); unset($tmp); } // $adminDownload->observer(); require_once (e_HANDLER.'message_handler.php'); $emessage = &eMessage::getInstance(); $from = ($from ? $from : 0); $amount = varset($pref['download_view'], 50); if (isset($_POST)) { $e107cache->clear("download_cat"); }*/ /* if (isset($_POST['submit_download'])) { $adminDownload->submit_download($subAction, $id); $action = "main"; unset($subAction, $id); } */ if (isset($_POST['update_catorder'])) { foreach($_POST['catorder'] as $key=>$order) { if (is_numeric($_POST['catorder'][$key])) { $sql -> db_Update("download_category", "download_category_order='".intval($order)."' WHERE download_category_id='".intval($key)."'"); } } $admin_log->log_event('DOWNL_08',implode(',',array_keys($_POST['catorder'])),E_LOG_INFORMATIVE,''); $ns->tablerender("", "
".LAN_UPDATED."
"); } /* if (isset($_POST['updatedownlaodoptions'])) { unset($temp); $temp['download_php'] = $_POST['download_php']; $temp['download_view'] = $_POST['download_view']; $temp['download_sort'] = $_POST['download_sort']; $temp['download_order'] = $_POST['download_order']; $temp['mirror_order'] = $_POST['mirror_order']; $temp['recent_download_days'] = $_POST['recent_download_days']; $temp['agree_flag'] = $_POST['agree_flag']; $temp['download_email'] = $_POST['download_email']; $temp['agree_text'] = $tp->toDB($_POST['agree_text']); $temp['download_denied'] = $tp->toDB($_POST['download_denied']); $temp['download_reportbroken'] = $_POST['download_reportbroken']; if ($_POST['download_subsub']) $temp['download_subsub'] = '1'; else $temp['download_subsub'] = '0'; if ($_POST['download_incinfo']) $temp['download_incinfo'] = '1'; else $temp['download_incinfo'] = '0'; if ($admin_log->logArrayDiffs($temp, $pref, 'DOWNL_01')) { save_prefs(); // e107::getMessage()->add(DOWLAN_65); } else { // e107::getMessage()->add(DOWLAN_8); } } */ if (isset($_POST['updateuploadoptions'])) { unset($temp); $temp['upload_enabled'] = intval($_POST['upload_enabled']); $temp['upload_maxfilesize'] = $_POST['upload_maxfilesize']; $temp['upload_class'] = intval($_POST['upload_class']); if ($admin_log->logArrayDiffs($temp, $pref, 'DOWNL_02')) { save_prefs(); $message = DOWLAN_65; } else { $message = DOWLAN_8; } } $targetFields = array('gen_datestamp', 'gen_user_id', 'gen_ip', 'gen_intdata', 'gen_chardata'); // Fields for download limits if (isset($_POST['addlimit'])) { if ($sql->db_Select('generic','gen_id',"gen_type = 'download_limit' AND gen_datestamp = {$_POST['newlimit_class']}")) { $message = DOWLAN_116; } else { $vals = array(); $vals['gen_type'] = 'download_limit'; foreach(array('newlimit_class','new_bw_num','new_bw_days','new_count_num','new_count_days') as $k => $lName) { $vals[$targetFields[$k]] = intval($_POST[$lName]); } $valString = implode(',',$vals); if ($sql->db_Insert('generic',$vals)) { $message = DOWLAN_117; $admin_log->log_event('DOWNL_09',$valString,E_LOG_INFORMATIVE,''); } else { $message = DOWLAN_118; } unset($vals); } } if (isset($_POST['updatelimits'])) { if ($pref['download_limits'] != $_POST['download_limits']) { $pref['download_limits'] = ($_POST['download_limits'] == 'on') ? 1 : 0; save_prefs(); $message .= DOWLAN_126."
"; } foreach(array_keys($_POST['count_num']) as $idLim) { $idLim = intval($idLim); if (!$_POST['count_num'][$idLim] && !$_POST['count_days'][$idLim] && !$_POST['bw_num'][$idLim] && !$_POST['bw_days'][$idLim]) { //All entries empty - Remove record if ($sql->db_Delete('generic',"gen_id = {$idLim}")) { $message .= $idLim." - ".DOWLAN_119."
"; $admin_log->log_event('DOWNL_11','ID: '.$idLim,E_LOG_INFORMATIVE,''); } else { $message .= $idLim." - ".DOWLAN_120."
"; } } else { $vals = array(); foreach(array('bw_num','bw_days','count_num','count_days') as $k => $lName) { $vals[$targetFields[$k+1]] = intval($_POST[$lName][$idLim]); } $valString = implode(',',$vals); $sql->db_UpdateArray('generic',$vals," WHERE gen_id = {$idLim}"); $admin_log->log_event('DOWNL_10',$idLim.', '.$valString,E_LOG_INFORMATIVE,''); $message .= $idLim." - ".DOWLAN_121."
"; unset($vals); } } } //download/includes/admin.php is auto-loaded. e107::getAdminUI()->runPage(); require_once(e_ADMIN."footer.php"); exit; /* if ($action == "mirror") { //$adminDownload->show_existing_mirrors(); } if ($action == "dlm") { $action = "create"; $id = $subAction; $subAction = "dlm"; } if (isset($message)) { $ns->tablerender("", "
".$message."
"); } if ($from === "maint" && isset($_POST['submit_download'])) { // Return to one of the maintanence pages after submitting the create/edit form $action = $from; $subAction = $maintPage; } */ /* if (!e_QUERY || $action == "main") { //$text = $emessage->render(); //$text .= $adminDownload->show_filter_form($action, $subAction, $id, $from, $amount); //$text .= $adminDownload->show_existing_items($action, $subAction, $id, $from, $amount); //$ns->tablerender(DOWLAN_7, $text); } if ($action == "opt") { // $adminDownload->show_download_options(); } if ($action == "ulist") { $adminDownload->show_upload_list(); } if ($action == "filetypes") { $adminDownload->show_upload_filetypes(); } if ($action == "uopt") { $adminDownload->show_upload_options(); } */ function showLimits() { $sql = e107::getDb(); $ns = e107::getRender(); $tp = e107::getParser(); global $pref; if ($sql->db_Select('userclass_classes','userclass_id, userclass_name')) { $classList = $sql->db_getList(); } if ($sql->db_Select("generic", "gen_id as limit_id, gen_datestamp as limit_classnum, gen_user_id as limit_bw_num, gen_ip as limit_bw_days, gen_intdata as limit_count_num, gen_chardata as limit_count_days", "gen_type = 'download_limit'")) { while($row = $sql->db_Fetch()) { $limitList[$row['limit_classnum']] = $row; } } $txt = "
"; if(is_array($limitList)) { foreach($limitList as $row) { $txt .= " "; } } $txt .= "
"; if ($pref['download_limits'] == 1) { $chk = "checked = 'checked'"; } else { $chk = ""; } $txt .= " ".DOWLAN_125."
".DOWLAN_67." ".DOWLAN_113." ".DOWLAN_107." ".DOWLAN_108."
".$row['limit_id']." ".r_userclass_name($row['limit_classnum'])." ".DOWLAN_109." ".DOWLAN_110." ".DOWLAN_111." ".DOWLAN_109." ".DOWLAN_110."
"; $txt .= "


".r_userclass("newlimit_class", 0, "off", "guest, member, admin, classes, language")." ".DOWLAN_109." ".DOWLAN_110." ".DOWLAN_111." ".DOWLAN_109." ".DOWLAN_110."
"; echo $txt; // $ns->tablerender(DOWLAN_112, $txt); // require_once(e_ADMIN.'footer.php'); // exit; } function showMaint() // Deprecated. { $mes = e107::getMessage(); $mes->addInfo("Deprecated Area - please use filter instead under 'Manage' "); global $pref; $ns = e107::getRender(); $sql = e107::getDb(); $frm = e107::getForm(); $tp = e107::getParser(); if (isset($_POST['dl_maint'])) { switch ($_POST['dl_maint']) { case 'duplicates': { $title = DOWLAN_166; $query = 'SELECT GROUP_CONCAT(d.download_id SEPARATOR ",") as gc, d.download_id, d.download_name, d.download_url, dc.download_category_name FROM #download as d LEFT JOIN #download_category AS dc ON dc.download_category_id=d.download_category GROUP BY d.download_url HAVING COUNT(d.download_id) > 1 '; $text = ""; $count = $sql->db_Select_gen($query); $foundSome = false; if ($count) { $currentURL = ""; while($row = $sql->db_Fetch()) { if (!$foundSome) { // $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); $text .= '
'; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $foundSome = true; } $query = "SELECT d.*, dc.* FROM `#download` AS d LEFT JOIN `#download_category` AS dc ON dc.download_category_id=d.download_category WHERE download_id IN (".$row['gc'].") ORDER BY download_id ASC"; $count = $sql2->db_Select_gen($query); while($row = $sql2->db_Fetch()) { $text .= ''; if ($currentURL != $row['download_url']) { $text .= ''; $currentURL = $row['download_url']; } else { $text .= ''; } $text .= ''; $text .= "'; $text .= ''; $text .= ''; $text .= ''; } } } if ($foundSome) { $text .= '
'.DOWLAN_13.''.DOWLAN_67.''.DOWLAN_27.''.DOWLAN_11.''.LAN_OPTIONS.'
'.$tp->toHTML($row['download_url']).'*'.$row['download_id'].'".$e107->tp->toHTML($row['download_name']).''.$tp->toHTML($row['download_category_name']).' '.ADMIN_EDIT_ICON.' toJS(DOWLAN_33.' [ID: '.$row["download_id"].' ]').'") \'/>
'; } else { e107::getMessage()->addInfo(DOWLAN_172); } break; } case 'orphans': { $title = DOWLAN_167; $text = ""; require_once(e_HANDLER."file_class.php"); $efile = new e_file(); $files = $efile->get_files(e_DOWNLOAD); $foundSome = false; foreach($files as $file) { if (0 == $sql->db_Count('download', '(*)', " WHERE download_url='".$file['fname']."'")) { if (!$foundSome) { // $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); $text .= '
'; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $foundSome = true; } $filesize = (is_readable(e_DOWNLOAD.$row['download_url']) ? $e107->parseMemorySize(filesize(e_DOWNLOAD.$file['fname'])) : DOWLAN_181); $filets = (is_readable(e_DOWNLOAD.$row['download_url']) ? $gen->convert_date(filectime(e_DOWNLOAD.$file['fname']), "long") : DOWLAN_181); $text .= ''; $text .= ''; $text .= ''; $text .= ''; //TODO $text .= ''; $text .= ''; } } if ($foundSome) { $text .= '
'.DOWLAN_13.''.DOWLAN_182.''.DOWLAN_66.''.LAN_OPTIONS.'
'.$tp->toHTML($file['fname']).''.$filets.''.$filesize.' //TODO '.E_16_CREATE.' //TODO toJS(DOWLAN_173.' [ '.$file["fname"].' ]').'") \'/> //TODO
'; } else { e107::getMessage()->addInfo(DOWLAN_174); } break; } case 'missing': { $title = DOWLAN_168; $text = ""; $query = "SELECT d.*, dc.* FROM `#download` AS d LEFT JOIN `#download_category` AS dc ON dc.download_category_id=d.download_category"; $count = $sql->db_Select_gen($query); $foundSome = false; if ($count) { while($row = $sql->db_Fetch()) { if (!is_readable(e_DOWNLOAD.$row['download_url'])) { if (!$foundSome) { // $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); $text .= '
'; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $foundSome = true; } $text .= ''; $text .= ''; $text .= "'; $text .= ''; $text .= ''; $text .= ''; $text .= ''; } } } if ($foundSome) { $text .= '
'.DOWLAN_67.''.DOWLAN_27.''.DOWLAN_11.''.DOWLAN_13.''.LAN_OPTIONS.'
'.$row['download_id'].'".$tp->toHTML($row['download_name']).''.$tp->toHTML($row['download_category_name']).''.$tp->toHTML($row['download_url']).' '.ADMIN_EDIT_ICON.' toJS(DOWLAN_33.' [ID: '.$row["download_id"].' ]').'") \'/>
'; } else { e107::getMessage()->addInfo(DOWLAN_172); // $text = DOWLAN_172; } break; } case 'inactive': { $title = DOWLAN_169; $text = ""; $query = "SELECT d.*, dc.* FROM `#download` AS d LEFT JOIN `#download_category` AS dc ON dc.download_category_id=d.download_category WHERE download_active=0"; $count = $sql->db_Select_gen($query); $foundSome = false; if ($count) { while($row = $sql->db_Fetch()) { if (!$foundSome) { // $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); $text .= '
'; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $foundSome = true; } $text .= ''; $text .= ''; $text .= "'; $text .= ''; if (strlen($row['download_url']) > 0) { $text .= ''; } else { $mirrorArray = download::makeMirrorArray($row['download_mirror'], TRUE); $text .= ''; } $text .= ''; $text .= ''; } } if ($foundSome) { $text .= '
'.DOWLAN_67.''.DOWLAN_27.''.DOWLAN_11.''.DOWLAN_13.''.LAN_OPTIONS.'
'.$row['download_id'].'".$e107->tp->toHTML($row['download_name']).''.$e107->tp->toHTML($row['download_category_name']).''.$row['download_url'].''; foreach($mirrorArray as $mirror) { $text .= $mirror['url'].'
'; } $text .= '
'.ADMIN_EDIT_ICON.' toJS(DOWLAN_33.' [ID: '.$row["download_id"].' ]').'") \'/>
'; } else { e107::getMessage()->addInfo(DOWLAN_172); // $text = DOWLAN_172; } break; } case 'nocategory': { $title = DOWLAN_178; $text = ""; $query = "SELECT * FROM `#download` WHERE download_category=0"; $count = $sql->db_Select_gen($query); $foundSome = false; if ($count) { while($row = $sql->db_Fetch()) { if (!$foundSome) { // $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); $text .= '
'; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $foundSome = true; } $text .= ''; $text .= ''; $text .= "'; if (strlen($row['download_url']) > 0) { $text .= ''; } else { $mirrorArray = download::makeMirrorArray($row['download_mirror'], TRUE); $text .= ''; } $text .= ''; $text .= ''; } } if ($foundSome) { $text .= '
'.DOWLAN_67.''.DOWLAN_27.''.DOWLAN_13.''.LAN_OPTIONS.'
'.$row['download_id'].'".$e107->tp->toHTML($row['download_name']).''.$e107->tp->toHTML($row['download_url']).''; foreach($mirrorArray as $mirror) { $text .= $mirror['url'].'
'; } $text .= '
'.ADMIN_EDIT_ICON.' toJS(DOWLAN_33.' [ID: '.$row["download_id"].' ]').'") \'/>
'; } else { e107::getMessage()->addInfo(DOWLAN_172); // $text = DOWLAN_172; } break; } case 'filesize': { $title = DOWLAN_66; $text = ""; $query = "SELECT d.*, dc.* FROM `#download` AS d LEFT JOIN `#download_category` AS dc ON dc.download_category_id=d.download_category WHERE d.download_url<>''"; $count = $sql->db_Select_gen($query); $foundSome = false; if ($count) { while($row = $sql->db_Fetch()) { if (is_readable(e_DOWNLOAD.$row['download_url'])) { $filesize = filesize(e_DOWNLOAD.$row['download_url']); if ($filesize <> $row['download_filesize']) { if (!$foundSome) { // $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); $text .= '
'; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $foundSome = true; } $text .= ''; $text .= ''; $text .= "'; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; } } } } if ($foundSome) { $text .= '
'.DOWLAN_67.''.DOWLAN_27.''.DOWLAN_11.''.DOWLAN_13.''.DOWLAN_180.''.LAN_OPTIONS.'
'.$row['download_id'].'".$e107->tp->toHTML($row['download_name']).''.$e107->tp->toHTML($row['download_category_name']).''.$e107->tp->toHTML($row['download_url']).''.$row['download_filesize'].' / '; $text .= $filesize; $text .= ' '.ADMIN_EDIT_ICON.' toJS(DOWLAN_33.' [ID: '.$row["download_id"].' ]').'") \'/>
'; } else { e107::getMessage()->addInfo(DOWLAN_172); // $text = DOWLAN_172; } break; } case 'log': { $text = "log - view manage download history log"; header('location: '.e_ADMIN.'admin_log.php?downlog'); exit(); break; } } } else { $title = DOWLAN_193; $text = DOWLAN_179; $eform = new e_form(); $text = "
".DOWLAN_10."
".DOWLAN_166." ".$eform->radio('dl_maint', 'duplicates').$eform->label(DOWLAN_185, 'dl_maint', 'duplicates')."
".DOWLAN_167." ".$eform->radio('dl_maint', 'orphans').$eform->label(DOWLAN_186, 'dl_maint', 'orphans')."
".DOWLAN_168." ".$eform->radio('dl_maint', 'missing').$eform->label(DOWLAN_187, 'dl_maint', 'missing')."
".DOWLAN_169." ".$eform->radio('dl_maint', 'inactive').$eform->label(DOWLAN_188, 'dl_maint', 'inactive')."
".DOWLAN_178." ".$eform->radio('dl_maint', 'nocategory').$eform->label(DOWLAN_189, 'dl_maint', 'nocategory')."
".DOWLAN_66." ".$eform->radio('dl_maint', 'filesize').$eform->label(DOWLAN_190, 'dl_maint', 'filesize')."
".DOWLAN_171." ".$eform->radio('dl_maint', 'log').$eform->label(DOWLAN_191, 'dl_maint', 'log')."
".$eform->admin_button('trigger_db_execute', DOWLAN_192, 'execute')."
"; } echo $text; // $ns->tablerender(DOWLAN_165.$title, $text); } // UNUSED function show_upload_list() { global $ns, $sql, $gen, $e107, $tp; $frm = new e_form(true); //enable inner tabindex counter $imgd = e_BASE.$IMAGES_DIRECTORY; $columnInfo = array( "checkboxes" => array("title" => "", "forced"=> TRUE, "width" => "3%", "thclass" => "center first", "toggle" => "dl_selected"), "upload_id" => array("title"=>DOWLAN_67, "type"=>"", "width"=>"auto", "thclass"=>"", "forced"=>true), "upload_date" => array("title"=>DOWLAN_78, "type"=>"", "width"=>"auto", "thclass"=>""), "upload_uploader" => array("title"=>DOWLAN_79, "type"=>"", "width"=>"auto", "thclass"=>""), "upload_name" => array("title"=>DOWLAN_12, "type"=>"", "width"=>"auto", "thclass"=>""), "upload_file_name" => array("title"=>DOWLAN_59, "type"=>"", "width"=>"auto", "thclass"=>""), "upload_size" => array("title"=>DOWLAN_66, "type"=>"", "width"=>"auto", "thclass"=>"right"), "options" => array("title"=>LAN_OPTIONS,"width"=>"15%", "thclass"=>"center last", "forced"=>true) ); //TODO $filterColumns = ($user_pref['admin_download_disp'] ? $user_pref['admin_download_disp'] : array("download_name","download_class")); $filterColumns = array("upload_id","upload_date","upload_uploader","upload_name","upload_file_name","upload_size"); $text = "
" .$frm->colGroup($columnInfo,$filterColumns) .$frm->thead($columnInfo,$filterColumns,"main.[FIELD].[ASC].[FROM]")." "; } else { $activeUploads = $sql -> db_getList(); $text .= DOWLAN_80." ".($active_uploads == 1 ? DOWLAN_81 : DOWLAN_82)." ".$active_uploads." ".($active_uploads == 1 ? DOWLAN_83 : DOWLAN_84); $text .= ""; foreach($activeUploads as $row) { $post_author_id = substr($row['upload_poster'], 0, strpos($row['upload_poster'], ".")); $post_author_name = substr($row['upload_poster'], (strpos($row['upload_poster'], ".")+1)); $poster = (!$post_author_id ? "".$post_author_name."" : "".$post_author_name.""); $upload_datestamp = $gen->convert_date($row['upload_datestamp'], "short"); $text .= " "; } } $text .= "
"; if (!$active_uploads = $sql->db_Select("upload", "*", "upload_active=0 ORDER BY upload_id ASC")) { $text .= DOWLAN_19.".
".$frm->checkbox("dl_selected[".$row["upload_id"]."]", $row['upload_id'])." ".$row['upload_id']." ".$upload_datestamp." ".$poster." ".$row['upload_name']." ".$row['upload_file']." ".$e107->parseMemorySize($row['upload_filesize'])."
".DOWLAN_91." ".DOWLAN_162." toJS(" [ ".$row['upload_name']." ] ".DOWLAN_33)."') \"/>
"; $ns->tablerender(DOWLAN_22, $text); } function show_filter_form($action, $subAction, $id, $from, $amount) { global $e107, $mySQLdefaultdb, $pref, $user_pref; $frm = new e_form(); $filterColumns = ($user_pref['admin_download_disp'] ? $user_pref['admin_download_disp'] : array("download_name","download_class")); // $url = $e107->url->getUrl('forum', 'thread', array('func' => 'view', 'id' => 123)); $url = "admin_download.php"; // Search field $text .= "
"; // Advanced search fields $text .= "
"; return $text; } function show_upload_filetypes() { global $ns; //TODO is there an e107:: copy of this if (!is_object($e_userclass)) { $e_userclass = new user_class; } if(!getperms("0")) exit; //TODO still needed? $definition_source = DOWLAN_71; $source_file = ''; $edit_upload_list = varset($_POST['upload_do_edit'], false); if (isset($_POST['generate_filetypes_xml'])) { // Write back edited data to filetypes_.xml $file_text = "\n"; foreach ($_POST['file_class_select'] as $k => $c) { if (!isset($_POST['file_line_delete_'.$c]) && varsettrue($_POST['file_type_list'][$k])) { $file_text .= " \n"; } } $file_text .= ""; if ((($handle = fopen(e_UPLOAD_TEMP_DIR.e_SAVE_FILETYPES,'wt')) == FALSE) || (fwrite($handle,$file_text) == FALSE) || (fclose($handle) == FALSE)) { $text = DOWLAN_88.e_UPLOAD_TEMP_DIR.e_SAVE_FILETYPES; } else { $text = DOWLAN_86.e_UPLOAD_TEMP_DIR.e_SAVE_FILETYPES.'
'.DOWLAN_87.e_ADMIN.e_READ_FILETYPES.'
'; } $ns->tablerender(DOWLAN_49, $text); } $current_perms = array(); if (($edit_upload_list && is_readable(e_UPLOAD_TEMP_DIR.e_SAVE_FILETYPES)) || (!$edit_upload_list && is_readable(e_ADMIN.e_READ_FILETYPES))) { require_once(e_HANDLER.'xml_class.php'); $xml = new xmlClass; $xml->setOptArrayTags('class'); $source_file = $edit_upload_list ? e_UPLOAD_TEMP_DIR.e_SAVE_FILETYPES : e_ADMIN.e_READ_FILETYPES; $temp_vars = $xml->loadXMLfile($source_file, true, false); if ($temp_vars === FALSE) { echo "Error parsing XML file!"; } else { foreach ($temp_vars['class'] as $v1) { $v = $v1['@attributes']; $current_perms[$v['name']] = array('type' => $v['type'],'maxupload' => $v['maxupload']); } } } elseif (is_readable(e_ADMIN.'filetypes.php')) { $source_file = 'filetypes.php'; $current_perms[e_UC_MEMBER] = array('type' => implode(',',array_keys(get_allowed_filetypes('filetypes.php', ''))),'maxupload' => '2M'); if (is_readable(e_ADMIN.'admin_filetypes.php')) { $current_perms[e_UC_ADMIN] = array('type' => implode(',',array_keys(get_allowed_filetypes('admin_filetypes.php', ''))),'maxupload' => '2M'); $source_file .= ' + admin_filetypes.php'; } } else { // Set a default $current_perms[e_UC_MEMBER] = array('type' => 'zip,tar,gz,jpg,png','maxupload' => '2M'); } $frm = new e_form(true); //enable inner tabindex counter $columnInfo = array( "ftypes_userclass" => array("title"=>DOWLAN_73, "type"=>"", "width"=>"auto", "thclass"=>"", "forced"=>true), "ftypes_extension" => array("title"=>DOWLAN_74, "type"=>"", "width"=>"auto", "thclass"=>""), "ftypes_max_size" => array("title"=>DOWLAN_75, "type"=>"", "width"=>"auto", "thclass"=>""), "ftypes_confirm_del" => array("title"=>DOWLAN_76, "type"=>"", "width"=>"auto", "thclass"=>"last"), ); $filterColumns = array("ftypes_userclass", "ftypes_extension", "ftypes_max_size", "ftypes_confirm_del"); $text = "

". str_replace(array('--SOURCE--', '--DEST--'),array(e_UPLOAD_TEMP_DIR.e_SAVE_FILETYPES,e_ADMIN.e_READ_FILETYPES),DOWLAN_85) ."

". DOWLAN_72.$source_file."

" .$frm->colGroup($columnInfo) .$frm->thead($columnInfo,$filterColumns)." "; foreach ($current_perms as $uclass => $uinfo) { $text .= " "; } // Now put up a box to add a new setting $text .= "
".DOWLAN_90."
"; $ns->tablerender(DOWLAN_23, $text); } function show_upload_options() { global $pref, $ns; require_once(e_HANDLER."form_handler.php"); $frm = new e_form(true); //enable inner tabindex counter $text = "
".DOWLAN_26." " .$frm->radio_switch('upload_enabled', $pref['upload_enabled']) ."
" .$frm->label(DOWLAN_51, 'upload_enabled', '1') ."
" ."
".DOWLAN_35." " .$frm->text('upload_maxfilesize', $pref['upload_maxfilesize'], '4', array('size'=>'10')) ."
" .$frm->label(str_replace(array("%1", "%2"), array(ini_get('upload_max_filesize'), ini_get('post_max_size')), DOWLAN_58), 'upload_maxfilesize', '1') ."
" ."
".DOWLAN_61." " .r_userclass("upload_class", $pref['upload_class']) ."
" .$frm->label(DOWLAN_60, 'upload_class', '1') ."
" ."
"; $ns->tablerender(LAN_DL_OPTIONS, $text); } /** * * @private */ function _getConditionList($name, $value) { $text .= " "; return $text; } /** * * @private */ function _getStatusList($name, $value) { $download_status[99]= ' '; $download_status[0] = DOWLAN_122; $download_status[1] = DOWLAN_123; $download_status[2] = DOWLAN_124; $text = ""; foreach($download_status as $key=>$val){ $sel = ($value == $key && $value != null) ? " selected='selected'" : ""; $text .= "\n"; } return $text; } /* function admin_download_adminmenu($parms) { global $action,$subAction; if ($action == "") { $action = "main"; } $var['main']['text'] = DOWLAN_29; $var['main']['link'] = e_SELF; $var['create']['text'] = DOWLAN_30; $var['create']['link'] = e_SELF."?create"; $var['cat']['text'] = DOWLAN_31; $var['cat']['link'] = e_SELF."?cat"; $var['cat']['perm'] = "Q"; $var['opt']['text'] = LAN_OPTIONS; $var['opt']['link'] = e_SELF."?opt"; $var['maint']['text'] = DOWLAN_165; $var['maint']['link'] = e_SELF."?maint"; $var['limits']['text'] = DOWLAN_112; $var['limits']['link'] = e_SELF."?limits"; $var['mirror']['text'] = DOWLAN_128; $var['mirror']['link'] = e_SELF."?mirror"; e_admin_menu(DOWLAN_32, $action, $var); unset($var); $var['ulist']['text'] = DOWLAN_22; $var['ulist']['link'] = e_SELF."?ulist";; $var['filetypes']['text'] = DOWLAN_23; $var['filetypes']['link'] = e_SELF."?filetypes"; $var['uopt']['text'] = LAN_OPTIONS; $var['uopt']['link'] = e_SELF."?uopt"; e_admin_menu(DOWLAN_10, $action, $var); } */ ?>