if ($permissions['ecdownloadpermissions'] & $vbulletin->bf_ugp['ecdownloadpermissions']['canmanagepurgatory'] or $permissions['ecdownloadpermissions'] & $vbulletin->bf_ugp['ecdownloadpermissions']['caneditallfiles']) { $dlinks .= ' | <a href="./downloads.php?do=manfiles">' . $vbphrase['ecdownloads_manage_files'] . '</a> | <a href="./downloads.php?do=manfiles&act=updatecounters">' . $vbphrase['ecdownloads_update_counters'] . '</a>'; } // get the main page statistics $dpanel_latest_bits = $dl->stats['latestall']; $dpanel_popular_bits = $dl->stats['popularall']; $dpanel_contrib_bits = $dl->stats['contriball']; if ($_GET['do'] == 'cat') { $cleancatid = $vbulletin->input->clean_gpc('r', 'id', TYPE_UINT); $catexclude = $dl->exclude_cat(); $cat = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "dl_cats WHERE " . $catexclude . " `id` = " . $cleancatid); if ($cat['id'] == 0) { eval(print_standard_redirect('ecdownloads_msg_invalid_cat', true, true)); } $dlcustomtitle = $cat['name']; $navbits += $dl->build_cat_nav($cleancatid); $result = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "dl_cats WHERE " . $catexclude . " `parent` = " . $cleancatid . " ORDER BY " . $dl->order); if ($db->num_rows($result) > 0) { while ($sub = $db->fetch_array($result)) { if ($dl->hidesubcatssub == 0) { $subcats = $dl->grab_subcats_by_name_client($sub['id']); } else { $subcats = ''; } $files = vb_number_format($sub['files']); exec_switch_bg(); eval('$dsubbits .= "' . fetch_template('downloads_cat_subbit') . '";'); } eval('$dsubcats .= "' . fetch_template('downloads_cat_subs') . '";'); } $filesexclude = $dl->exclude_files();
print_no_permission(); } $dlstats['latestall'] = $dl->stats['latestall']; $dlstats['popularall'] = $dl->stats['popularall']; $dlstats['contriball'] = $dl->stats['contriball']; ($hook = vBulletinHook::fetch_hook('dl2_start')) ? eval($hook) : false; if ($_GET['do'] == 'cat') { $cleancatid = $vbulletin->input->clean_gpc('r', 'id', TYPE_UINT); $catexclude = $dl->exclude_cat(); $cat = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "dl2_categories WHERE {$catexclude} `id` = {$cleancatid}"); if ($cat['id'] == 0) { eval(print_standard_redirect('dl2_msg_invalid_cat', true, true)); } $cat['name'] = htmlspecialchars_uni($cat['name']); $dlcustomtitle = $cat['name']; $navbits += $dl->build_cat_nav($cat['id']); $show['addnewfile'] = false; if ($permissions['downloads2permissions'] & $vbulletin->bf_ugp['downloads2permissions']['canuploadfiles'] or $permissions['downloads2permissions'] & $vbulletin->bf_ugp['downloads2permissions']['canlinktofiles']) { $show['addnewfile'] = true; } $show['dlsearch'] = $permissions['downloads2permissions'] & $vbulletin->bf_ugp['downloads2permissions']['cansearchfiles']; $result = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "dl2_categories WHERE {$catexclude} `parent` = {$cat['id']} ORDER BY `weight`"); if ($db->num_rows($result) > 0) { while ($sub = $db->fetch_array($result)) { $sub['name'] = htmlspecialchars_uni($sub['name']); $sub['description'] = htmlspecialchars_uni($sub['description']); $sub['files'] = vb_number_format($sub['files']); if ($vbulletin->options['dl2subcatsdepth'] > 0) { $subcats = $dl->grab_subcats_by_name($sub['id']); } else { $subcats = '';