예제 #1
0
 function pageCode($aPage = array(), $aPageCont = array(), $aCss = array(), $aJs = array(), $bAdminMode = false, $isSubActions = true)
 {
     if (!empty($aPage)) {
         foreach ($aPage as $sKey => $sValue) {
             $GLOBALS['_page'][$sKey] = $sValue;
         }
     }
     if (!empty($aPageCont)) {
         foreach ($aPageCont as $sKey => $sValue) {
             $GLOBALS['_page_cont'][$aPage['name_index']][$sKey] = $sValue;
         }
     }
     if (!empty($aCss)) {
         $this->addCss($aCss);
     }
     if (!empty($aJs)) {
         $this->addJs($aJs);
     }
     if ($isSubActions) {
         $aVars = array('BaseUri' => $this->_oConfig->getBaseUri());
         $GLOBALS['oTopMenu']->setCustomSubActions($aVars, $this->_oConfig->getMainPrefix() . '_title', false);
     }
     if (!$bAdminMode) {
         PageCode($this);
     } else {
         PageCodeAdmin();
     }
 }
예제 #2
0
 function _page($sTitle, $sContent)
 {
     global $_page, $_page_cont;
     $this->addCss('main.css');
     $_page['name_index'] = 0;
     $_page['header'] = $_page['header_text'] = $sTitle;
     $_page_cont[0]['page_main_code'] = $sContent;
     PageCode();
     exit;
 }
예제 #3
0
 function defaultPage($sTitle, $sContent, $iPageIndex = 7)
 {
     global $_page;
     global $_page_cont;
     $_page['name_index'] = $iPageIndex;
     $_page['header'] = $sTitle ? $sTitle : $GLOBALS['site']['title'];
     $_page['header_text'] = $sTitle;
     $_page_cont[$_page['name_index']]['page_main_code'] = $sContent;
     PageCode();
 }
예제 #4
0
 /**
  * Function will generate default dolphin's page;
  *
  * @param  : $sPageCaption   (string) - page's title;
  * @param  : $sPageContent   (string) - page's content;
  * @return : (text) html presentation data;
  */
 function getPage($sPageCaption, $sPageContent)
 {
     global $_page;
     global $_page_cont;
     $_page['name_index'] = 0;
     // set module's icon;
     $GLOBALS['oTopMenu']->setCustomSubIconUrl(false === strpos($this->_sPageIcon, '.') ? $this->_sPageIcon : $this->getIconUrl($this->_sPageIcon));
     $GLOBALS['oTopMenu']->setCustomSubHeader($sPageCaption);
     $_page['header'] = $sPageCaption;
     $_page['header_text'] = $sPageCaption;
     $_page_cont[0]['page_main_code'] = $sPageContent;
     PageCode($this);
     exit;
 }
