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


PHP language::convert方法代码示例

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


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

示例1: processActivationLink

 private function processActivationLink()
 {
     global $userMethods;
     $sql = e107::getDb();
     $tp = e107::getParser();
     $ns = e107::getRender();
     $log = e107::getLog();
     $pref = e107::pref('core');
     $qs = explode('.', e_QUERY);
     if ($qs[0] == 'activate' && (count($qs) == 3 || count($qs) == 4) && $qs[2]) {
         // FIXME TODO use generic multilanguage selection => e107::coreLan();
         // return the message in the correct language.
         if (isset($qs[3]) && strlen($qs[3]) == 2) {
             require_once e_HANDLER . 'language_class.php';
             $slng = new language();
             $the_language = $slng->convert($qs[3]);
             if (is_readable(e_LANGUAGEDIR . $the_language . '/lan_' . e_PAGE)) {
                 include e_LANGUAGEDIR . $the_language . '/lan_' . e_PAGE;
             } else {
                 include_lan(e_LANGUAGEDIR . e_LANGUAGE . '/lan_' . e_PAGE);
             }
         } else {
             include_lan(e_LANGUAGEDIR . e_LANGUAGE . '/lan_' . e_PAGE);
         }
         e107::getCache()->clear("online_menu_totals");
         if ($sql->select("user", "*", "user_sess='" . $tp->toDB($qs[2], true) . "' ")) {
             if ($row = $sql->fetch()) {
                 $dbData = array();
                 $dbData['WHERE'] = " user_sess='" . $tp->toDB($qs[2], true) . "' ";
                 $dbData['data'] = array('user_ban' => '0', 'user_sess' => '');
                 // Set initial classes, and any which the user can opt to join
                 if ($init_class = $userMethods->userClassUpdate($row, 'userfull')) {
                     //print_a($init_class); exit;
                     $dbData['data']['user_class'] = $init_class;
                 }
                 $userMethods->addNonDefaulted($dbData);
                 validatorClass::addFieldTypes($userMethods->userVettingInfo, $dbData);
                 $newID = $sql->update('user', $dbData);
                 if ($newID === false) {
                     $log->e_log_event(10, debug_backtrace(), 'USER', 'Verification Fail', print_r($row, true), false, LOG_TO_ROLLING);
                     $ns->tablerender(LAN_SIGNUP_75, LAN_SIGNUP_101);
                     return false;
                 }
                 // Log to user audit log if enabled
                 $log->user_audit(USER_AUDIT_EMAILACK, $row);
                 e107::getEvent()->trigger('userveri', $row);
                 // Legacy event
                 e107::getEvent()->trigger('user_signup_activated', $row);
                 e107::getEvent()->trigger('userfull', $row);
                 // 'New' event
                 if (varset($pref['autologinpostsignup'])) {
                     require_once e_HANDLER . 'login.php';
                     $usr = new userlogin();
                     $usr->login($row['user_loginname'], md5($row['user_name'] . $row['user_password'] . $row['user_join']), 'signup', '');
                 }
                 $text = "<div class='alert alert-success'>" . LAN_SIGNUP_74 . " <a href='index.php'>" . LAN_SIGNUP_22 . "</a> " . LAN_SIGNUP_23 . "<br />" . LAN_SIGNUP_24 . " " . SITENAME . "</div>";
                 $ns->tablerender(LAN_SIGNUP_75, $text);
             }
         } else {
             // Invalid activation code
             $log->e_log_event(10, debug_backtrace(), 'USER', 'Invalid Verification URL', print_r($qs, true), false, LOG_TO_ROLLING);
             echo e107::getMessage()->addError("Invalid URL")->render();
             //	header("location: ".e_BASE."index.php");
             return false;
         }
     }
 }
开发者ID:gitye,项目名称:e107,代码行数:67,代码来源:signup.php

示例2: explode

    //$mes = e107::getMessage();
    //$mes->debug("You are currently logged in.");
    $SIGNUP_BEGIN = "<div class='s-message'>\n\t <div class='error'> You are currently logged in.\n\t </div></div>" . $SIGNUP_BEGIN;
}
//----------------------------------------
// After clicking the activation link
//----------------------------------------
if (e_QUERY) {
    $qs = explode('.', e_QUERY);
    if ($qs[0] == 'activate' && (count($qs) == 3 || count($qs) == 4) && $qs[2]) {
        //TODO use generic multilanguage selection
        // return the message in the correct language.
        if (isset($qs[3]) && strlen($qs[3]) == 2) {
            require_once e_HANDLER . 'language_class.php';
            $slng = new language();
            $the_language = $slng->convert($qs[3]);
            if (is_readable(e_LANGUAGEDIR . $the_language . '/lan_' . e_PAGE)) {
                include e_LANGUAGEDIR . $the_language . '/lan_' . e_PAGE;
            } else {
                include_lan(e_LANGUAGEDIR . e_LANGUAGE . '/lan_' . e_PAGE);
            }
        } else {
            include_lan(e_LANGUAGEDIR . e_LANGUAGE . '/lan_' . e_PAGE);
        }
        $e107cache->clear("online_menu_totals");
        if ($sql->db_Select("user", "*", "user_sess='" . $tp->toDB($qs[2], true) . "' ")) {
            if ($row = $sql->db_Fetch()) {
                $dbData = array();
                $dbData['WHERE'] = " user_sess='" . $tp->toDB($qs[2], true) . "' ";
                $dbData['data'] = array('user_ban' => '0', 'user_sess' => '');
                // Set initial classes, and any which the user can opt to join
开发者ID:notzen,项目名称:e107,代码行数:31,代码来源:signup.php


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