Exemple #1
0
        $catid = $vbulletin->input->clean_gpc('r', 'id', TYPE_UINT);
    } else {
        $catid = '';
    }
    $dlinks .= ' | <a href="./downloads.php?do=add&amp;cat=' . $catid . '">' . $vbphrase['ecdownloads_add'] . '</a> | <a href="./downloads.php?do=my">' . $vbphrase['ecdownloads_my_files'] . '</a>';
}
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&amp;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']);