예제 #5
0
 function pageCode($sTitle, $isDesignBox = true, $isWrap = true)
 {
     global $_page;
     global $_page_cont;
     $_page['name_index'] = $isDesignBox ? 0 : $this->_iPageIndex;
     $_page['header'] = $sTitle ? $sTitle : $GLOBALS['site']['title'];
     $_page['header_text'] = $sTitle;
     $_page_cont[$_page['name_index']]['page_main_code'] = $this->pageEnd();
     if ($isWrap) {
         $aVars = array('content' => $_page_cont[$_page['name_index']]['page_main_code']);
         $_page_cont[$_page['name_index']]['page_main_code'] = $this->parseHtmlByName('default_padding', $aVars);
     }
     $GLOBALS['oSysTemplate']->addDynamicLocation($this->_oConfig->getHomePath(), $this->_oConfig->getHomeUrl());
     PageCode($GLOBALS['oSysTemplate']);
 }
 /**
  * Function will generate default dolphin's page;
  *
  * @param  : $sPageCaption   (string) - page's title;
  * @param  : $sPageContent   (string) - page's content;
  * @param  : $sPageIcon      (string) - page's icon;
  * @return : (text) html presentation data;
  */
 function getPage($sPageCaption, $sPageContent, $sPageIcon = 'facebook-small-logo.png')
 {
     global $_page;
     global $_page_cont;
     $iIndex = 54;
     $_page['name_index'] = $iIndex;
     // set module's icon;
     $GLOBALS['oTopMenu']->setCustomSubIconUrl($this->getIconUrl($sPageIcon));
     $GLOBALS['oTopMenu']->setCustomSubHeader($sPageCaption);
     $_page['header'] = $sPageCaption;
     $_page['header_text'] = $sPageCaption;
     $_page['css_name'] = 'face_book_connect.css';
     $_page_cont[$iIndex]['page_main_code'] = $sPageContent;
     PageCode($this);
 }
 /**
  * Function will generate default dolphin's page;
  *
  * @param  : $sPageCaption   (string) - page's title;
  * @param  : $sPageContent   (string) - page's content;
  * @param  : $sPageIcon      (string) - page's icon;
  * @return : (text) html presentation data;
  */
 function getPage($sPageCaption, $sPageContent, $sPageIcon = 'facebook')
 {
     global $_page;
     global $_page_cont;
     $iIndex = 55;
     $_page['name_index'] = $iIndex;
     // set module's icon;
     $GLOBALS['oTopMenu']->setCustomSubIconUrl(false === strpos($sPageIcon, '.') ? $sPageIcon : $this->getIconUrl($sPageIcon));
     $GLOBALS['oTopMenu']->setCustomSubHeader($sPageCaption);
     $_page['header'] = $sPageCaption;
     $_page['header_text'] = $sPageCaption;
     $_page['css_name'] = 'face_book_connect.css';
     $_page_cont[$iIndex]['page_main_code'] = DesignBoxContent($sPageCaption, $sPageContent, 11);
     PageCode($this);
 }
예제 #8
0
 function pageCode($sTitle, $isDesignBox = true, $isWrap = true, $isSubActions = true)
 {
     global $_page;
     global $_page_cont;
     if (null == $this->_oMain) {
         $this->_oMain = BxDolModule::getInstance('BxSitesModule');
     }
     $_page['name_index'] = $isDesignBox ? 0 : $this->_iPageIndex;
     $_page['header'] = $sTitle ? $sTitle : $GLOBALS['site']['title'];
     $_page['header_text'] = $sTitle;
     if ($isWrap) {
         $aVars = array('content' => $this->pageEnd());
         $_page_cont[$_page['name_index']]['page_main_code'] = $this->parseHtmlByName('default_padding.html', $aVars);
     } else {
         $_page_cont[$_page['name_index']]['page_main_code'] = $this->pageEnd();
     }
     if ($isSubActions) {
         $aVars = array('BaseUri' => $this->_oConfig->getBaseUri(), 'isAllowedAdd' => $this->_oMain->isAllowedAdd() ? 1 : 0);
         $GLOBALS['oTopMenu']->setCustomSubActions($aVars, 'bx_sites_title', false);
     }
     PageCode($this);
 }
예제 #9
0
 function pageCode($sTitle, $isDesignBox = true, $isWrap = true)
 {
     global $_page;
     global $_page_cont;
     $GLOBALS['BxDolTemplateJs'] = array();
     $GLOBALS['BxDolTemplateCss'] = array();
     $this->addCss($this->_aMobileCss);
     $this->addJs($this->_aMobileJs);
     $sOutput = $this->pageEnd();
     if ($isDesignBox) {
         $aVars = array('content' => $sOutput);
         $sOutput = $this->parseHtmlByName('mobile_box.html', $aVars);
     }
     if ($isWrap) {
         $aVars = array('content' => $sOutput);
         $sOutput = $this->parseHtmlByName('mobile_page_padding.html', $aVars);
     }
     $iNameIndex = 11;
     $_page['name_index'] = $iNameIndex;
     $_page['header'] = $sTitle ? $sTitle : $GLOBALS['site']['title'];
     $_page_cont[$iNameIndex]['page_main_code'] = $sOutput;
     PageCode($this);
 }
