当前位置: 首页>>代码示例>>PHP>>正文


PHP ossn_error_page函数代码示例

本文整理汇总了PHP中ossn_error_page函数的典型用法代码示例。如果您正苦于以下问题:PHP ossn_error_page函数的具体用法?PHP ossn_error_page怎么用?PHP ossn_error_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ossn_error_page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ossn_action

/**
 * Load action.
 *
 * @param string $action The name of the action
 *
 * @return void
 */
function ossn_action($action)
{
    global $Ossn;
    if (isset($Ossn->action) && array_key_exists($action, $Ossn->action)) {
        if (is_file($Ossn->action[$action])) {
            $params['action'] = $action;
            ossn_trigger_callback('action', 'load', $params);
            include_once $Ossn->action[$action];
            if (ossn_is_xhr()) {
                header('Content-Type: application/json');
                $vars = array();
                if (isset($_SESSION['ossn_messages']['success']) && !empty($_SESSION['ossn_messages']['success'])) {
                    $vars['success'] = $_SESSION['ossn_messages']['success'];
                }
                //danger = error bootstrap
                if (isset($_SESSION['ossn_messages']['danger']) && !empty($_SESSION['ossn_messages']['danger'])) {
                    $vars['error'] = $_SESSION['ossn_messages']['danger'];
                }
                if (isset($Ossn->redirect) && !empty($Ossn->redirect)) {
                    $vars['redirect'] = $Ossn->redirect;
                }
                if (isset($Ossn->ajaxData) && !empty($Ossn->ajaxData)) {
                    $vars['data'] = $Ossn->ajaxData;
                }
                unset($_SESSION['ossn_messages']);
                if (!empty($vars)) {
                    echo json_encode($vars);
                }
            }
        }
    } else {
        ossn_error_page();
    }
}
开发者ID:nongdanit-nongdanit,项目名称:ossn,代码行数:41,代码来源:ossn.lib.actions.php

示例2: ossn_css_pagehandler

/**
 * Add css page handler
 *
 * @return false|null
 */
function ossn_css_pagehandler($css)
{
    if (ossn_site_settings('cache') == 1) {
        return false;
    }
    header("Content-type: text/css");
    $page = $css[0];
    if (empty($css[1])) {
        header('Content-Type: text/html; charset=utf-8');
        ossn_error_page();
    }
    if (empty($page)) {
        $page = 'view';
    }
    switch ($page) {
        case 'view':
            if (ossn_site_settings('cache') == 1) {
                return false;
            }
            if (ossn_is_hook('css', "register")) {
                echo ossn_call_hook('css', "register", $css);
            }
            break;
        default:
            header('Content-Type: text/html; charset=utf-8');
            ossn_error_page();
            break;
    }
}
开发者ID:nongdanit-nongdanit,项目名称:ossn,代码行数:34,代码来源:ossn.lib.css.php

示例3: ossn_trigger_upgrades

/**
 * Trigger upgrade / Run upgrade
 *
 * @return void;
 * @access private
 */
function ossn_trigger_upgrades()
{
    if (!ossn_isAdminLoggedin()) {
        ossn_kill_upgrading();
        ossn_error_page();
    }
    $upgrades = ossn_get_process_upgrade_files();
    if (!is_array($upgrades) || empty($upgrades)) {
        ossn_trigger_message(ossn_print('upgrade:not:available'), 'error');
        ossn_kill_upgrading();
        redirect('administrator');
    }
    foreach ($upgrades as $upgrade) {
        $file = ossn_route()->upgrade . "upgrades/{$upgrade}";
        if (!(include_once $file)) {
            throw new exception(ossn_print('upgrade:file:load:error'));
        }
    }
    //need to reset cache files
    if (ossn_site_settings('cache') !== 0) {
        ossn_trigger_css_cache();
        ossn_trigger_js_cache();
    }
    return true;
}
开发者ID:nongdanit-nongdanit,项目名称:ossn,代码行数:31,代码来源:ossn.lib.upgrade.php

示例4: ossn_search_page

function ossn_search_page($pages)
{
    $page = $pages[0];
    if (empty($page)) {
        $page = 'search';
    }
    ossn_trigger_callback('page', 'load:search');
    switch ($page) {
        case 'search':
            $query = input('q');
            $type = input('type');
            $title = ossn_print("search:result", array($query));
            if (empty($type)) {
                $params['type'] = 'users';
            } else {
                $params['type'] = $type;
            }
            $type = $params['type'];
            if (ossn_is_hook('search', "type:{$type}")) {
                $contents['contents'] = ossn_call_hook('search', "type:{$type}", array('q' => input('q')));
            }
            $contents = array('content' => ossn_plugin_view('search/pages/search', $contents));
            $content = ossn_set_page_layout('search', $contents);
            echo ossn_view_page($title, $content);
            break;
        default:
            ossn_error_page();
            break;
    }
}
开发者ID:nongdanit-nongdanit,项目名称:ossn,代码行数:30,代码来源:ossn_com.php

