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


PHP lang::t方法代码示例

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


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

示例1: lang

 function try_login()
 {
     $this->user = $this->facebook->getUser();
     //defaultni vypis problemu s prihlasenim
     $l = new lang("layout");
     $msg = new msg();
     if ($this->user == null) {
         $msg->set_text($l->t("bad_fb_login"), "error");
         redirect($l->l("prihlaseni"));
     }
     //nyni mame udaje o uzivateli
     //pokusime se zjistit, zda-li jiz v databazi nekdo takovy je (fb_id)
     $sql = sql_query("select id, nick from users\n\t\t\t\t\t\t\t\t\t\t\t\t\twhere (fb_id = '" . $this->user . "')");
     $data = sql_fetch_object($sql);
     //jiz v databzi existuje
     if ($data->id) {
         $_SESSION['uid'] = $data->id;
         $_SESSION['me'] = new me($data->id);
         $_SESSION['me']->homepage_redirect();
     } else {
         $new_login = $this->create_login();
         if ($new_login) {
             $_SESSION['uid'] = $new_login[0];
             $_SESSION['me'] = new me($new_login[0]);
             //prvotni presun po registraci na nastaveni a doplneni udaju
             header("location: " . $l->l("osobni-udaje") . "?first=true");
             return true;
         }
     }
     $msg->set_text($l->t("bad_fb_login"), "error");
     redirect($l->l("prihlaseni"));
 }
开发者ID:janda2,项目名称:Fitness-shop,代码行数:32,代码来源:my_facebook.php

示例2: lang

 function try_login()
 {
     //defaultni vypis problemu s prihlasenim
     $l = new lang("layout");
     $msg = new msg();
     //pokud nam google vrati code, muzeme se autentifikovat a ziksat token
     $code = clear("code");
     if ($code) {
         $this->client->authenticate();
         $this->token = $this->client->getAccessToken();
     }
     /*
     				//kdybychom chteli na nejake jine strance zase s uctem u googlu pracovat
     				// musimve vytvorit to spojeni a pomoci se token ze session se autorizovat u googlu
     				//ale mi tady session token nulujeme, takze uz se dal pouzit neda
     						if ($_SESSION['token']) {
     						  $this->client->setAccessToken($_SESSION['token']);
     						}
     				//kdyz ho chceme ziskat
     							  $_SESSION['token'] = $this->client->getAccessToken();
     */
     if ($this->token) {
         $my_data = $this->plus->people->get('me');
         $gp_id = $my_data['id'];
         //nyni mame udaje o uzivateli
         //pokusime se zjistit, zda-li jiz v databazi nekdo takovy je (gp_id)
         $sql = sql_query("select id, nick from users\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere (gp_id = '" . $gp_id . "')");
         $data = sql_fetch_object($sql);
         //jiz v databazi existuje
         if ($data->id) {
             $_SESSION['uid'] = $data->id;
             $_SESSION['me'] = new me($data->id);
             $_SESSION['me']->homepage_redirect();
         } else {
             $new_login = $this->create_login($my_data);
             if ($new_login) {
                 $_SESSION['uid'] = $new_login[0];
                 $_SESSION['me'] = new me($new_login[0]);
                 //prvotni presun po registraci na nastaveni a doplneni udaju
                 header("location: " . $l->l("osobni-udaje") . "?first=true");
                 return true;
             }
         }
     }
     $msg->set_text($l->t("bad_gplus_login"), "error");
     redirect($l->l("prihlaseni"));
 }
开发者ID:janda2,项目名称:Fitness-shop,代码行数:47,代码来源:my_gplus.php