예제 #10
0
 function pageCode($aPage = array(), $aPageCont = array(), $aCss = array(), $aJs = array(), $bAdminMode = false, $isSubActions = true)
 {
     if (!empty($aPage)) {
         foreach ($aPage as $sKey => $sValue) {
             $GLOBALS['_page'][$sKey] = $sValue;
         }
     }
     if (!empty($aPageCont)) {
         foreach ($aPageCont as $sKey => $sValue) {
             $GLOBALS['_page_cont'][$aPage['name_index']][$sKey] = $sValue;
         }
     }
     if (!empty($aCss)) {
         $this->addCss($aCss);
     }
     if (!empty($aJs)) {
         $this->addJs($aJs);
     }
     if (!$bAdminMode) {
         PageCode($this);
     } else {
         PageCodeAdmin();
     }
 }
예제 #11
0
/** //MOVE THIS FUNCTION TO utils.inc.php!!!
 * Displays list of links, using current template
 * (design.inc.php module should be included)
 *
 * @param string $pageHeaderText
 *
 * @param string $listHeaderText
 *
 * @param array of CHyperLink $links - array of URLs. Array length must be equal to $linksDescriptions length
 *
 * @return bool	Returns true on success and false in case of any error
 */
function showLinksList($pageIndex, $pageHeaderText, $listHeaderText, $links)
{
    global $_page_cont;
    global $_page;
    if (!class_exists('CHyperLink')) {
        return false;
    }
    if (!is_array($links) || count($links) == 0) {
        return false;
    }
    $pageMainCode = '';
    $_page['header_text'] = $pageHeaderText;
    $pageMainCode .= $listHeaderText . '<br />';
    foreach ($links as $hyperLink) {
        if (!is_a($hyperLink, 'CHyperLink')) {
            return false;
        }
        $pageMainCode .= $hyperLink->GetHTMLcode() . '<br />';
    }
    $_page_cont[$pageIndex]['page_main_code'] = '<div align="center">' . $pageMainCode . '</div>';
    PageCode();
    return true;
}
예제 #12
0
 * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
 * CC-BY License - http://creativecommons.org/licenses/by/3.0/
 */
