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


PHP JText::__方法代码示例

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


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

示例1: resend_password_action

 /**
  * Performs the resend user password action.
  *
  * @access	public
  * @since	3.0
  *
  */
 function resend_password_action()
 {
     global $_POST, $SANITIZER, $CONFIG;
     $str_error = '';
     // init
     if (isset($_POST["un"])) {
         $un = trim($_POST["un"]);
         $un = $SANITIZER->sanitize($un);
     } else {
         $un = "";
     }
     if (isset($_POST["email"])) {
         $email = trim($_POST["email"]);
         $email = $SANITIZER->sanitize($email);
     } else {
         $email = "";
     }
     /** Send email instructions about how to reset the password **/
     if (isset($_POST["cmd_resend_password"])) {
         if (trim($un) == "" || trim($email) == "") {
             $str_error .= JText::_('Required field cannot be left blank.') . '<BR />';
         }
         if (!ZEmail::check($email)) {
             $str_error .= JText::_('Email should look like an email address.') . '<BR />';
         }
         $email_address_owner_found = false;
         if (empty($str_error)) {
             $sql = "\n\t\t\t\t\t\t\t\tSELECT u.id, u.un, u.firstname, u.lastname\n\t\t\t\t\t\t\t\tFROM users AS u\n\t\t\t\t\t\t\t\tWHERE u.un = '{$un}'\n\t\t\t\t\t\t\t\tAND u.email = '{$email}'\n\t\t\t\t\t\t\t\tLIMIT 0, 1\n\t\t\t\t\t\t\t ";
             $result = mysql_query($sql);
             if ($result) {
                 $record_count = MySQL_NUM_ROWS($result);
                 if ($record_count == 1) {
                     $u_id = mysql_result($result, 0, "u.id");
                     // at least one user using the supplied email address was found
                     $u_username = mysql_result($result, 0, "u.un");
                     $u_firstname = mysql_result($result, 0, "u.firstname");
                     $u_lastname = mysql_result($result, 0, "u.lastname");
                     $u_fullname = $u_firstname . " " . $u_lastname;
                     $email_address_owner_found = true;
                 }
             }
             if ($email_address_owner_found) {
                 /** Send instructions here **/
                 /** Encrypt email address **/
                 $strongCipher = new Cipher_blowfish();
                 $strongCipher->setKey(@$CONFIG->secret);
                 $activation = $strongCipher->zf_encrypt(date("Y-m-d H:i:s") . "_" . $u_id);
                 /** Send email with password reset instructions **/
                 $name = JText::_('ZIME Service');
                 //senders name
                 $sender = "service@zime.lv";
                 //senders e-mail adress
                 $recipient = $email;
                 //recipient
                 $subject = JText::_('Reset your ZIME Password');
                 //subject
                 $mail_body = JText::__('email_pw_reset_instructions.txt');
                 $mail_body = str_replace("[USER]", $u_fullname . " ({$u_username})", $mail_body);
                 $mail_body = str_replace("[URL]", "{$CONFIG->basedir_rewrite}validate.php?option=reset&activation={$activation}", $mail_body);
                 $header = "From: " . $name . " <" . $sender . ">\r\n";
                 //optional headerfields
                 ini_set('sendmail_from', $sender);
                 //Suggested by "Some Guy"
                 mail($recipient, $subject, $mail_body, $header);
                 //mail command :)
             } else {
                 $str_error .= JText::_('Email address was not found.') . '<BR />';
             }
         }
     }
     return $str_error;
 }
开发者ID:BGCX261,项目名称:zime-space-hg-to-git,代码行数:79,代码来源:password.php

示例2: help_dialog

 /**
  * Shows the help topic.
  *
  * @access	private
  * @since	3.0
  *
  */
 function help_dialog()
 {
     /* */
     echo "<div class='' id='help-topic' style='display:block;'>";
     $content = JText::__('help_user_experience.htm');
     //$content = str_replace("[URL9]", "mailto:support@zime.lv", $content);
     echo "<table width='650'><tr><td>";
     echo $content;
     echo "</td></tr></table>";
     echo "</div>";
 }
开发者ID:BGCX261,项目名称:zime-space-hg-to-git,代码行数:18,代码来源:help.php