示例3: create

 static function create($order_id, $lang)
 {
     $sql = sql_query("select * from orders\n\t\t\t\t\t\t\t\t\t\t\t\t\twhere (id = '" . $order_id . "')");
     $data = sql_fetch_object($sql);
     if (!$data->id) {
         return 0;
     }
     $l = new lang("invoice", $lang);
     //zjistime radu a cislo faktury
     //rady mame pro CR - czk ; CR - eur ; SK - eur
     //prefix mame ulozeny v configu
     //cislo nacteme podle nejvyssiho cisla predchozi faktury
     $prefix = get_shop_config("invoice_prefix_" . $data->i_country . "_" . $data->cur);
     $s_n = sql_query("select number from invoices\n\t\t\t\t\t\t\t\t\t\t\t\t\twhere (number_prefix = '" . $prefix . "')\n\t\t\t\t\t\t\t\t\t\t\t\t\torder by id desc\n\t\t\t\t\t\t\t\t\t\t\t\t\tlimit 1");
     $d_n = sql_fetch_object($s_n);
     $number = $d_n->number + 1;
     //format na 5 cifer
     $number = sprintf("%05d", $number);
     $cur_value = get_shop_config("cur_" . $data->cur . "_value");
     //vytvorime fakturu -------------
     $country = $l->t("country_" . $data->i_country);
     $s = sql_query("insert into invoices\n\t\t\t\t\t\t\t\t\t\t\t\t(order_id, user, create_date, number, number_prefix, c_name, c_street,\n\t\t\t\t\t\t\t\t\t\t\t\tc_city, c_zip, c_country, invoice_country, price, cur, cur_value, pay_method,\n\t\t\t\t\t\t\t\t\t\t\t\tcompany_name, company_ic, company_dic)\n\t\t\t\t\t\t\t\t\t\t\t\tvalues\n\t\t\t\t\t\t\t\t\t\t\t\t('" . $data->id . "', '" . $data->user . "', '" . time() . "',\n\t\t\t\t\t\t\t\t\t\t\t\t'" . $number . "', '" . $prefix . "', '" . $data->i_name . "', '" . $data->i_street . "',\n\t\t\t\t\t\t\t\t\t\t\t\t'" . $data->i_city . "', '" . $data->i_zip . "', '" . $country . "',\n\t\t\t\t\t\t\t\t\t\t\t\t'" . $data->i_country . "', '" . $data->price . "', '" . $data->cur . "', '" . $cur_value . "',\n\t\t\t\t\t\t\t\t\t\t\t\t'" . $data->pay_method . "', '" . $data->company_name . "', '" . $data->company_ic . "',\n\t\t\t\t\t\t\t\t\t\t\t\t'" . $data->company_dic . "')");
     if ($s) {
         $id = mysql_insert_id();
         //ulozime jednotlive polozky faktury
         $s = sql_query("select merchant, item, quantity, price_per_one, tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfrom orders_items\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere (order_id = '" . $order_id . "')");
         while ($d = sql_fetch_object($s)) {
             if ($d->merchant == 'audiolx') {
                 $s_p = sql_query("select name from merchant_audiolibrix\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere (id = '" . $d->item . "')");
             }
             if ($d->merchant == 'self') {
                 $s_p = sql_query("select name from selfpublishing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere (id = '" . $d->item . "')");
             }
             $d_p = sql_fetch_object($s_p);
             $s_i = sql_query("insert into invoices_items\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(invoice_id, name, quantity, price_per_one, tax)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalues\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t('" . $id . "', '" . $d_p->name . "', '" . $d->quantity . "', '" . $d->price_per_one . "', '" . $d->tax . "')");
         }
         if ($s_i) {
             return $id;
         }
     }
     return 0;
 }
开发者ID:janda2,项目名称:Fitness-shop,代码行数:42,代码来源:class_invoice.php