require_once BX_DIRECTORY_PATH_MODULES . $aModule['path'] . '/classes/' . $aModule['class_prefix'] . 'Module.php';
bx_import('BxDolPageView');
$oSpy = new BxSpyModule($aModule);
// ** init some needed variables ;
global $_page;
global $_page_cont;
//-- Define activity type --//;
$sActivityType = '';
if (isset($_GET['spy_type'])) {
    switch ($_GET['spy_type']) {
        case 'profiles_activity':
            $sActivityType = 'profiles_activity';
            break;
        case 'content_activity':
            $sActivityType = 'content_activity';
            break;
    }
}
$iIndex = 0;
$sPageCaption = _t('_bx_spy_notifications');
$GLOBALS['oTopMenu']->setCurrentProfileID($oSpy->iMemberId);
$_page['name_index'] = $iIndex;
$_page['header'] = $sPageCaption;
$_page['header_text'] = $sPageCaption;
$_page['css_name'] = 'spy.css';
$_page_cont[$iIndex]['page_main_code'] = $oSpy->getActivityPage($oSpy->iMemberId, $sActivityType);
PageCode($oSpy->_oTemplate);
예제 #13
0
function check_login($ID, $passwd, $iRole = BX_DOL_ROLE_MEMBER, $error_handle = true)
{
    $ID = (int) $ID;
    if (!$ID) {
        if ($error_handle) {
            login_form(_t("_PROFILE_ERR"), $member);
        }
        return false;
    }
    switch ($iRole) {
        case BX_DOL_ROLE_MEMBER:
            $member = 0;
            break;
        case BX_DOL_ROLE_ADMIN:
            $member = 1;
            break;
    }
    $aProfile = getProfileInfo($ID);
    // If no such members
    if (!$aProfile) {
        if ($error_handle) {
            login_form(_t("_PROFILE_ERR"), $member);
        }
        return false;
    }
    // If password is incorrect
    if (strcmp($aProfile['Password'], $passwd) != 0) {
        if ($error_handle) {
            login_form(_t("_INVALID_PASSWD"), $member);
        }
        return false;
    }
    if (!((int) $aProfile['Role'] & $iRole)) {
        if ($error_handle) {
            login_form(_t("_INVALID_ROLE"), $member);
        }
        return false;
    }
    if ((int) $aProfile['Role'] & BX_DOL_ROLE_ADMIN || (int) $aProfile['Role'] & BX_DOL_ROLE_MODERATOR) {
        if ('on' != getParam('ext_nav_menu_enabled')) {
            update_date_lastnav($ID);
        }
        return true;
    }
    // if IP is banned
    if (2 == getParam('ipBlacklistMode') && bx_is_ip_blocked() || 'on' == getParam('sys_dnsbl_enable') && 'block' == getParam('sys_dnsbl_behaviour') && bx_is_ip_dns_blacklisted('', 'login')) {
        if ($error_handle) {
            $GLOBALS['_page']['name_index'] = 55;
            $GLOBALS['_page']['css_name'] = '';
            $GLOBALS['_ni'] = $GLOBALS['_page']['name_index'];
            $GLOBALS['_page_cont'][$GLOBALS['_ni']]['page_main_code'] = MsgBox(_t('_Sorry, your IP been banned'));
            PageCode();
        }
        return false;
    }
    // if profile is banned
    if (isLoggedBanned($aProfile['ID'])) {
        if ($error_handle) {
            $GLOBALS['_page']['name_index'] = 55;
            $GLOBALS['_page']['css_name'] = '';
            $GLOBALS['_ni'] = $GLOBALS['_page']['name_index'];
            $GLOBALS['_page_cont'][$GLOBALS['_ni']]['page_main_code'] = MsgBox(_t('_member_banned'));
            PageCode();
        }
        return false;
    }
    if ('on' != getParam('ext_nav_menu_enabled')) {
        update_date_lastnav($ID);
    }
    return true;
}
예제 #14
0
 function serviceResponceProtectURL($sURL)
 {
     if (!isLogged() && bx_get('oid') && bx_get('pwd')) {
         // in case of request from flash, cookies are not passed, and we have to set it explicitly
         $_COOKIE['memberID'] = bx_get('oid');
         $_COOKIE['memberPassword'] = bx_get('pwd');
         check_logged();
     }
     if (!$this->serviceIsUrlAccessable($sURL, getLoggedId())) {
         global $_page;
         global $_page_cont;
         $_page['name_index'] = -1;
         $_page['header'] = _t("_bx_pageac_access_denied");
         $_page_cont[$_page['name_index']]['page_main_code'] = MsgBox(_t("_bx_pageac_deny_text"));
         PageCode();
         exit;
     }
 }
예제 #15
0
 function _error($sType, $sParam1 = '', $sParam2 = '')
 {
     header('Status: 404 Not Found');
     header('HTTP/1.0 404 Not Found');
     global $_page;
     global $_page_cont;
     $iIndex = 13;
     $_page['name_index'] = $iIndex;
     $_page['header'] = _t("_sys_request_" . $sType . "_not_found_cpt");
     $_page_cont[$iIndex]['page_main_code'] = MsgBox(_t("_sys_request_" . $sType . "_not_found_cnt", htmlspecialchars_adv($sParam1), htmlspecialchars_adv($sParam2)));
     PageCode();
     exit;
 }
