Ejemplo n.º 1
0
            }
            if (strlen($file['description']) > $dl->smalldesclen and $dl->smalldesclen > 0) {
                $smalldesc .= '&nbsp;... [<a href="downloads.php?do=file&amp;id=' . $file['id'] . '">' . $vbphrase['ecdownloads_more'] . '</a>]';
            }
            if ($dl->smalldesclen > 0) {
                $download = '<a href="./downloads.php?do=file&amp;id=' . $file['id'] . '&amp;act=down" ' . $target . '><img src="' . $stylevar[imgdir_button] . '/' . $vbphrase['ecdownloads_download_pic'] . '" width="15" height="15" align="middle" title="' . $vbphrase['ecdownloads_download'] . '&nbsp;' . $file['name'] . '" alt="' . $vbphrase['ecdownloads_downloads'] . '" border="0" /></a>&nbsp;';
            } else {
                $download = '<a href="./downloads.php?do=file&amp;id=' . $file['id'] . '" ' . $target . '><img src="' . $stylevar[imgdir_button] . '/' . $vbphrase['ecdownloads_download_pic'] . '" width="15" height="15" align="middle" title="' . $vbphrase['ecdownloads_download'] . '&nbsp;' . $file['name'] . '" alt="' . $vbphrase['ecdownloads_downloads'] . '" border="0" /></a>&nbsp;';
            }
            exec_switch_bg();
            eval('$dfilebits .= "' . fetch_template('downloads_cat_filebit') . '";');
        }
        eval('$dfiles .= "' . fetch_template('downloads_cat_files') . '";');
    }
    $db->free_result($result);
    $category_array = $dl->construct_select_array(0, array('#' => $vbphrase['ecdownloads_category_jump']), '');
    foreach ($category_array as $cat_key => $cat_value) {
        $category_jump .= '<option value="./downloads.php?do=cat&amp;id=' . $cat_key . '">' . $cat_value . '</option>';
    }
    eval('$dmain_jr = "' . fetch_template('downloads_cat') . '";');
    eval('$dpanel = "' . fetch_template('downloads_panel_side') . '";');
    eval('$dmain = "' . fetch_template('downloads_wrapper_side') . '";');
} else {
    if ($_GET['do'] == 'tree') {
        $navbits['downloads.php?do=tree'] = $vbphrase['ecdownloads_category_tree'];
        $dlcustomtitle = $vbphrase['ecdownloads_category_tree'];
        $category_array = $dl->construct_select_array(0, array(), '');
        foreach ($category_array as $cat_key => $cat_value) {
            $temp = $db->query_first("SELECT COUNT(*) as events \n\t\t\t\t\t\t\tFROM " . TABLE_PREFIX . "dl_files \n\t\t\t\t\t\t\tWHERE \tcategory =  " . $cat_key . "");
            $catidinfo = '';
            if ($permissions['ecdownloadpermissions'] & $vbulletin->bf_ugp['ecdownloadpermissions']['caneditallfiles']) {
Ejemplo n.º 2
0
 *		* Any of these conditions can be waived if you get permission from the copyright holder.
 */
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
@set_time_limit(0);
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array();
$specialtemplates = array();
$globaltemplates = array();
$actiontemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
require_once './includes/class_downloads.php';
require_once './includes/functions_newpost.php';
$dl = new vB_Downloads();
$categories = $dl->construct_select_array(0, array(0 => 'None'), false);
// ########################################################
// ################## Settings Functions ##################
// ########################################################
if ($_GET['do'] == 'settings') {
    $cat = $db->query_first("SELECT downloadsIIforumid FROM " . TABLE_PREFIX . "dl_main WHERE 1=1");
    print_cp_header('Manage Global Forum Setting');
    print_form_header('download2newthreadadmin', 'doeditset');
    print_table_header('Edit Global Forum');
    print_forum_chooser('Select the default forum to use when creating threads. If left to \'Select Forum\', a thread will only be created if the category has a forum set.</dfn>', 'dl_forumid_cat', $cat['downloadsIIforumid'], null, true, false, '[%s]');
    print_submit_row('Save Setting', 0);
    print_cp_footer();
}
// ########################################################
// ################### Do Edit Settings ###################
// ########################################################
Ejemplo n.º 3
0
$globaltemplates = array();
$actiontemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
require_once DIR . '/includes/class_downloads2.php';
require_once DIR . '/includes/functions_newpost.php';
// ############################# LOG ACTION ###############################
log_admin_action();
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
if (empty($_GET['do'])) {
    $_GET['do'] = 'category';
}
$dl = new vB_Downloads();
$categories = $dl->construct_select_array(0, array(0 => $vbphrase['none']), false);
function downloads_categories_admin($id = 0, $categories = array(), $spacer = '')
{
    global $db, $dl, $vbphrase;
    $catexclude = $dl->exclude_cat();
    $result = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "dl2_categories WHERE {$catexclude} `parent` = {$id} ORDER BY `weight`");
    while ($category = $db->fetch_array($result)) {
        $class = fetch_row_bgclass();
        echo '<tr>
			<td class="' . $class . '" width="100%">&nbsp;' . $spacer . htmlspecialchars_uni($category['name']) . '</td>
			<td class="' . $class . '" align="center"><input type="text" class="bginput" name="displayorder[' . $category['id'] . ']" value="' . $category['weight'] . '" tabindex="1" size="2" title="' . $vbphrase['display_order'] . '" /></td>
			<td class="' . $class . '"><a href="downloads2.php?' . $vbulletin->session->vars['sessionurl'] . 'do=editcat&amp;id=' . $category['id'] . '">' . $vbphrase['edit'] . '</a></td>
			<td class="' . $class . '"><a href="downloads2.php?' . $vbulletin->session->vars['sessionurl'] . 'do=delcat&amp;id=' . $category['id'] . '">' . $vbphrase['delete'] . '</a></td>
		</tr>';
        if ($category['subs'] > 0) {
            $categories += downloads_categories_admin($category['id'], $categories, $spacer . '- - ');