Exemplo n.º 1
0
    }
    exit;
}
if (!isAdmin()) {
    send_headers_page_changed();
    login_form("", 1);
    exit;
}
if (bx_get('boonex_news') !== false) {
    setParam("news_enable", (int) bx_get('boonex_news'));
}
$logged['admin'] = member_auth(1, true, true);
if (bx_get('cat') !== false) {
    PageCategoryCode(bx_get('cat'));
} else {
    PageMainCode();
}
PageCodeAdmin();
function PageMainCode()
{
    $oDashboard = new BxDolAdminDashboard();
    $sResult = $oDashboard->getCode();
    $iNameIndex = 1;
    $GLOBALS['_page'] = array('name_index' => $iNameIndex, 'css_name' => array('index.css'), 'header' => _t('_adm_page_cpt_dashboard'));
    $GLOBALS['_page_cont'][$iNameIndex]['page_main_code'] = $sResult;
    if (getParam('news_enable') == 'on') {
        $GLOBALS['_page_cont'][$iNameIndex]['page_main_code'] .= DesignBoxAdmin(_t('_adm_box_cpt_boonex_news'), '
            <div class="RSSAggrCont" rssid="boonex_news" rssnum="5" member="0">' . $GLOBALS['oFunctions']->loadingBoxInline() . '</div>');
    }
    if (getParam('feeds_enable') == 'on') {
        $GLOBALS['_page_cont'][$iNameIndex]['page_main_code'] .= DesignBoxAdmin(_t('_adm_box_cpt_featured_modules'), '
Exemplo n.º 2
0
require_once BX_DIRECTORY_PATH_INC . 'design.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'profiles.inc.php';
// --------------- page variables and login
check_logged();
$_page['header'] = $_page['header_text'] = _t("_EXPLANATION_H") . ": " . htmlspecialchars_adv(_t("_" . $_GET['explain']));
$_page['css_name'] = 'explanation.css';
$sCode = PageMainCode();
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
    header('Content-type:text/html;charset=utf-8');
    echo $GLOBALS['oFunctions']->popupBox('explanation_popup', $_page['header'], $sCode);
    exit;
}
// --------------- page components
$_page['name_index'] = 44;
$_ni = $_page['name_index'];
$_page_cont[$_ni]['page_main_code'] = DesignBoxContent($_page['header_text'], PageMainCode(), $oTemplConfig->PageExplanation_db_num);
// --------------- [END] page components
PageCode();
// --------------- page components functions
function membershipActionsList($membershipID)
{
    $sNoLimit = _t('_no limit');
    $sqlFields = '';
    $aFields = array('AllowedCount', 'AllowedPeriodLen', 'AllowedPeriodStart', 'AllowedPeriodEnd');
    foreach ($aFields as $sField) {
        $sqlFields .= ",IFNULL(`{$sField}`, '{$sNoLimit}') as `{$sField}`";
    }
    $sqlQuery = "\n        SELECT `IDAction`, `Name` {$sqlFields}\n        FROM `sys_acl_matrix`\n        INNER JOIN `sys_acl_actions` ON `sys_acl_matrix`.`IDAction` = `sys_acl_actions`.`ID`\n        WHERE `sys_acl_matrix`.`IDLevel` = ?";
    $aDraw['bx_repeat:actions'] = $GLOBALS['MySQL']->getAll($sqlQuery, [$membershipID]);
    translateMembershipActions($aDraw['bx_repeat:actions']);
    return $GLOBALS['oSysTemplate']->parseHtmlByName('memlevel_actions_list.html', $aDraw);
    if (!($logged['member'] = member_auth(0, false))) {
        if (!($logged['aff'] = member_auth(2, false))) {
            $logged['moderator'] = member_auth(3, false);
        }
    }
}
$_page['header'] = _t("_upload Music");
$_page['header_text'] = _t("_upload Music");
$_ni = $_page['name_index'];
$member['ID'] = (int) $_COOKIE['memberID'];
$member['Password'] = $_COOKIE['memberPassword'];
$member['ID'] = (int) $_COOKIE['memberID'];
$check_res = checkAction($member['ID'], ACTION_ID_UPLOAD_GALLERY_MUSIC);
if ($check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED && !$logged['admin'] && !$logged['moderator']) {
    $ret = "\r\n    \t<table width=100% height=100% cellpadding=0 cellspacing=0 class=text2>\r\n    \t\t<td align=center bgcolor={$boxbg2}>\r\n    \t\t\t" . $check_res[CHECK_ACTION_MESSAGE] . "<br />\r\n    \t\t</td>\r\n    \t</table>\n";
    $_page['name_index'] = 0;
    $_page_cont[0]['page_main_code'] = $ret;
    PageCode();
    exit;
}
$_page_cont[$_ni]['page_main_code'] = PageMainCode();
PageCode();
function PageMainCode()
{
    global $site;
    global $member;
    $sCode = '<div id="agreement" style="text-align: center;"><div style="font-weight: bold;">' . _t("_Media upload Agreement", _t("_Music")) . '</div><div><textarea rows="20" cols="80" readonly="true">' . _t("_License Agreement", $site['url']) . '</textarea></div><div><input type="submit" id="agree" value="' . _t("_I agree") . '" onclick="document.getElementById(\'uploadForm\').style.display = \'block\'; 
	document.getElementById(\'agreement\').style.display = \'none\';""></div></div>';
    $sCode .= '<div id="uploadForm" style="text-align: center; display: none;">' . getApplicationContent('music', 'editor', array('id' => $member['ID'], 'password' => $member['Password'])) . '</div>';
    return $sCode;
}
    $ret = "\r\n    \t<table width=100% height=100% cellpadding=0 cellspacing=0 class=text2>\r\n    \t\t<td align=center bgcolor={$boxbg2}>\r\n    \t\t\t" . $check_res[CHECK_ACTION_MESSAGE] . "<br />\r\n    \t\t</td>\r\n    \t</table>\n";
    $_page['name_index'] = 0;
    $_page_cont[0]['page_main_code'] = $ret;
    PageCode();
    exit;
}
$sStatus = '';
if (isset($_POST['upload']) && isset($_POST['medProfId'])) {
    $sStatus = '<div>' . _t("_File was uploaded") . '</div>';
    $iUser = (int) $_POST['medProfId'];
    $sFile = htmlspecialchars_adv($_POST['title']);
    $sDesc = isset($_POST['description']) && strlen($_POST['description']) ? process_db_input(htmlspecialchars_adv($_POST['description'])) : '';
    $sTags = isset($_POST['tags']) && strlen($_POST['tags']) ? process_db_input(htmlspecialchars_adv($_POST['tags'])) : '';
    $sStatus = uploadFile($sFile, $sDesc, $sTags, $iUser);
}
$_page_cont[$_ni]['page_main_code'] = $sStatus . PageMainCode();
PageCode();
function PageMainCode()
{
    global $site;
    global $member;
    $sCode = '<div id="agreement" style="text-align: center;"><div style="font-weight: bold;">' . _t("_Media upload Agreement", _t("_Photo")) . '</div><div><textarea rows="20" cols="80" readonly="true">' . _t("_License Agreement", $site['url']) . '</textarea></div><div><input type="submit" id="agree" value="' . _t("_I agree") . '" onclick="document.getElementById(\'uploadShareMain\').style.display = \'block\'; 
	document.getElementById(\'agreement\').style.display = \'none\';""></div></div>';
    $sCode .= '<div id="uploadShareMain" style="display: none;">';
    $sCode .= "<form enctype=\"multipart/form-data\" method=\"post\" action=\"{$_SERVER['PHP_SELF']}\">";
    $sCode .= '<div class="uploadLine"><div class="uploadText">' . _t("_Title") . ': </div><div><input type="text" name="title" class="uploadForm"/></div></div>';
    $sCode .= '<div class="uploadLine"><div class="uploadText">' . _t("_Description") . ': </div><div><textarea name="description" class="uploadForm"/></textarea></div></div>';
    $sCode .= '<div class="uploadLine"><div class="uploadText">' . _t("_Tags") . ': </div><div><input type="text" name="tags" class="uploadForm"/></div></div>';
    $sCode .= '<div class="uploadLine"><div class="uploadText">' . _t("_Select") . ': </div><div><input type="file" name="uploadFile" size="43"/></div></div>';
    $sCode .= '<input type="hidden" name="medProfId" value="' . $member['ID'] . '"/>';
    $sCode .= '<div class="uploadLine"><div style="text-align: center;"><input type="submit" name="upload" value="' . _t("_Upload File") . '"/></div></div>';
    if (isset($_POST['upload']) && isset($_POST['medProfId'])) {
        $sStatus = '<div>' . _t("_File was uploaded") . '</div>';
        $iUser = (int) $_POST['medProfId'];
        $sFile = htmlspecialchars_adv($_POST['title']);
        $sDesc = isset($_POST['description']) && strlen($_POST['description']) ? process_db_input(htmlspecialchars_adv($_POST['description'])) : '';
        $sTags = isset($_POST['tags']) && strlen($_POST['tags']) ? process_db_input(htmlspecialchars_adv($_POST['tags'])) : '';
        $sStatus = uploadFile($sFile, $sDesc, $sTags, $iUser);
    }
} else {
    $sCode = MsgBox(_t('_Photo gallery limit was reached'));
    $_page['name_index'] = 0;
    $_page_cont[0]['page_main_code'] = $sCode;
    PageCode();
    exit;
}
$_page_cont[$_ni]['page_main_code'] = $sStatus . PageMainCode($site['url'], $member['ID']);
PageCode();
function PageMainCode($sSiteUrl, $iUser = 0)
{
    if ($iUser == 0) {
        return '<script language="javascript">window.location.href =\'' . $sSiteUrl . 'member.php\';</script>';
    }
    ob_start();
    ?>
	<div id="agreement" style="text-align: center;">
	<div style="font-weight: bold;"><?php 
    echo _t("_Media upload Agreement", _t("_Photo"));
    ?>
</div>
	<div>
		<textarea rows="20" cols="80" readonly="true"><?php