예제 #16
0
파일: blogs.php 프로젝트: noormcs/studoro
            $sRetHtml .= $oBlogs->GenPostsOfCategory();
            break;
        case 'show_calendar':
            $sRetHtml .= $oBlogs->GenBlogCalendar();
            break;
        case 'show_calendar_day':
            $sRetHtml .= $oBlogs->GenPostCalendarDay();
            break;
        case 'home':
            $sRetHtml .= $oBlogs->GenBlogHome();
            break;
        case 'tags':
            $sRetHtml .= $oBlogs->GenTagsPage();
            break;
        case 'share_post':
            $oBlogs->ActionSharePopup($_GET['post_id']);
            break;
        default:
            $sRetHtml .= $oBlogs->GenBlogLists('last');
            break;
    }
    return $sRetHtml;
}
if ($oBlogs->_iVisitorID) {
    $sVisitorNickname = getUsername($oBlogs->_iVisitorID);
    $sVisitorBlogLink = $oBlogs->genBlogLink('show_member_blog_home', array('Permalink' => $sVisitorNickname, 'Link' => $oBlogs->_iVisitorID), '', '', '', true);
    $aOpt = array('only_menu' => 1, 'blog_owner_link' => $sVisitorBlogLink);
    $GLOBALS['oTopMenu']->setCustomSubActions($aOpt, 'bx_blogs', true);
}
PageCode($oBlogs->_oTemplate);
예제 #17
0
 function getPageCode(&$aParams)
 {
     global $_page;
     global $_page_cont;
     $iIndex = isset($aParams['index']) ? (int) $aParams['index'] : 0;
     $_page['name_index'] = $iIndex;
     $_page['js_name'] = isset($aParams['js']) ? $aParams['js'] : '';
     $_page['css_name'] = isset($aParams['css']) ? $aParams['css'] : '';
     $_page['extra_js'] = isset($aParams['extra_js']) ? $aParams['extra_js'] : '';
     check_logged();
     if (isset($aParams['content'])) {
         foreach ($aParams['content'] as $sKey => $sValue) {
             $_page_cont[$iIndex][$sKey] = $sValue;
         }
     }
     if (isset($aParams['title']['page'])) {
         $this->setPageTitle($aParams['title']['page']);
     }
     if (isset($aParams['title']['block'])) {
         $this->setPageMainBoxTitle($aParams['title']['block']);
     }
     if (isset($aParams['breadcrumb'])) {
         $GLOBALS['oTopMenu']->setCustomBreadcrumbs($aParams['breadcrumb']);
     }
     PageCode($this);
 }
예제 #18
0
    function BxPmtHistoryPage($sType, &$oPayments)
    {
        parent::BxDolPageView('bx_pmt_history');
        $this->_iVendorId = $sType == 'site' ? BX_PMT_ADMINISTRATOR_ID : BX_PMT_EMPTY_ID;
        $this->_oPayments =& $oPayments;
    }
    function getBlockCode_History()
    {
        return $this->_oPayments->getCartHistory($this->_iVendorId);
    }
}
global $_page;
global $_page_cont;
global $logged;
$iIndex = 2;
$_page['name_index'] = $iIndex;
$_page['js_name'] = 'orders.js';
$_page['css_name'] = 'orders.css';
check_logged();
$sType = '';
if (isset($aRequest)) {
    $sType = process_db_input(array_shift($aRequest), BX_TAGS_STRIP);
}
$oPayments = new BxPmtModule($aModule);
$oHistoryPage = new BxPmtHistoryPage($sType, $oPayments);
$_page_cont[$iIndex]['page_main_code'] = $oHistoryPage->getCode();
$_page_cont[$iIndex]['more_code'] = $oPayments->getMoreWindow();
$_page_cont[$iIndex]['js_code'] = $oPayments->getExtraJs('orders');
$oPayments->_oTemplate->setPageTitle(_t('_payment_pcaption_cart_history'));
PageCode($oPayments->_oTemplate);
예제 #19
0
 function _onResultPage($aResult)
 {
     global $_page;
     global $_page_cont;
     $_page['name_index'] = isset($aResult['page_index']) ? (int) $aResult['page_index'] : 0;
     $_page['header'] = !empty($aResult['page_caption']) ? $aResult['page_caption'] : _t($this->_sLangsPrefix . 'pcpt_payment_result');
     $_page['header_text'] = !empty($aResult['block_caption']) ? $aResult['block_caption'] : _t($this->_sLangsPrefix . 'bcpt_payment_result');
     $sContent = $this->_oTemplate->parseHtmlByName('default_padding.html', array('content' => !empty($aResult['message']) ? MsgBox($aResult['message']) : ''));
     $_page_cont[$_page['name_index']]['page_main_code'] = $sContent;
     PageCode($GLOBALS['oSysTemplate']);
 }