示例5: ossn_js_page_handler

function ossn_js_page_handler($pages)
{
    switch ($pages[0]) {
        case 'boot':
            if (!ossn_isLoggedIn()) {
                ossn_error_page();
            }
            if (isset($pages[1]) && $pages[1] == 'ossn.boot.chat.js') {
                header('Content-Type: application/javascript');
                echo ossn_plugin_view('js/OssnChat.Boot');
            }
            break;
        case 'selectfriend':
            $user = input('user');
            if (!empty($user)) {
                $user = ossn_user_by_guid($user);
                OssnChat::setUserChatSession($user);
                $friend['user'] = $user;
                echo ossn_plugin_view('chat/selectfriend', $friend);
            }
            break;
        default:
            ossn_error_page();
            break;
    }
}
开发者ID:nongdanit-nongdanit,项目名称:ossn,代码行数:26,代码来源:ossn_com.php

示例6: ossn_invite_pagehandler

/**
 * Invite page handler
 * 
 * @note Please don't call this function directly in your code.
 *
 * @return mixed
 * @access private
 */
function ossn_invite_pagehandler()
{
    if (!ossn_isLoggedin()) {
        ossn_error_page();
    }
    $title = ossn_print('com:ossn:invite:friends');
    $contents['content'] = ossn_view('components/OssnInvite/pages/invite');
    $content = ossn_set_page_layout('newsfeed', $contents);
    echo ossn_view_page($title, $content);
}
开发者ID:aidovoga,项目名称:opensource-socialnetwork,代码行数:18,代码来源:ossn_com.php

示例7: severpages

function severpages($pages)
{
    if (!ossn_isLoggedin()) {
        ossn_error_page();
    }
    $title = ossn_print('com:ossn:severload');
    //give a exact path to file <components/serverpages/pages/serverload>
    $contents['content'] = ossn_view('components/serverpages/pages/severload');
    $content = ossn_set_page_layout('contents', $contents);
    echo ossn_view_page($title, $content);
}
开发者ID:alexmwiti,项目名称:componets,代码行数:11,代码来源:ossn_com.php

示例8: ossn_action

/**
 * Load action.
 *
 * @param string $action The name of the action
 *
 * @return void
 */
function ossn_action($action)
{
    global $Ossn;
    if (isset($Ossn->action) && array_key_exists($action, $Ossn->action)) {
        if (is_file($Ossn->action[$action])) {
            $params['action'] = $action;
            ossn_trigger_callback('action', 'load', $params);
            include_once $Ossn->action[$action];
        }
    } else {
        ossn_error_page();
    }
}
开发者ID:aidovoga,项目名称:opensource-socialnetwork,代码行数:20,代码来源:ossn.lib.actions.php

示例9: ossn_action

function ossn_action($action)
{
    global $Ossn;
    if (isset($Ossn->action) && array_key_exists($action, $Ossn->action)) {
        if (is_file($Ossn->action[$action])) {
            ossn_trigger_callback('action', "load:{$action}");
            include_once $Ossn->action[$action];
        }
    } else {
        ossn_error_page();
        exit;
    }
}
开发者ID:alibasli,项目名称:Social-Network-PHP-Joomla,代码行数:13,代码来源:ossn.lib.actions.php

示例10: ossn_site_pages

function ossn_site_pages($pages)
{
    $page = $pages[0];
    if (empty($page)) {
        redirect(REF);
    }
    $OssnSitePages = new OssnSitePages();
    switch ($page) {
        case 'about':
            $OssnSitePages->pagename = 'about';
            $OssnSitePages = $OssnSitePages->getPage();
            if (isset($OssnSitePages->description)) {
                $params['contents'] = html_entity_decode(html_entity_decode($OssnSitePages->description));
            }
            $params['title'] = ossn_print('site:about');
            $title = $params['title'];
            $contents = array('content' => ossn_view('components/OssnSitePages/pages/page', $params));
            $content = ossn_set_page_layout('contents', $contents);
            echo ossn_view_page($title, $content);
            break;
        case 'terms':
            $OssnSitePages->pagename = 'terms';
            $OssnSitePages = $OssnSitePages->getPage();
            if (isset($OssnSitePages->description)) {
                $params['contents'] = html_entity_decode(html_entity_decode($OssnSitePages->description));
            }
            $params['title'] = ossn_print('site:terms');
            $title = $params['title'];
            $contents = array('content' => ossn_view('components/OssnSitePages/pages/page', $params));
            $content = ossn_set_page_layout('contents', $contents);
            echo ossn_view_page($title, $content);
            break;
        case 'privacy':
            $OssnSitePages->pagename = 'privacy';
            $OssnSitePages = $OssnSitePages->getPage();
            if (isset($OssnSitePages->description)) {
                $params['contents'] = html_entity_decode(html_entity_decode($OssnSitePages->description));
            }
            $params['title'] = ossn_print('site:privacy');
            $title = $params['title'];
            $contents = array('content' => ossn_view('components/OssnSitePages/pages/page', $params));
            $content = ossn_set_page_layout('contents', $contents);
            echo ossn_view_page($title, $content);
            break;
        default:
            ossn_error_page();
            break;
    }
}
开发者ID:aidovoga,项目名称:opensource-socialnetwork,代码行数:49,代码来源:ossn_com.php

