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


PHP titania::error_box方法代码示例

本文整理汇总了PHP中titania::error_box方法的典型用法代码示例。如果您正苦于以下问题:PHP titania::error_box方法的具体用法?PHP titania::error_box怎么用?PHP titania::error_box使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在titania的用法示例。


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

示例1: email_friend

    /**
     * Ignore this for now!
     * Moving it to the side for later...
     */
    public function email_friend()
    {
        phpbb::$user->add_lang('memberlist');
        if (!phpbb::$config['email_enable']) {
            titania::error_box('ERROR', 'EMAIL_DISABLED', TITANIA_ERROR, HEADER_SERVICE_UNAVAILABLE);
            return false;
        }
        if (!phpbb::$user->data['is_registered'] || phpbb::$user->data['is_bot'] || !phpbb::$auth->acl_get('u_sendemail')) {
            if (phpbb::$user->data['user_id'] == ANONYMOUS) {
                login_box(titania::$page, phpbb::$user->lang['ERROR_CONTRIB_EMAIL_FRIEND']);
            }
            titania::error_box('ERROR', 'ERROR_CONTRIB_EMAIL_FRIEND', TITANIA_ERROR, HEADER_FORBIDDEN);
            return false;
        }
        // Are we trying to abuse the facility?
        if (titania::$time - phpbb::$user->data['user_emailtime'] < phpbb::$config['flood_interval']) {
            trigger_error('FLOOD_EMAIL_LIMIT', E_USER_NOTICE);
        }
        $name = utf8_normalize_nfc(request_var('name', '', true));
        $email = request_var('email', '');
        $email_lang = request_var('lang', phpbb::$config['default_lang']);
        $message = utf8_normalize_nfc(request_var('message', '', true));
        $cc = isset($_POST['cc_email']) ? true : false;
        $submit = isset($_POST['submit']) ? true : false;
        add_form_key('contrib_email');
        phpbb::$template->assign_vars(array('S_LANG_OPTIONS' => language_select($email_lang), 'S_POST_ACTION' => phpbb::append_sid(titania::$page, array('id' => 'email', 'contrib_id' => $this->contrib_id))));
        $error = array();
        if ($submit) {
            if (!check_form_key('contrib_email')) {
                $error[] = 'FORM_INVALID';
            }
            if (!$email || !preg_match('/^' . get_preg_expression('email') . '$/i', $email)) {
                $error[] = 'EMPTY_ADDRESS_EMAIL';
            }
            if (!$name) {
                $error[] = 'EMPTY_NAME_EMAIL';
            }
            if (!empty($error)) {
                titania::error_box('ERROR', $error, TITANIA_ERROR);
                return false;
            }
            phpbb::_include('functions_messenger', false, 'messenger');
            $sql = 'UPDATE ' . USERS_TABLE . '
				SET user_emailtime = ' . titania::$time . '
				WHERE user_id = ' . (int) phpbb::$user->data['user_id'];
            $result = phpbb::$db->sql_query($sql);
            $mail_to_users = array();
            $mail_to_users[] = array('email_lang' => $email_lang, 'email' => $email, 'name' => $name);
            // Ok, now the same email if CC specified, but without exposing the users email address
            if ($cc) {
                $mail_to_users[] = array('email_lang' => phpbb::$user->data['user_lang'], 'email' => phpbb::$user->data['user_email'], 'name' => phpbb::$user->data['username']);
            }
            $lang_path = phpbb::$user->lang_path;
            phpbb::$user->set_custom_lang_path(titania::$config->language_path);
            $messenger = new messenger(false);
            foreach ($mail_to_users as $row) {
                $messenger->template('contrib_recommend', $row['email_lang']);
                $messenger->replyto(phpbb::$user->data['user_email']);
                $messenger->to($row['email'], $row['name']);
                $messenger->headers('X-AntiAbuse: Board servername - ' . phpbb::$config['server_name']);
                $messenger->headers('X-AntiAbuse: User_id - ' . (int) phpbb::$user->data['user_id']);
                $messenger->headers('X-AntiAbuse: Username - ' . phpbb::$user->data['username']);
                $messenger->headers('X-AntiAbuse: User IP - ' . phpbb::$user->ip);
                $messenger->assign_vars(array('BOARD_CONTACT' => phpbb::$config['board_contact'], 'TO_USERNAME' => htmlspecialchars_decode($name), 'FROM_USERNAME' => htmlspecialchars_decode(phpbb::$user->data['username']), 'MESSAGE' => htmlspecialchars_decode($message), 'CONTRIB_NAME' => htmlspecialchars_decode($this->contrib_name), 'U_CONTRIB' => phpbb::append_sid(titania::$page, array('contrib_id' => $this->contrib_id, 'id' => 'details'), true, '')));
                $messenger->send(NOTIFY_EMAIL);
            }
            phpbb::$user->set_custom_lang_path($lang_path);
            titania::error_box('SUCCESS', 'EMAIL_SENT', TITANIA_SUCCESS);
            return true;
        }
        return false;
    }
开发者ID:Gfksx,项目名称:customisation-db,代码行数:76,代码来源:email.php

示例2: msg_handler

        phpbb::$user->set_custom_lang_path(TITANIA_ROOT . 'language/');
        phpbb::$user->add_lang('common');
        msg_handler(E_USER_ERROR, phpbb::$user->lang['TITANIA_DISABLED'], '', '');
    }
    redirect(phpbb::append_sid(TITANIA_ROOT . 'install.' . PHP_EXT));
}
// Initialise Titania
titania::initialise();
// Allow login attempts from any page (mini login box)
if (isset($_POST['login'])) {
    phpbb::login_box();
}
// admin requested the cache to be purged, ensure they have permission and purge the cache.
if (isset($_GET['cache']) && $_GET['cache'] == 'purge' && phpbb::$auth->acl_get('a_')) {
    titania::$cache->purge();
    titania::error_box('SUCCESS', phpbb::$user->lang['CACHE_PURGED']);
}
// admin requested a sync
if (isset($_GET['sync']) && phpbb::$auth->acl_get('a_')) {
    $sync = new titania_sync();
    $method = explode('_', request_var('sync', ''), 2);
    if (method_exists($sync, $method[0])) {
        if (isset($method[1])) {
            $id = request_var('id', 0);
            $sync->{$method}[0]($method[1], $id);
        } else {
            $sync->{$method}[0]();
        }
        titania::error_box('SUCCESS', 'Sync Success');
    }
}
开发者ID:Noxwizard,项目名称:customisation-db,代码行数:31,代码来源:common.php


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