Ejemplo n.º 1
0
	<option selected="selected" label="none" value="none">select a category</option>';
        foreach ($cats as $cat) {
            if ($cat['level'] == 1) {
                if ($selects != '') {
                    $selects .= '</optgroup>';
                }
                $selects .= '<optgroup label="' . $cat['crumb'] . '">';
            } else {
                $selects .= '<option value="' . $cat['cid'] . '"' . ($cat['cid'] == $in['cat'] ? ' selected="selected"' : '') . '>' . $cat['crumb'] . '</option>';
            }
        }
        $selects .= '</optgroup></select>';
    }
    require_once 'header.php';
    $images = DL_Image::output_list($mng_id, $in['screen']);
    $cpgtpl->assign_vars(array('DL_MENU' => '<span class="gen"><strong>My Downloads</strong></span><br /><a href="' . URL::index() . '">Main Page</a> | <a href="' . URL::index('&amp;file=manage') . '">Current Downloads</a> | <a href="' . URL::index('&amp;file=manage&amp;s=1') . '">Pending Downloads</a> | <a href="' . URL::index('&amp;file=manage&amp;s=2') . '">Broken D/L Reports</a>', 'DL_ERRORS' => !empty($errors), 'DL_WARNINGS' => !empty($warnings), 'DL_MIRRORS' => DL_Mirror::output_list($mng_id), 'DL_IMAGES' => $images, 'IS_NEW_DL' => false, 'CAN_ADMIN' => can_admin($module_name), 'B_SCREENSHOT' => $dl_config['screen_active'] || can_admin($module_name), 'B_ADD_IMAGE' => $dl_config['screen_active'] && $images < $dl_config['screen_max'], 'B_NOTES' => can_admin($module_name), 'B_REASON' => true, 'B_UPL_FILE' => $dl_config['upl_file'] || can_admin($module_name), 'B_UPL_IMAGE' => $dl_config['upl_image'] || can_admin($module_name), 'B_PENDING' => $row['active'] == 2 && can_admin($module_name), 'B_FETCH_PAD' => false, 'B_REM_MD5' => $dl_config['md5_remote'], 'L_YES' => _YES, 'L_NO' => _NO, 'L_DELETE' => _DELETE, 'L_UPDATE' => 'Update', 'L_CATEGORY' => _CATEGORY, 'L_SHORT_DESC' => 'Short Description', 'L_MAX_CHARS' => sprintf(_M_CHARS, 255), 'L_DESCRIPTION' => _DESCRIPTION, 'L_AUTHORNAME' => _AUTHORNAME, 'L_AUTHOREMAIL' => _AUTHOREMAIL, 'L_MD5' => 'MD5', 'L_PENDING' => 'Pending', 'S_BBCODE' => bbcode_table('in[desc_long]', 'add_download', true), 'DL_TITLE' => htmlprepare($in['title']), 'DL_ACCESS' => group_selectbox('in[access]', $in['access']), 'DL_CATSEL' => $selects, 'DL_DESC_SHORT' => htmlprepare($in['desc_short']), 'DL_DESC_LONG' => htmlprepare($in['desc_long']), 'DL_NOTES' => isset($in['notes']) ? htmlprepare($in['notes']) : '', 'DL_REASON' => htmlprepare($in['reason']), 'DL_NAME' => htmlprepare($in['name']), 'DL_EMAIL' => $in['email'], 'U_DL_FORM' => URL::index('&amp;file=manage&amp;edit=' . $mng_id)));
    foreach ($errors as $error) {
        $cpgtpl->assign_block_vars('dl_errors', array('S_ENTRY' => $error));
    }
    foreach ($warnings as $warning) {
        $cpgtpl->assign_block_vars('dl_warnings', array('S_ENTRY' => $warning));
    }
    $result = $db->sql_uquery("SELECT * FROM " . $dl_prefix . "_fields \n\t\tWHERE visible > 0" . (!can_admin($module_name) ? ' AND visible < 3' : '') . " \n\t\tORDER BY title");
    while ($field = $db->sql_fetchrow($result)) {
        $f_title = defined($field['title']) ? constant($field['title']) : $field['title'];
        $f_title = $field['visible'] == 2 ? '* ' . $f_title : $f_title;
        if ($field['type'] == 1 || $field['type'] == 3) {
            $f_value = isset($in[$field['field']]) ? intval($in[$field['field']]) : $field['size'];
            $f_value = $f_value > 0 ? array(' checked="checked"', '') : array('', ' checked="checked"');
            $cpgtpl->assign_block_vars('fields', array('TITLE' => $f_title, 'TYPE' => $field['type'], 'NAME' => $field['field'], 'S_YES' => $f_value[0], 'S_NO' => $f_value[1]));
        } else {
Ejemplo n.º 2
0
	<option selected="selected" label="none" value="none">select a category</option>';
    foreach ($cats as $cat) {
        if ($cat['level'] == 1) {
            if ($selects != '') {
                $selects .= '</optgroup>';
            }
            $selects .= '<optgroup label="' . $cat['crumb'] . '">';
        } else {
            $selects .= '<option value="' . $cat['cid'] . '"' . (isset($_GET['c']) && $cat['cid'] == intval($_GET['c']) || $cat['cid'] == $in['cat'] ? ' selected="selected"' : '') . '>' . $cat['crumb'] . '</option>';
        }
    }
    $selects .= '</optgroup></select>';
}
require_once 'header.php';
$images = DL_Image::output_list($mng_id, $in['screen']);
$cpgtpl->assign_vars(array('DL_MENU' => dl_menu(), 'DL_ERRORS' => !empty($errors), 'DL_WARNINGS' => !empty($warnings), 'DL_MIRRORS' => DL_Mirror::output_list($mng_id), 'DL_IMAGES' => $images, 'IS_NEW_DL' => !can_admin($module_name), 'CAN_ADMIN' => can_admin($module_name), 'B_SCREENSHOT' => $dl_config['screen_active'] || can_admin($module_name), 'B_ADD_IMAGE' => $dl_config['screen_active'] && $images < $dl_config['screen_max'], 'B_NOTES' => false, 'B_REASON' => false, 'B_UPL_FILE' => $dl_config['upl_file'] || can_admin($module_name), 'B_UPL_IMAGE' => $dl_config['upl_image'] || can_admin($module_name), 'B_PENDING' => false, 'B_FETCH_PAD' => $fetch_pad, 'B_REM_MD5' => $dl_config['md5_remote'], 'L_YES' => _YES, 'L_NO' => _NO, 'L_DELETE' => _DELETE, 'L_UPDATE' => 'Update', 'L_CATEGORY' => _CATEGORY, 'L_SHORT_DESC' => 'Short Description', 'L_MAX_CHARS' => sprintf(_M_CHARS, 255), 'L_DESCRIPTION' => _DESCRIPTION, 'L_AUTHORNAME' => _AUTHORNAME, 'L_AUTHOREMAIL' => _AUTHOREMAIL, 'L_MD5' => 'MD5', 'S_BBCODE' => bbcode_table('in[desc_long]', 'add_download', true), 'DL_TITLE' => htmlprepare($in['title']), 'DL_ACCESS' => group_selectbox('in[access]', $in['access']), 'DL_CATSEL' => $selects, 'DL_DESC_SHORT' => htmlprepare($in['desc_short']), 'DL_DESC_LONG' => htmlprepare($in['desc_long']), 'DL_NOTES' => '', 'DL_REASON' => '', 'DL_NAME' => htmlprepare($in['name']), 'DL_EMAIL' => $in['email'], 'U_DL_FORM' => URL::index('&amp;file=add')));
foreach ($errors as $error) {
    $cpgtpl->assign_block_vars('dl_errors', array('S_ENTRY' => $error));
}
foreach ($warnings as $warning) {
    $cpgtpl->assign_block_vars('dl_warnings', array('S_ENTRY' => $warning));
}
$result = $db->sql_uquery("SELECT * FROM " . $dl_prefix . "_fields \n\tWHERE visible > 0" . (!can_admin($module_name) ? ' AND visible < 3' : '') . " \n\tORDER BY title");
while ($field = $db->sql_fetchrow($result)) {
    $f_title = defined($field['title']) ? constant($field['title']) : $field['title'];
    $f_title = $field['visible'] == 2 ? '* ' . $f_title : $f_title;
    if ($field['type'] == 1 || $field['type'] == 3) {
        $f_value = isset($in[$field['field']]) ? intval($in[$field['field']]) : $field['size'];
        $f_value = $f_value > 0 ? array(' checked="checked"', '') : array('', ' checked="checked"');
        $cpgtpl->assign_block_vars('fields', array('TITLE' => $f_title, 'TYPE' => $field['type'], 'NAME' => $field['field'], 'S_YES' => $f_value[0], 'S_NO' => $f_value[1]));
    } else {
Ejemplo n.º 3
0
    $cpgtpl->display('body');
    exit;
} elseif (isset($_GET['pmir'])) {
    require_once 'modules/' . $module_name . '/functions/mirrors.inc';
    if (!$dl_config['pub_mirror'] && !can_admin($module_name)) {
        die('Feature disabled');
    }
    $mirror_id = intval($_GET['pmir']);
    list($m_did, $m_uid, $m_active, $d_id, $d_owner, $m_submitter) = $db->sql_ufetchrow("SELECT m.did, m.uid, m.active, d.lid, d.submitter, u.username FROM " . $dl_prefix . "_mirrors m\n\t\tLEFT JOIN " . $dl_prefix . "_downloads d ON (d.lid = m.did)\n\t\tLEFT JOIN " . $user_prefix . "_users u ON (u.user_id = m.uid)\n\t\tWHERE m.id='{$mirror_id}'", SQL_NUM);
    if ($d_owner != $userinfo['user_id'] && !can_admin($module_name)) {
        die('Access denied');
    }
    if (isset($_POST['approve'])) {
        $db->sql_query("UPDATE " . $dl_prefix . "_mirrors \n\t\t\tSET active=1 \n\t\t\tWHERE id='{$mirror_id}'");
    } elseif (isset($_POST['reject'])) {
        DL_Mirror::delete($mirror_id, $d_id);
    }
    $cpgtpl->assign_vars(array('S_CONTENT_DIRECTION' => _TEXT_DIR, 'S_CONTENT_BASE' => $BASEHREF, 'TITLE' => 'Activate pending mirror', 'DL_TITLE' => false, 'MD5_FORM' => false, 'PEND_FORM' => true, 'ACTIVE' => $m_active, 'U_FORM' => URL::index('&amp;pmir=' . $mirror_id), 'APPROVED' => isset($_POST['approve']), 'REJECTED' => isset($_POST['reject']), 'B_SUBMITTER' => $m_submitter, 'L_CLOSE' => _DLP_CLOSEWINDOW, 'L_APPROVE' => _DLP_APPROVE, 'L_REJECT' => _DLP_REJECT, 'L_MIRRORACTIVE' => _DLP_MIRRORACTIVE, 'L_MIRRORAPP' => _DLP_MIRRORAPP, 'L_MIRRORREJ' => _DLP_MIRRORREJ, 'L_SUBMITTEDBY' => _DLP_SUBMITTEDBY));
    $cpgtpl->set_filenames(array('body' => 'downloads/popups.html'));
    $cpgtpl->display('body');
    exit;
} elseif (isset($_GET['get'])) {
    $get_id = intval($_GET['get']);
    list($dl_title, $dl_pick, $dl_active, $dl_access, $dl_submitter) = $db->sql_ufetchrow("SELECT title, pick, active, access, submitter FROM " . $dl_prefix . "_downloads \n\t\tWHERE lid='{$get_id}'", SQL_NUM);
    if (!isset($dl_title)) {
        cpg_error(_DLP_UNKNOWNDL, 404);
    }
    can_download($dl_active, $dl_access, true);
    $pagetitle .= ' ' . _BC_DELIM . ' ' . _DLP_DLNOW;
    if (isset($_GET['mirror'])) {
        if (!isset($CPG_SESS['user']['uri']) || empty($CPG_SESS['user']['uri'])) {