예제 #20
0
 function serviceResponceProtectURL($sURL)
 {
     if (!$this->serviceIsUrlAccessable($sURL, getLoggedId())) {
         global $_page;
         global $_page_cont;
         $_page['name_index'] = -1;
         $_page['header'] = _t("_bx_pageac_access_denied");
         $_page_cont[$_page['name_index']]['page_main_code'] = MsgBox(_t("_bx_pageac_deny_text"));
         PageCode();
         exit;
     }
 }
예제 #21
0
<?php

/**
 * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
 * CC-BY License - http://creativecommons.org/licenses/by/3.0/
 */
require_once BX_DIRECTORY_PATH_MODULES . $aModule['path'] . '/classes/' . $aModule['class_prefix'] . 'Module.php';
global $_page;
global $_page_cont;
$iId = isset($_COOKIE['memberID']) && ($GLOBALS['logged']['member'] || $GLOBALS['logged']['admin']) ? (int) $_COOKIE['memberID'] : 0;
$iIndex = 57;
$_page['name_index'] = $iIndex;
$_page['css_name'] = '';
$_page['header'] = _t('_chat_page_caption');
$_page['header_text'] = _t('_chat_box_caption', $site['title']);
$oChat = new BxChatModule($aModule);
$_page_cont[$iIndex]['page_main_code'] = $oChat->getContent($iId);
PageCode($oChat->_oTemplate);
예제 #22
0
                $sStatus = bx_get('ActType') == 'active' ? 'active' : 'inactive';
                $oAds->_oDb->setPostStatus($iAdID, $sStatus);
                $oAds->ActionPrintAdvertisement($iAdID);
                bx_import('PageView', $oAds->_aModule);
                $oAPV = new BxAdsPageView($oAds, $iAdID);
                $sRetHtml .= $oAPV->getCode();
            }
        } elseif (false !== bx_get('BuyNow')) {
            $advId = (int) bx_get('IDAdv');
            if ($advId > 0) {
                $sRetHtml .= $oAds->ActionBuyAdvertisement($advId);
            }
        } elseif (false !== bx_get('BuySendNow')) {
            $advId = (int) bx_get('IDAdv');
            if ($advId > 0) {
                $sRetHtml .= $oAds->ActionBuySendMailAdvertisement($advId);
            }
        } else {
            $sRetHtml .= $oAds->getAdsMainPage();
        }
    } else {
        $sRetHtml .= $oAds->getAdsMainPage();
    }
    return $sRetHtml;
}
if ($oAds->_iVisitorID) {
    $aOpt = array('only_menu' => 1);
    $GLOBALS['oTopMenu']->setCustomSubActions($aOpt, 'bx_ads', true);
}
PageCode($oAds->_oTemplate);
예제 #23
0
 function _onResultPage($aResult)
 {
     global $_page;
     global $_page_cont;
     $_page['name_index'] = 0;
     $_page['header'] = _t('_payment_pcaption_payment_result');
     $_page['header_text'] = _t('_payment_bcaption_payment_result');
     $_page_cont[$_page['name_index']]['page_main_code'] = MsgBox($aResult['message']);
     PageCode($GLOBALS['oSysTemplate']);
 }