示例11: ossn_load_page

function ossn_load_page($handler, $page)
{
    global $Ossn;
    ossn_add_context($handler);
    $page = explode('/', $page);
    if (isset($Ossn->page) && isset($Ossn->page[$handler]) && !empty($handler) && is_callable($Ossn->page[$handler])) {
        ob_start();
        call_user_func($Ossn->page[$handler], $page, $handler);
        $contents = ob_get_clean();
        $params['page'] = $page;
        $params['handler'] = $handler;
        return ossn_call_hook('page', 'load', $params, $contents);
    } else {
        return ossn_error_page();
    }
}
开发者ID:alibasli,项目名称:Social-Network-PHP-Joomla,代码行数:16,代码来源:ossn.lib.page.php

示例12: ossn_ads_handler

/**
 * Ad image page handler
 *
 * Pages: photo
 *
 * @return image;
 * @access public
 */
function ossn_ads_handler($pages)
{
    $page = $pages[0];
    if (empty($page)) {
        return false;
    }
    switch ($page) {
        case 'photo':
            header('Content-Type: image/jpeg');
            if (!empty($pages[1]) && !empty($pages[1]) && $pages[2] == md5($pages[1]) . '.jpg') {
                echo ossn_ad_image($pages[1]);
            }
            break;
        default:
            echo ossn_error_page();
            break;
    }
}
开发者ID:nongdanit-nongdanit,项目名称:ossn,代码行数:26,代码来源:ossn_com.php

示例13: ossn_load_page

/**
 * Output a page.
 *
 * If page is not registered then user will see a 404 page;
 *
 * @param  (string) $handler Page handler name;
 * @param  (string) $page  handler/page;
 * @last edit: $arsalanshah
 * @Reason: Initial;
 *
 * @return mix|null data
 * @access private
 */
function ossn_load_page($handler, $page)
{
    global $Ossn;
    $context = $handler;
    if (isset($page) && !empty($page)) {
        $context = "{$handler}/{$page}";
    }
    //set context
    ossn_add_context($context);
    $page = explode('/', $page);
    if (isset($Ossn->page) && isset($Ossn->page[$handler]) && !empty($handler) && is_callable($Ossn->page[$handler])) {
        //get page contents
        ob_start();
        call_user_func($Ossn->page[$handler], $page, $handler);
        $contents = ob_get_clean();
        //supply params to hook
        $params['page'] = $page;
        $params['handler'] = $handler;
        return ossn_call_hook('page', 'load', $params, $contents);
    } else {
        return ossn_error_page();
    }
}
开发者ID:ntmtri23,项目名称:lienminh365,代码行数:36,代码来源:ossn.lib.page.php

示例14: ossn_uservalidate_pagehandler

/**
 * Register a uservalidation page
 * @pages:
 *       uservalidate,
 *
 * @return bool
 */
function ossn_uservalidate_pagehandler($pages)
{
    $page = $pages[0];
    if (empty($page)) {
        echo ossn_error_page();
    }
    switch ($page) {
        case 'activate':
            if (!empty($pages[1]) && !empty($pages[2])) {
                $user = new OssnUser();
                $user->guid = $pages[1];
                if ($user->ValidateRegistration($pages[2])) {
                    ossn_trigger_message(ossn_print('user:account:validated'), 'success');
                    redirect();
                } else {
                    ossn_trigger_message(ossn_print('user:account:validate:fail'), 'success');
                    redirect();
                }
            }
            break;
    }
}
开发者ID:aidovoga,项目名称:opensource-socialnetwork,代码行数:29,代码来源:ossn.lib.users.php

示例15: ossn_index_pagehandler

/**
 * Register site index page
 * @pages:
 *       index or home,
 *
 * @return boolean|null
 */
function ossn_index_pagehandler($index)
{
    if (ossn_isLoggedin()) {
        redirect('home');
    }
    $page = $index[0];
    if (empty($page)) {
        $page = 'home';
    }
    switch ($page) {
        case 'home':
            echo ossn_plugin_view('pages/index');
            break;
        default:
            ossn_error_page();
            break;
    }
}
开发者ID:nongdanit-nongdanit,项目名称:ossn,代码行数:25,代码来源:ossn.lib.initialize.php


注:本文中的ossn_error_page函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。