示例3: register_action

 /**
  * Performs a new user registration.
  *
  * @access	public
  * @since	3.0
  *
  */
 function register_action()
 {
     global $_POST, $CONFIG, $SANITIZER, $SecureSession;
     $str_error = '';
     // init
     if (isset($_POST["fullname"])) {
         $fullname = trim($SANITIZER->sanitize($_POST["fullname"]));
     } else {
         $fullname = "";
     }
     if (isset($_POST["un"])) {
         $un = trim($SANITIZER->sanitize($_POST["un"]));
     } else {
         $un = "";
     }
     /*
     if (isset($_POST["pw"])) {
     	$pw = trim($SANITIZER->sanitize($_POST["pw"]));
     } else {
     	$pw = "";
     }
     */
     if (isset($_POST["pw"])) {
         //$pw_hash = trim($SANITIZER->sanitize($_POST["pw_hash"]));
         $pw_hash = md5(trim($SANITIZER->sanitize($_POST["pw"])));
     } else {
         $pw_hash = "";
     }
     if (isset($_POST["email"])) {
         $email = trim($SANITIZER->sanitize($_POST["email"]));
     } else {
         $email = "";
     }
     $email_validation_required = true;
     /**
     Save new user's data
     */
     if (isset($_POST["cmd_register"])) {
         /** Check inputs**/
         //echo $pw_hash;
         if ($fullname == "" || $pw_hash == md5("")) {
             $str_error .= JText::_("Required field cannot be left blank.") . '<br />';
             //return $str_error;
         }
         /** Test integrity username **/
         $str_error .= ZRegister::test_integrity_username($un);
         /** Test integrity email **/
         $str_error .= ZRegister::test_integrity_email($email);
         /** Extract firstname, lastname from full name **/
         $fullname_array = ZRegister::extract_fullname_parts($fullname);
         $firstname = $fullname_array[0];
         $lastname = $fullname_array[1];
         if (empty($str_error)) {
             $sql = "\n\t\t\t\t\t\t\t\tINSERT INTO users (\n\t\t\t\t\t\t\t\t\tproj_fid\n\t\t\t\t\t\t\t\t\t, proj_item_id\n\t\t\t\t\t\t\t\t\t, un\n\t\t\t\t\t\t\t\t\t, pw\n\t\t\t\t\t\t\t\t\t, firstname\n\t\t\t\t\t\t\t\t\t, lastname\n\t\t\t\t\t\t\t\t\t, gender\n\t\t\t\t\t\t\t\t\t, email\n\t\t\t\t\t\t\t\t\t, birth_date\n\t\t\t\t\t\t\t\t\t, age_rule\n\t\t\t\t\t\t\t\t\t, country\n\t\t\t\t\t\t\t\t\t, language\n\t\t\t\t\t\t\t\t\t, timezone\n\t\t\t\t\t\t\t\t\t, newsletter\n\t\t\t\t\t\t\t\t\t, isconfirmed\n\t\t\t\t\t\t\t\t\t, created)\n\t\t\t\t\t\t\t\tVALUES (\n\t\t\t\t\t\t\t\t\t7\n\t\t\t\t\t\t\t\t\t, 1\n\t\t\t\t\t\t\t\t\t, '{$un}'\n\t\t\t\t\t\t\t\t\t, '{$pw_hash}'\n\t\t\t\t\t\t\t\t\t, '{$firstname}'\n\t\t\t\t\t\t\t\t\t, '{$lastname}'\n\t\t\t\t\t\t\t\t\t, 2\n\t\t\t\t\t\t\t\t\t, '{$email}'\n\t\t\t\t\t\t\t\t\t, '2100-01-01'\n\t\t\t\t\t\t\t\t\t, 0\n\t\t\t\t\t\t\t\t\t, ''\n\t\t\t\t\t\t\t\t\t, ''\n\t\t\t\t\t\t\t\t\t, 0\n\t\t\t\t\t\t\t\t\t, 0\n\t\t\t\t\t\t\t\t\t, 0\n\t\t\t\t\t\t\t\t\t, now()\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t ";
             //
             if ($_SERVER["REMOTE_ADDR"] == @$CONFIG->debug_ip) {
                 //echo $sql;
             }
             $result = mysql_query($sql);
             $new_user_id = mysql_insert_id();
             /* */
             if ($new_user_id && mysql_affected_rows() > 0) {
                 @setcookie("registered", 1, time() + 60 * 60 * 24 * 365, "/");
                 /* expire in 1 year */
                 /** Add default Josta (News-Josta) **/
                 //$str_error = ZCollection::add_josta($new_user_id, JText::_("Friends"), "", $str_error);
                 $str_error = ZCollection::add_josta($new_user_id, "Default Josta", "", $str_error);
                 //ZUser::add_user_to_josta($new_user_id);
             } else {
                 @session_destroy();
                 $str_error .= JText::_('Registration was not successful. Please try again.');
             }
         }
         /** Send email validation request **/
         if ($email_validation_required && empty($str_error)) {
             // Encrypt email address
             $strongCipher = new Cipher_blowfish();
             $strongCipher->setKey(@$CONFIG->secret);
             $activation = $strongCipher->zf_encrypt(date("Y-m-d H:i:s") . "_" . $new_user_id);
             // Send email with password reset instructions
             $name = JText::_('ZIME Service');
             //senders name
             $sender = "service@zime.lv";
             //senders e-mail adress
             $recipient = $email;
             //recipient
             $subject = ZString::replaceVars(JText::_('Welcome to ZIME'), $un);
             //subject
             $mail_body = JText::__('email_registration.txt');
             $mail_body = str_replace("[USER]", $fullname . " ({$un})", $mail_body);
             $mail_body = str_replace("[URL]", "{$CONFIG->basedir_rewrite}validate.php?option=register&activation={$activation}", $mail_body);
             $header = "From: " . $name . " <" . $sender . ">\r\n";
             //optional headerfields
//.........这里部分代码省略.........
开发者ID:BGCX261,项目名称:zime-space-hg-to-git,代码行数:101,代码来源:register.php


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