$categorySelectHTML .= "{$title} *"; } else { $categorySelectHTML .= "{$title}"; } $categorySelectHTML .= "</option>\n"; $arr = $mytree->getChildTreeArray($cid); foreach ($arr as $option) { $option['prefix'] = str_replace(".", "--", $option['prefix']); $catpath = $option['prefix'] . " " . $myts->makeTboxData4Show($option[2]); $categorySelectHTML .= '<option value="' . $option[$mytree->id] . '">'; if (!SEC_inGroup($option[5])) { $categorySelectHTML .= "{$catpath} *"; } else { $categorySelectHTML .= "{$catpath}"; } $categorySelectHTML .= "</option>\n"; } } $T->set_var(array('lang_submitnotice' => _MD_SUBMITONCE, 'lang_allpending' => _MD_ALLPENDING, 'lang_dontabuse' => _MD_DONTABUSE, 'lang_takedays' => _MD_TAKEDAYS, 'lang_required' => _MD_REQUIRED, 'lang_filetitle' => _MD_FILETITLE, 'lang_filename' => _MD_DLFILENAME, 'lang_category' => _MD_CATEGORY, 'lang_approve' => _MD_APPROVEREQ, 'lang_homepage' => _MD_HOMEPAGEC, 'lang_version' => _MD_VERSIONC, 'lang_desc' => _MD_DESCRIPTIONC, 'lang_screenshot' => _MD_SHOTIMAGE, 'lang_commentoption' => _MD_COMMENTOPTION, 'lang_no' => _MD_NO, 'lang_yes' => _MD_YES, 'lang_submit' => _MD_SUBMIT, 'lang_cancel' => _MD_CANCEL, 'token_name' => CSRF_TOKEN, 'security_token' => SEC_createToken(), 'cat_select_options' => $categorySelectHTML, 'uid' => $uid)); $display .= FM_siteHeader(); $display .= COM_startBlock("<b>" . _MD_UPLOADTITLE . "</b>"); $T->parse('output', 'page'); $display .= $T->finish($T->get_var('output')); $display .= COM_endBlock(); $display .= FM_siteFooter(); echo $display; } } else { COM_errorLOG("Submit.php => FileMgmt Plugin Access denied. Attempted user upload of a file, Remote address is:{$_SERVER['REMOTE_ADDR']}"); redirect_header($_CONF['site_url'] . "/index.php", 1, _GL_ERRORNOUPLOAD); }
$myts = new MyTextSanitizer(); $mytree = new XoopsTree($_DB_name, $_TABLES['filemgmt_cat'], 'cid', 'pid'); $mytree->setGroupAccessFilter($_GROUPS); $page = isset($_GET['page']) ? COM_applyFilter($_GET['page'], true) : 0; $cid = isset($_GET['cid']) ? COM_applyFilter($_GET['cid'], true) : 0; $orderby = isset($_GET['orderby']) ? @html_entity_decode(COM_applyFilter($_GET['orderby'], false)) : ''; $groupsql = filemgmt_buildAccessSql(); $sql = "SELECT COUNT(*) FROM {$_TABLES['filemgmt_cat']} WHERE cid='" . intval($cid) . "' {$groupsql}"; list($category_rows) = DB_fetchArray(DB_query($sql)); if ($cid == 0 or $category_rows == 0) { echo COM_refresh($_CONF['site_url'] . '/filemgmt/index.php'); exit; } $FM_ratedIds = array(); $FM_ratedIds = RATING_getRatedIds('filemgmt'); $display = FM_siteHeader($LANG_FILEMGMT['usermenu1']); $p = new Template($_CONF['path'] . 'plugins/filemgmt/templates'); $p->set_file(array('page' => 'filelisting.thtml', 'records' => 'filelisting_record.thtml', 'category' => 'filelisting_subcategory.thtml', 'sortmenu' => 'sortmenu.thtml')); $p->set_var('tablewidth', $mydownloads_shotwidth + 10); $p->set_var('block_header', COM_startBlock(_MD_CATEGORYTITLE)); $p->set_var('block_footer', COM_endBlock()); $trimDescription = true; // Set to false if you do not want to auto trim the description and insert the <more..> link if (!isset($page) || $page == 0) { // If no page sent then assume the first. $page = 1; } $show = $mydownloads_perpage; $offset = ($page - 1) * $show; if (isset($orderby) && $orderby != "") { $orderby = convertorderbyin($orderby);