예제 #24
0
                    $oPoll->_oTemplate->addPageKeywords($aPollInfo['poll_answers'], BX_POLL_ANS_DIVIDER);
                    if (mb_strlen($sPageTitle) > $oPoll->sPollHomeTitleLenght) {
                        $sPageTitle = mb_substr($sPageTitle, 0, $oPoll->sPollHomeTitleLenght) . '...';
                    }
                    $sCode = $sInitPart . $oViewPoll->getCode();
                } else {
                    $oPoll->_oTemplate->displayPageNotFound();
                }
                $GLOBALS['oTopMenu']->setCustomSubHeader($sPageTitle);
                $_page_cont[$iIndex]['page_main_code'] = $sCode;
            } else {
                $oViewPoll = bx_instance($aModule['class_prefix'] . 'View', array($aPollSettings['action'], $aModule, $oPoll, $iPollId), $aModule);
                $sPageCaption = _t('_bx_poll_home');
                $_page['header'] = $sPageCaption;
                $_page['header_text'] = $sPageCaption;
                $sCode = $sInitPart . $oViewPoll->getCode();
            }
            $_page_cont[$iIndex]['page_main_code'] = $sCode;
            break;
        case 'delete_poll':
            if ($iPollId) {
                $oPoll->deletePoll($iPollId);
            }
            $_page_cont[$iIndex]['page_main_code'] = $oPoll->searchAll();
            break;
        default:
            $_page_cont[$iIndex]['page_main_code'] = $oPoll->searchAll();
    }
}
PageCode($oPoll->_oTemplate);
예제 #25
0
 function displayMsg($s, $bTranslate = false)
 {
     $sTitle = $bTranslate ? _t($s) : $s;
     $GLOBALS['_page'] = array('name_index' => 0, 'header' => $sTitle, 'header_text' => $sTitle);
     $GLOBALS['_page_cont'][0]['page_main_code'] = MsgBox($sTitle);
     PageCode();
     exit;
 }
예제 #26
0
/***************************************************************************
*                            Dolphin Smart Community Builder
*                              -----------------
*     begin                : Mon Mar 23 2006
*     copyright            : (C) 2006 BoonEx Group
*     website              : http://www.boonex.com/
* This file is part of Dolphin - Smart Community Builder
*
* Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 
* http://creativecommons.org/licenses/by/3.0/
*
* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the Creative Commons Attribution 3.0 License for more details. 
* You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 
* see license.txt file; if not, write to marketing@boonex.com
***************************************************************************/
require_once BX_DIRECTORY_PATH_MODULES . $aModule['path'] . '/classes/' . $aModule['class_prefix'] . 'Module.php';
global $_page;
global $_page_cont;
$iId = isset($_COOKIE['memberID']) && ($GLOBALS['logged']['member'] || $GLOBALS['logged']['admin']) ? (int) $_COOKIE['memberID'] : 0;
$iIndex = 57;
$_page['name_index'] = $iIndex;
$_page['css_name'] = 'main.css';
$_page['header'] = _t('_board_page_caption');
$_page['header_text'] = _t('_board_box_caption', $site['title']);
$oBoard = new BxBoardModule($aModule);
$_page_cont[$iIndex]['page_main_code'] = $oBoard->getContent($iId, $aRequest[0]);
PageCode($oBoard->_oTemplate);
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();
    }
}
예제 #28
0
/**
 * Check profile existing, membership/acl, profile status and privacy.
 * If some of visibility options are not allowed then appropritate page is shown and exit called.
 * @param $iViewedId viewed member id
 * @param $iViewerId viewer member id
 * @return nothing
 */
