コード例 #1
0
if ($iCurPage > $iTotalPages) {
    $iCurPage = $iTotalPages;
}
if ($iCurPage < 1) {
    $iCurPage = 1;
}
$sLimitFrom = ($iCurPage - 1) * $iPerPage;
$sqlOrder = " ORDER BY `medDate` DESC ";
$sqlLimit = "LIMIT {$sLimitFrom}, {$iPerPage}";
$sQuery = "\r\n\tSELECT\r\n\t\t`a`.`ID` as `medID`,\r\n\t\t`a`.`Owner` as `medProfId`,\r\n\t\t`a`.`Title` as `medTitle`,\r\n\t\t`a`.`Date` as `medDate`,\r\n\t\t`a`.`Listens` as `medListens`,\r\n\t\t`a`.`Approved`,\r\n\t\t`b`.`NickName`\r\n\tFROM `Ray" . $sType . "Files` as `a`\r\n\tLEFT JOIN `Profiles` as `b` ON\r\n\t\t`b`.`ID` = `a`.`Owner`\r\n\t{$sqlWhere}\r\n\t{$sqlOrder}\r\n\t{$sqlLimit}\r\n\t";
$rData = db_res($sQuery);
TopCodeAdmin();
ContentBlockHead("List of music files");
echo browseCode();
ContentBlockFoot();
BottomCode();
function browseCode()
{
    global $site;
    global $rData;
    global $iTotalPages;
    global $iCurPage;
    $sCode = '<div id = "browseMain">';
    $sCode .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">';
    if (mysql_num_rows($rData)) {
        while ($aData = mysql_fetch_array($rData)) {
            $sStyle = $aData['Approved'] == 'true' ? ' style="border: 2px solid #00CC00;"' : ' style="border: 2px solid #CC0000;"';
            $sProf = '<a href="' . $site['url'] . 'profile_edit.php?ID=' . $aData['medProfId'] . '">' . $aData['NickName'] . '</a>';
            $sCode .= '<div class="browseUnit"' . $sStyle . '>';
            $sCode .= '<div class="browseCheckbox"><input type="checkbox" name="Check[]" value="' . $aData['medID'] . '"></div>';
            $sCode .= '<div class="lastFilesPic"><img src="' . $site['url_admin'] . 'images/music.png"></div>';
コード例 #2
0
/**
 * Generating Main page code
 *
 * @return ALL presentation of data
 */
function Main()
{
    $oClassifieds = new BxDolClassifieds();
    $oClassifieds->sCurrBrowsedFile = 'manage_classifieds.php';
    $oClassifieds->bAdminMode = TRUE;
    print $oClassifieds->PrintCommandForms();
    if ($_REQUEST) {
        if (isset($_REQUEST['action'])) {
            if ((int) $_REQUEST['action'] == 3) {
                print $oClassifieds->PrintFilterForm();
                print $oClassifieds->PrintFilteredAllAdvertisements();
                ContentBlockFoot();
                BottomCode();
                return;
            } elseif ((int) $_REQUEST['action'] == 2) {
                $iClassifiedSubID = (int) $_REQUEST['FilterSubCat'];
                print $oClassifieds->PrintSubRecords($iClassifiedSubID, TRUE);
                ContentBlockFoot();
                BottomCode();
                return;
            } elseif ((int) $_REQUEST['action'] == 1) {
                $iClassifiedID = (int) $_REQUEST['FilterCat'];
                print $oClassifieds->PrintAllSubRecords($iClassifiedID);
                ContentBlockFoot();
                BottomCode();
                return;
            }
        } elseif (isset($_GET['bClassifiedID'])) {
            $iClassifiedID = (int) $_GET['bClassifiedID'];
            if ($iClassifiedID > 0) {
                print $oClassifieds->PrintAllSubRecords($iClassifiedID);
                print $oClassifieds->PrintBackLink();
                ContentBlockFoot();
                BottomCode();
                return;
            }
        } elseif (isset($_GET['bSubClassifiedID'])) {
            $iSubClassifiedID = (int) $_GET['bSubClassifiedID'];
            if ($iSubClassifiedID > 0) {
                print $oClassifieds->PrintSubRecords($iSubClassifiedID, TRUE);
                print $oClassifieds->PrintBackLink();
                ContentBlockFoot();
                BottomCode();
                return;
            }
        } elseif (isset($_REQUEST['iAction'])) {
            $sAddMainCatSuccC = MsgBox(_t('_AddMainCategory successfully added'));
            $sAddMainCatFailC = MsgBox(_t('_Failed to Insert AddMainCategory'));
            $sAddSubCatSuccC = MsgBox(_t('_AddSubCategory successfully added'));
            $sAddSubCatFailC = MsgBox(_t('_Failed to Insert AddSubCategory'));
            $sDelMainCatSuccC = MsgBox(_t('_DeleteMainCategory was successfully'));
            $sDelMainCatFailC = MsgBox(_t('_Failed to DeleteMainCategory'));
            $sDelSubCatSuccC = MsgBox(_t('_DeleteSubCategory was successfully'));
            $sDelSubCatFailC = MsgBox(_t('_Failed to DeleteSubCategory'));
            switch ($_REQUEST['iAction']) {
                case 'AddMainCategory':
                    $sName = process_db_input($_REQUEST['name1']);
                    $sDescription = process_db_input($_REQUEST['description1']);
                    $sCustomName1 = process_db_input($_REQUEST['CustomName1']);
                    $sCustomName2 = process_db_input($_REQUEST['CustomName2']);
                    $sCustomAction1 = process_db_input($_REQUEST['CustomAction1']);
                    $sCustomAction2 = process_db_input($_REQUEST['CustomAction2']);
                    if ($sName == '') {
                        print $sAddMainCatFailC;
                        break;
                    }
                    $sqlRes = InsertC($sName, $sDescription, $sCustomName1, $sCustomName2, $sCustomAction1, $sCustomAction2);
                    print mysql_affected_rows() != 0 ? $sAddMainCatSuccC : $sAddMainCatFailC;
                    break;
                case 'AddSubCategory':
                    if ($_REQUEST['FilterCat'] and isset($_REQUEST['name2'])) {
                        $sName = process_db_input($_REQUEST['name2']);
                        $sDescription = process_db_input($_REQUEST['description2']);
                        $sCategoryID = process_db_input($_REQUEST['FilterCat']);
                        if ((int) $sCategoryID < 1) {
                            print $sAddSubCatFailC;
                            break;
                        }
                        $sqlRes = InsertCS($sCategoryID, $sName, $sDescription);
                        print mysql_affected_rows() != 0 ? $sAddSubCatSuccC : $sAddSubCatFailC;
                    }
                    break;
                case 'DeleteMainCategory':
                    if ($_REQUEST['FilterCat']) {
                        $sCategoryID = process_db_input($_REQUEST['FilterCat']);
                        $query = "DELETE FROM `Classifieds` WHERE `ID` = '{$sCategoryID}'";
                        $sqlRes = db_res($query);
                        print mysql_affected_rows() != 0 ? $sDelMainCatSuccC : $sDelMainCatFailC;
                    }
                    break;
                case 'DeleteSubCategory':
                    if ($_REQUEST['SubClassified']) {
                        $sCategoryID = process_db_input($_REQUEST['SubClassified']);
                        $query = "DELETE FROM `ClassifiedsSubs` WHERE `ClassifiedsSubs`.`ID` = {$sCategoryID}";
                        $sqlRes = db_res($query);
                        print mysql_affected_rows() != 0 ? $sDelSubCatSuccC : $sDelSubCatFailC;
                    }
                    break;
            }
        } elseif (isset($_REQUEST['DeleteAdvertisementID'])) {
            $id = (int) $_REQUEST['DeleteAdvertisementID'];
            if ($id > 0) {
                print ActionDeleteAdvertisement($id);
            }
        } elseif (isset($_REQUEST['ActivateAdvertisementID'])) {
            $id = (int) $_REQUEST['ActivateAdvertisementID'];
            if ($id > 0) {
                print ActionActivateAdvertisement($id);
            }
        } elseif (isset($_REQUEST['ActivateAdvWholesale'])) {
            print UpdateAllNewAdvIntoActive();
        } elseif (isset($_REQUEST['DeleteSelected'])) {
            print DeleteSelectedAdv();
        } elseif (isset($_REQUEST['ApproveSelected'])) {
            print ApproveSelectedAdv();
        }
        if (isset($_REQUEST['UpdatedAdvertisementID'])) {
            $id = (int) $_REQUEST['UpdatedAdvertisementID'];
            if ($id > 0) {
                if (isset($_REQUEST['DeletedPictureID']) && (int) $_REQUEST['DeletedPictureID'] > 0) {
                    //delete a pic
                    print $oClassifieds->ActionDeletePicture();
                    print $oClassifieds->PrintEditForm($id);
                } else {
                    print $oClassifieds->ActionUpdateAdvertisementID($id);
                }
            }
            return;
        } elseif (isset($_REQUEST['EditAdvertisementID'])) {
            if ((int) $_REQUEST['EditAdvertisementID'] > 0) {
                print $oClassifieds->PrintEditForm((int) $_REQUEST['EditAdvertisementID']);
                print $oClassifieds->PrintBackLink();
                ContentBlockFoot();
                BottomCode();
                return;
            }
        } elseif (isset($_REQUEST['ShowAdvertisementID'])) {
            if ($_REQUEST['ShowAdvertisementID'] > 0) {
                print $oClassifieds->ActionPrintAdvertisement($_REQUEST['ShowAdvertisementID']);
                print $oClassifieds->PrintBackLink();
                ContentBlockFoot();
                BottomCode();
                return;
            }
        } elseif (isset($_REQUEST['BuyNow'])) {
            $advId = (int) $_REQUEST['IDAdv'];
            if ($advId > 0) {
                print $oClassifieds->ActionBuyAdvertisement($advId);
                ContentBlockFoot();
                BottomCode();
                return;
            }
        } elseif (isset($_REQUEST['BuySendNow'])) {
            $advId = (int) $_REQUEST['IDAdv'];
            if ($advId > 0) {
                print $oClassifieds->ActionBuySendMailAdvertisement($advId);
                ContentBlockFoot();
                BottomCode();
                return;
            }
        } elseif (isset($_REQUEST['UsersOtherListing'])) {
            $iProfileID = (int) $_REQUEST['IDProfile'];
            if ($iProfileID > -1) {
                print $oClassifieds->PrintMyAds($iProfileID);
                ContentBlockFoot();
                BottomCode();
                return;
            }
        }
        /*elseif (isset($_REQUEST['EditCommentID'])) {
        			$iCommId = (int)$_REQUEST['EditCommentID'];
        			if ($iCommId > 0) {
        				print $oClassifieds->ActionEditComment();
        				print $oClassifieds->ActionPrintAdvertisement($_REQUEST['EAdvID']);
        				return;
        			}
        		}
        		elseif (isset($_REQUEST['DeleteCommentID'])) {
        			$iCommId = (int)$_REQUEST['DeleteCommentID'];
        			if ($iCommId > 0) {
        				print $oClassifieds->ActionDeleteComment();
        				print $oClassifieds->ActionPrintAdvertisement($_REQUEST['DAdvID']);
        				return;
        			}
        		}*/
    }
    print $oClassifieds->PrintManageClassifiedsForm();
    $sCap1C = _t("_TREE_C_BRW");
    $sCap2C = _t("_MODERATING");
    print "<h2>{$sCap1C}</h2>";
    print $oClassifieds->PrintTreeClassifiedsBrowse();
    $sAct = _t("_Activate");
    $sWhol = _t("_wholesale");
    $sActivateAdvWholesale = "<a href=\"{$_SERVER['PHP_SELF']}?ActivateAdvWholesale=1\">{$sAct} {$sWhol}</a>";
    print "<h2>{$sCap2C} ({$sActivateAdvWholesale})</h2>";
    print $oClassifieds->PrintModeratingTable();
    print '<div style="clear: both;"></div>';
    return;
}
コード例 #3
0
    function showMainPage()
    {
        global $_page;
        global $site;
        $_page['header'] = 'Page Builder';
        $_page['css_name'] = 'pageBuilder.css';
        $_page['extraCodeInHead'] = <<<BLAH
\t\t\t\t
\t\t\t\t<script type="text/javascript" src="{$site['plugins']}jquery/jquery.js"></script>
\t\t\t\t<script type="text/javascript" src="{$site['plugins']}jquery/jquery.dimensions.js"></script>
\t\t\t\t<script type="text/javascript" src="{$site['plugins']}jquery/jquery.form.js"></script>
\t\t\t\t<script type="text/javascript" src="{$site['plugins']}jquery/ui.mouse.js"></script>
\t\t\t\t<script type="text/javascript" src="{$site['plugins']}jquery/ui.draggable.js"></script>
\t\t\t\t<script type="text/javascript" src="{$site['plugins']}jquery/ui.draggable.ext.js"></script>
\t\t\t\t<script type="text/javascript" src="{$site['plugins']}jquery/ui.droppable.js"></script>
\t\t\t\t<script type="text/javascript" src="{$site['plugins']}jquery/ui.sortable.js"></script>
\t\t\t\t<script type="text/javascript" src="{$site['plugins']}jquery/ui.sortable.ext.js"></script>
\t\t\t\t<script type="text/javascript" src="{$site['plugins']}jquery/ui.slider.js"></script>
\t\t\t\t
\t\t\t\t<script type="text/javascript" language="javascript" src="{$site['url']}inc/js/classes/BxDolPageBuilder.js"></script>
\t\t\t\t
\t\t\t\t<!-- tinyMCE gz -->
\t\t\t\t<script type="text/javascript" src="{$site['plugins']}tiny_mce/tiny_mce_gzip.js"></script>
\t\t\t\t<script type="text/javascript">
\t\t\t\t\ttinyMCE_GZ.init({
\t\t\t\t\t\tplugins : "style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras",
\t\t\t\t\t\tthemes : "simple,advanced",
\t\t\t\t\t\tlanguages : "en",
\t\t\t\t\t\tdisk_cache : true,
\t\t\t\t\t\tdebug : false
\t\t\t\t\t});
\t\t\t\t</script>
\t\t\t
\t\t\t\t<script language="javascript" type="text/javascript">
\t\t\t\t\ttinyMCE.init({
\t\t\t\t\t\tmode : "textareas",
\t\t\t\t\t\ttheme : "advanced",
\t\t\t\t\t\t
\t\t\t\t\t\teditor_selector : "form_input_html",
\t\t\t\t\t\tcontent_css : "{$site['plugins']}tiny_mce/dolphin.css",
\t\t\t\t\t\t
\t\t\t\t\t\tplugins : "style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,visualchars,nonbreaking,xhtmlxtras",
\t\t\t\t\t\trelative_urls : false,
\t\t\t\t\t\t
\t\t\t\t\t\ttheme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect",
\t\t\t\t\t\ttheme_advanced_buttons2 : "forecolor,backcolor,|,bullist,numlist,|,outdent,indent,|,link,unlink,image,hr,|,sub,sup,|,insertdate,inserttime,|,styleprops",
\t\t\t\t\t\ttheme_advanced_buttons3 : "charmap,emotions,|,cite,abbr,acronym,attribs,|,preview,removeformat,|,code,help",
\t\t\t\t\t\ttheme_advanced_buttons4 : "table,row_props,cell_props,delete_col,delete_row,delete_table,col_after,col_before,row_after,row_before,row_after,row_before,split_cells,merge_cells",
\t\t\t\t\t\ttheme_advanced_toolbar_location : "top",
\t\t\t\t\t\ttheme_advanced_toolbar_align : "center",
\t\t\t\t\t\tvalid_elements : "*[*]"
\t\t\t\t\t});
\t\t\t\t</script>
BLAH;
        $_page['extraCodeInBody'] = <<<BLAH
\t\t\t\t<div id="editFormWrapper"
\t\t\t\t  style="display:none;" onclick="if ( ( event.target || event.srcElement ) == this ) \$(this).hide();">
\t\t\t\t\t<div id="editFormCont">
\t\t\t\t\t\t
\t\t\t\t\t</div>
\t\t\t\t</div>
BLAH;
        TopCodeAdmin();
        $this->showBuildZone();
        BottomCode();
    }
コード例 #4
0
function login_form($text = "", $member = 0, $bbAjaxMode = false)
{
    global $site;
    global $_page_cont;
    global $_page;
    global $admin_dir;
    global $logged;
    global $dir_dir;
    global $dir;
    global $tmpl;
    global $l, $d;
    switch ($member) {
        case 0:
            $mem = _t("_Member");
            $table = "Profiles";
            $login_page = "{$site['url']}member.php";
            $join_page = "{$site['url']}join.php";
            $forgot_page = "{$site['url']}forgot.php";
            $template = "{$dir['root']}templates/tmpl_{$tmpl}/login_form.html";
            break;
        case 1:
            $mem = 'Admin';
            $table = 'Admins';
            $login_page = "{$site['url_admin']}index.php";
            $join_page = '';
            $forgot_page = '';
            $template = "{$dir['root']}{$admin_dir}/login_form.html";
            break;
        case 2:
            $mem = "Affiliate";
            $table = 'aff';
            $login_page = "{$site['url_aff']}index.php";
            $join_page = '';
            $forgot_page = '';
            $template = "{$dir['root']}{$admin_dir}/login_form.html";
            break;
        case 3:
            $mem = "Moderator";
            $table = 'moderators';
            $login_page = "{$site['url']}moderators/index.php";
            $join_page = '';
            $forgot_page = '';
            $template = "{$dir['root']}{$admin_dir}/login_form.html";
            break;
    }
    $_page['header'] = "{$site['title']} " . _t("_Member Login");
    $_page['header_text'] = _t("_Member Login");
    // If path is divided with \\ (Windows) then use \\ instead of /
    $script_filename = strlen($_SERVER['PATH_TRANSLATED']) ? $_SERVER['PATH_TRANSLATED'] : $_SERVER['SCRIPT_NAME'];
    if (strstr($script_filename, '/')) {
        $arr1 = split("/", $script_filename);
        $s1 = $arr1[count($arr1) - 2];
    } elseif (strstr($script_filename, '\\\\')) {
        $arr1 = split("\\\\", $script_filename);
        $s1 = $arr1[count($arr1) - 3];
    }
    if ($bbAjaxMode && $member == 0) {
        $template = "{$dir['root']}templates/tmpl_{$tmpl}/login_form_ajax.html";
    } elseif ($bbAjaxMode && $member == 1) {
        $template = "{$dir['root']}templates/base/login_form_ajax_a.html";
    }
    $_page_cont[0]['page_main_code'] = PageCompLoginForm($text, $member, $mem, $table, $login_page, $join_page, $forgot_page, $template);
    if ($bbAjaxMode == true && $member == 1) {
        print TopCodeAdmin();
        print '<link href="' . $site['url_admin'] . 'styles/login_form_ajax.css" rel="stylesheet" type="text/css" />';
        print '<div style="border:0px solid #666;width:350px;margin:250px auto 0px;">';
        print $_page_cont[0]['page_main_code'];
        print '</div>';
        print BottomCode();
        exit;
    }
    if ($bbAjaxMode) {
        // if ($member == 1) {
        // print TopCodeAdmin();
        // print '<link href="'.$site['url_admin'].'styles/login_form_ajax.css" rel="stylesheet" type="text/css" />';
        // }
        print '<div style="border:0px solid #666;width:350px;margin:250px auto 0px;">';
        print $_page_cont[0]['page_main_code'];
        print '</div>';
        // if ($member == 1) {
        // print BottomCode();
        // }
        exit;
    }
    if ($s1 != $admin_dir && $s1 != "aff" && $s1 != $dir_dir && $s1 != "events" && $s1 != "moderators") {
        $_page['name_index'] = 0;
        PageCode();
        exit;
    } else {
        require_once BX_DIRECTORY_PATH_INC . 'admin_design.inc.php';
        $_page['header'] = "{$site['title']} {$mem} Login";
        TopCodeAdmin();
        echo $_page_cont[0]['page_main_code'];
        if (strlen($text)) {
            ?>
			<script type="text/javascript">
				addEvent( window, 'load', function(){ alert( '<?php 
            echo $text;
            ?>
' ); } );
			</script>
			<?php 
        }
        BottomCode();
    }
}
コード例 #5
0
function login_form($text = "", $member = 0, $bbAjaxMode = false)
{
    global $site;
    global $_page_cont;
    global $_page;
    global $admin_dir;
    global $logged;
    global $dir_dir;
    global $dir;
    global $tmpl;
    global $l, $d;
    switch ($member) {
        case 0:
            $mem = _t("_Member");
            $table = "Profiles";
            $login_page = "{$site['url']}member.php";
            $join_page = "{$site['url']}join.php";
            $forgot_page = "{$site['url']}forgot.php";
            $template = "{$dir['root']}templates/tmpl_{$tmpl}/login_form.html";
            break;
        case 1:
            $mem = 'Admin';
            $table = 'Admins';
            $login_page = "{$site['url_admin']}index.php";
            $join_page = '';
            $forgot_page = '';
            $template = "{$dir['root']}{$admin_dir}/login_form.html";
            break;
        case 2:
            $mem = "Affiliate";
            $table = 'aff';
            $login_page = "{$site['url_aff']}index.php";
            $join_page = '';
            $forgot_page = '';
            $template = "{$dir['root']}{$admin_dir}/login_form.html";
            break;
        case 3:
            $mem = "Moderator";
            $table = 'moderators';
            $login_page = "{$site['url']}moderators/index.php";
            $join_page = '';
            $forgot_page = '';
            $template = "{$dir['root']}{$admin_dir}/login_form.html";
            break;
    }
    $_page['header'] = "{$site['title']} " . _t("_Member Login");
    $_page['header_text'] = _t("_Member Login");
    if ($bbAjaxMode && $member == 0) {
        $template = "{$dir['root']}templates/tmpl_{$tmpl}/login_form_ajax.html";
    } elseif ($bbAjaxMode && $member == 1) {
        $template = "{$dir['root']}templates/base/login_form_ajax_a.html";
    }
    $_page_cont[0]['page_main_code'] = PageCompLoginForm($text, $member, $mem, $table, $login_page, $join_page, $forgot_page, $template);
    if ($bbAjaxMode) {
        if ($member == 1) {
            TopCodeAdmin();
            echo '<link href="' . $site['url_admin'] . 'styles/login_form_ajax.css" rel="stylesheet" type="text/css" />';
            echo '<div class="login_ajax_wrap">';
            echo $_page_cont[0]['page_main_code'];
            echo '</div>';
            BottomCode();
        } else {
            echo '<div class="login_ajax_wrap">';
            echo $_page_cont[0]['page_main_code'];
            echo '</div>';
        }
        exit;
    }
    // get name of dir of currently requested php file. Ex.: admin/aff/moderators etc.
    // $_SERVER['PHP_SELF'] contains [/some/path/to/file.php]
    $sPath = dirname($_SERVER['PHP_SELF']);
    //we got [/some/path/to]
    $sCDir = basename($sPath);
    // get [to].
    if ($sCDir == $admin_dir or $sCDir == 'aff' or $sCDir == 'moderators') {
        require_once BX_DIRECTORY_PATH_INC . 'admin_design.inc.php';
        $_page['header'] = "{$site['title']} {$mem} Login";
        TopCodeAdmin();
        echo $_page_cont[0]['page_main_code'];
        if (strlen($text)) {
            ?>
			<script type="text/javascript">
				addEvent( window, 'load', function(){ alert( '<?php 
            echo $text;
            ?>
' ); } );
			</script>
			<?php 
        }
        BottomCode();
    } else {
        $_page['name_index'] = 0;
        PageCode();
        exit;
    }
}
コード例 #6
0
function login_form($text = "", $member = 0)
{
    global $site;
    global $_page_cont;
    global $_page;
    global $admin_dir;
    global $logged;
    global $dir_dir;
    global $dir;
    global $tmpl;
    global $l, $d;
    switch ($member) {
        case 0:
            $mem = _t("_Member");
            $table = "Profiles";
            $login_page = "{$site['url']}member.php";
            $join_page = "{$site['url']}join_form.php";
            $forgot_page = "{$site['url']}forgot.php";
            $template = "{$dir['root']}templates/tmpl_{$tmpl}/login_form.html";
            break;
        case 1:
            $mem = 'Admin';
            $table = 'Admins';
            $login_page = "{$site['url_admin']}index.php";
            $join_page = '';
            $forgot_page = '';
            $template = "{$dir['root']}admin/login_form.html";
            break;
        case 2:
            $mem = "Affiliate";
            $table = 'aff';
            $login_page = "{$site['url_aff']}index.php";
            $join_page = '';
            $forgot_page = '';
            $template = "{$dir['root']}admin/login_form.html";
            break;
        case 3:
            $mem = "Moderator";
            $table = 'moderators';
            $login_page = "{$site['url']}moderators/index.php";
            $join_page = '';
            $forgot_page = '';
            $template = "{$dir['root']}admin/login_form.html";
            break;
    }
    $_page['header'] = "{$site['title']} " . _t("_Member Login");
    $_page['header_text'] = _t("_Member Login");
    // If path is divided with \\ (Windows) then use \\ instead of /
    $script_filename = strlen($_SERVER['SCRIPT_FILENAME']) ? $_SERVER['SCRIPT_FILENAME'] : $_SERVER['SCRIPT_NAME'];
    if (strstr($script_filename, '/')) {
        $arr1 = split("/", $script_filename);
        $s1 = $arr1[count($arr1) - 2];
    } elseif (strstr($script_filename, '\\\\')) {
        $arr1 = split("\\\\", $script_filename);
        $s1 = $arr1[count($arr1) - 3];
    }
    $_page_cont[0]['page_main_code'] = PageCompLoginForm($text, $member, $mem, $table, $login_page, $join_page, $forgot_page, $template);
    if ($s1 != $admin_dir && $s1 != "aff" && $s1 != $dir_dir && $s1 != "events" && $s1 != "moderators") {
        $_page['name_index'] = 0;
        PageCode();
        exit;
    } else {
        require_once BX_DIRECTORY_PATH_INC . 'admin_design.inc.php';
        $_page['header'] = "{$site['title']} {$mem} Login";
        TopCodeAdmin();
        echo $_page_cont[0]['page_main_code'];
        if (strlen($text)) {
            ?>
			<script type="text/javascript">
				addEvent( window, 'load', function(){ alert( '<?php 
            echo $text;
            ?>
' ); } );
			</script>
			<?php 
        }
        BottomCode();
    }
}