示例4: registration

 static function registration($type, $in_order = false)
 {
     $nick = clear("nick");
     $pass = clear("pass");
     $mail = clear("mail");
     $lang = clear("lang");
     $ver = clear("ver");
     $city = clear("city");
     $is_newsletter = checkbox_value(clear("is_newsletter"));
     $l = new lang("registration", $_SESSION["my_lang_ui"]);
     $msg = $_SESSION["msg"];
     if (strlen($pass) < 5) {
         $msg->set_text($l->t("pass_short"), "error");
         $msg->set_specific_text($l->t("pass_short"), "pass", "error");
     }
     //prilis dlouhy nick
     if (strlen($nick) > 21) {
         $msg->set_specific_text($l->t("nick_long"), "nick", "error");
     }
     //verifikace proti robotum
     if (!lang::is_lang_supported(lang::strict_lang_by_user_agent())) {
         if ($ver != 4) {
             $msg->set_text($l->t("invalid_ver"), "error");
         }
     }
     //zjisteni jeslti uz v db neni nekdo se stejnym nickem
     $sql = sql_query("select id from users\n\t\t\t\t\t\t\t\t\t\t\t\t\twhere (nick = '{$nick}')");
     $num = sql_num_rows($sql);
     if ($num) {
         $msg->set_specific_text($l->t("nick_exists"), "nick", "error");
     }
     //zjisteni jeslti uz v db neni nekdo se stejnym nickem mailem
     $sql = sql_query("select id from users\n\t\t\t\t\t\t\t\t\t\t\t\t\twhere (mail = '{$mail}')");
     $num = sql_num_rows($sql);
     if ($num) {
         $msg->set_specific_text($l->t("mail_exists") . " " . my_link($l->l("ztracene-heslo"), $l->t("lost_password")), "mail", "error");
     }
     if (!$nick || !$pass || !$mail) {
         $msg->set_text($l->t("empty_data"), "error");
     }
     $test_mail = preg_match('~^[_a-zA-Z0-9-]+(\\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*$~i', $mail);
     if (!$test_mail) {
         $msg->set_specific_text($l->t("invalid_email"), "mail", "error");
     }
     //pokud je vse v poradku
     if ($msg->is_empty()) {
         $sec_pass = $pass;
         $pass = md5(md5(md5(md5(md5($pass)))));
         $names = explode(" ", $nick);
         if (count($names) > 1) {
             $surname = $names[count($names) - 1];
         }
         if (!$lang) {
             $lang = $_SESSION["my_lang"];
         }
         $sql = sql_query("insert into users\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(nick, pass, mail, register_time, photo,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tshow_readed, booklists_style, virtual_surname, city, is_newsletter,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlang, lang_ui, registration_source)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalues\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t('{$nick}', '{$pass}', '{$mail}', '" . time() . "', 'no',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'yes', 'default', '" . $surname . "', '" . $city . "', '" . $is_newsletter . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'" . $lang . "', '" . $lang . "', '" . $type . "')");
         if ($sql) {
             $id = mysql_insert_id();
             //v pripade ze ma ulozeny trackovaci cookie, ulozime udaj
             $tracking = $_COOKIE["a_campaign"];
             if ($tracking) {
                 $s = sql_query("insert into registrations_sources\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(user, time, source)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalues\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t('" . $id . "', '" . time() . "', '" . $tracking . "')");
             }
             //ulozime pripadne nastavene zajmy
             $sql_i = sql_query("select name, interest_id from interests\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere (lang = '" . $_SESSION["my_lang"] . "')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\torder by name asc");
             $interests[] = array();
             while ($data_i = sql_fetch_object($sql_i)) {
                 $temp = clear("interest_" . $data_i->interest_id);
                 if (isset($interests[(string) $data_i->interest_id])) {
                     continue;
                 }
                 if ($temp) {
                     $interests[$data_i->interest_id] = 1;
                     $s = sql_query("insert into users_interests\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(user, interest)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalues\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t('" . $id . "', '" . $data_i->interest_id . "')");
                 }
             }
             //zaslani registracniho emailu
             $text = strip_tags($l->t("reg_mail_text", $nick, $sec_pass) . "\n" . $l->t("web_url"));
             $sent = mail($mail, $l->t("reg_subject"), $text, "From: info@cbdb.cz  \nContent-Type: text/plain; charset=utf-8");
             if ($sent) {
                 if (!$in_order) {
                     $msg->set_text($l->t("reg_ok") . "<br />");
                 } else {
                 }
                 //prihlasime usera -----------------------
                 $my_login = new my_login();
                 $my_login->log_in("ok", $nick, $sec_pass);
             }
         }
     }
 }
开发者ID:janda2,项目名称:Fitness-shop,代码行数:91,代码来源:class_user.php


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