function bx_check_profile_visibility($iViewedId, $iViewerId = 0, $bReturn = false)
{
    global $logged, $site, $_page, $_page_cont, $p_arr;
    // check if profile exists
    if (!$iViewedId) {
        if ($bReturn) {
            return false;
        }
        $GLOBALS['oSysTemplate']->displayPageNotFound();
        exit;
    }
    // check if viewer can view profile
    $bPerform = $iViewedId == $iViewerId ? FALSE : TRUE;
    $check_res = checkAction($iViewerId, ACTION_ID_VIEW_PROFILES, $bPerform, $iViewedId);
    if ($check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED && !$logged['admin'] && !$logged['moderator'] && $iViewerId != $iViewedId) {
        if ($bReturn) {
            return false;
        }
        $_page['header'] = "{$site['title']} " . _t("_Member Profile");
        $_page['header_text'] = "{$site['title']} " . _t("_Member Profile");
        $_page['name_index'] = 0;
        $_page_cont[0]['page_main_code'] = MsgBox($check_res[CHECK_ACTION_MESSAGE]);
        PageCode();
        exit;
    }
    bx_import('BxBaseProfileView');
    $oProfile = new BxBaseProfileGenerator($iViewedId);
    $p_arr = $oProfile->_aProfile;
    // check if viewed member is active
    if (!($p_arr['ID'] && ($logged['admin'] || $logged['moderator'] || $oProfile->owner || $p_arr['Status'] == 'Active'))) {
        if ($bReturn) {
            return false;
        }
        header("HTTP/1.1 404 Not Found");
        $GLOBALS['oSysTemplate']->displayMsg(_t("_Profile NA"));
        exit;
    }
    // check privacy
    if (!$logged['admin'] && !$logged['moderator'] && $iViewerId != $iViewedId) {
        $oPrivacy = new BxDolPrivacy('Profiles', 'ID', 'ID');
        if (!$oPrivacy->check('view', $iViewedId, $iViewerId)) {
            if ($bReturn) {
                return false;
            }
            bx_import('BxDolProfilePrivatePageView');
            $oProfilePrivateView = new BxDolProfilePrivatePageView($oProfile, $site, $dir);
            $_page['name_index'] = 7;
            $_page_cont[7]['page_main_code'] = $oProfilePrivateView->getCode();
            PageCode();
            exit;
        }
    }
    if ($bReturn) {
        return true;
    }
}
예제 #29
0
        $_page['extra_js'] = $oTemplConfig->sTinyMceEditorCompactJS;
        // --------------- page components
        $_ni = $_page['name_index'];
        $arrMember = getProfileInfo($memberID);
        //db_arr( "SELECT `Status` FROM `Profiles` WHERE `ID`=$memberID" );
        if ($arrMember['Status'] == 'Active') {
            $_page_cont[$_ni]['page_main_code'] = $oGroups->PCCreateForm($memberID);
        } else {
            $_page_cont[$_ni]['page_main_code'] = _t('_You must be active member to create groups');
        }
        break;
        //forms of editing
    //forms of editing
    case 'add_category':
        break;
        //non safe functions
    //non safe functions
    case 'create_blog':
        break;
    default:
        $_page['header'] = _t("_Groups Home");
        $_page['header_text'] = _t("_Groups categories");
        $_page['name_index'] = 74;
        $_ni = $_page['name_index'];
        list($sCategories, $sAllNewGroups) = $oGroups->GenIndexPageOfGroups();
        $_page_cont[$_ni]['page_main_code'] = $sCategories;
        $_page_cont[$_ni]['page_top_groups'] = $sAllNewGroups;
        break;
}
PageCode();
예제 #30
0
/***************************************************************************
 *                            Dolphin Smart Community Builder
 *                              -----------------
 *     begin                : Mon Mar 23 2006
 *     copyright            : (C) 2006 BoonEx Group
 *     website              : http://www.boonex.com/
 * This file is part of Dolphin - Smart Community Builder
 *
 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 
 * http://creativecommons.org/licenses/by/3.0/
 *
 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the Creative Commons Attribution 3.0 License for more details. 
 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 
 * see license.txt file; if not, write to marketing@boonex.com
 ***************************************************************************/
require_once BX_DIRECTORY_PATH_MODULES . $aModule['path'] . '/classes/' . $aModule['class_prefix'] . 'Module.php';
$oSimpleMessenger = new BxSimpleMessengerModule($aModule);
// ** init some needed variables ;
global $_page;
global $_page_cont;
$iIndex = 2;
$_page['name_index'] = $iIndex;
$sPageCaption = _t('_simple_messenger_privacy_settings_caption');
$_page['header'] = $sPageCaption;
$_page['header_text'] = $sPageCaption;
$_page['css_name'] = 'main.css';
$_page_cont[$iIndex]['page_main_code'] = $oSimpleMessenger->getPrivacyPage();
PageCode($oSimpleMessenger->_oTemplate);