本文整理汇总了PHP中P_Lang函数的典型用法代码示例。如果您正苦于以下问题:PHP P_Lang函数的具体用法?PHP P_Lang怎么用?PHP P_Lang使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了P_Lang函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: notice_f
public function notice_f()
{
$id = $this->get('id', 'int');
if (!$id) {
error(P_Lang("无法获取订单信息"), $this->url, 'error');
}
$rs = $this->model('order')->get_one($id);
if (!$rs) {
error(P_Lang('订单信息为空'), $this->url, 'error');
}
$burl = $this->url("order", 'info', 'id=' . $rs['id']);
if (!$_SESSION['user_id']) {
$burl = $this->url("order", "info", "sn=" . $rs['sn'] . "&passwd=" . $rs['passwd']);
}
$burl = $this->config['www_file'] . substr($burl, strlen($this->config['api_file']));
if ($rs['pay_end']) {
error(P_Lang('您的订单付款成功,请稍候,系统将引导您查看订单信息'), $burl, 'ok');
}
$payment_rs = $this->model('payment')->get_one($rs['pay_id']);
if (!$payment_rs) {
error(P_Lang('付款方案不存在'), $this->url, 'error');
}
$file = $this->dir_root . 'payment/' . $payment_rs['code'] . '/notice.php';
if (!is_file($file)) {
error(P_Lang('支付接口异常,请检查'), $this->url, 'error');
}
include_once $file;
$name = $payment_rs['code'] . '_notice';
$cls = new $name($rs, $payment_rs);
$cls->submit();
error(P_Lang('您的订单付款成功,请稍候,系统将引导您查看订单信息'), $burl, 'ok');
}
示例2: index_f
public function index_f()
{
$email = $this->get('email');
if (!$email) {
$this->json(P_Lang('Email不能为空'));
}
$title = $this->get('title');
$content = $this->get('content', 'html');
if (!$content) {
$this->json(P_Lang('邮件内容不能为空'));
}
if (!$title) {
$title = phpok_cut($content, 50, '…');
}
if (!$this->site['email_server'] || !$this->site['email_account'] || !$this->site['email_pass'] || !$this->site['email']) {
$this->json(P_Lang('SMTP未配置好'));
}
$list = explode(',', $email);
foreach ($list as $key => $value) {
$value = trim($value);
if ($value && phpok_check_email($value)) {
$value_name = str_replace(strstr($value, '@'), '', $value);
$info = $this->lib('email')->send_mail($value, $title, $content, $value_name);
if (!$info) {
$this->json($this->lib('email')->error());
}
}
}
$this->json(true);
}
示例3: config_f
public function config_f()
{
$id = $this->get("id");
if (!$id) {
exit(P_Lang('未指定ID'));
}
$eid = $this->get("eid", "int");
$etype = $this->get("etype");
if (!$etype) {
$etype = "ext";
}
if ($eid) {
if ($etype == "fields") {
$rs = $this->model('fields')->get_one($eid);
} elseif ($etype == "module") {
$rs = $this->model('module')->field_one($eid);
} elseif ($etype == "user") {
$rs = $this->model('user')->field_one($eid);
} else {
$rs = $this->model('ext')->get_one($eid);
}
if ($rs["ext"]) {
$ext = unserialize($rs["ext"]);
foreach ($ext as $key => $value) {
$rs[$key] = $value;
}
}
$this->assign("rs", $rs);
}
$this->lib('form')->config($id);
}
示例4: debug_time
function debug_time($memory_ctrl = 1, $sql_ctrl = 1, $file_ctrl = 0, $cache_ctrl = 0)
{
$time = run_time(true);
$memory = run_memory(true);
$sql_db_count = $GLOBALS['app']->db->sql_count();
$sql_db_time = $GLOBALS['app']->db->sql_time();
$sql_cache_count = $GLOBALS['app']->cache->count();
$sql_cache_time = $GLOBALS['app']->cache->time();
$string = P_Lang('运行{seconds_total}秒', array('seconds_total' => $time));
//$string = "运行 ".$time." 秒";
if ($memory_ctrl && $memory_ctrl != 'false') {
$string .= P_Lang(',内存使用{memory_total}', array('memory_total' => $memory));
}
if ($sql_ctrl && $sql_ctrl != 'false') {
$string .= P_Lang(',数据库执行{sql_count}次,耗时{sql_time}秒', array('sql_count' => $sql_db_count, 'sql_time' => $sql_db_time));
//$string .= ",数据库执行 ".$sql_db_count." 次,耗时 ".$sql_db_time." 秒";
}
if ($file_ctrl && $count > 0 && $file_ctrl != 'false') {
$string .= P_Lang(',文件执行{file_count}次', array('file_count' => $count));
}
if ($cache_ctrl && $cache_ctrl != 'false') {
$string .= P_Lang(',缓存执行{cache_count}次,耗时{cache_time}秒', array('cache_count' => $sql_cache_count, 'cache_time' => $sql_cache_time));
}
$db_debug = $GLOBALS['app']->db->debug();
if ($db_debug && is_string($db_debug)) {
$string .= $db_debug;
}
$cache_debug = $GLOBALS['app']->cache->debug();
if ($cache_debug) {
$string .= $cache_debug;
}
return $string;
}
示例5: phpok_format
public function phpok_format($rs, $appid = "admin")
{
if (!$rs["optlist_id"]) {
return P_Lang('未指定选项组');
}
$idlist = $rs["optlist_id"];
if (!$idlist || !is_array($idlist)) {
return P_Lang('未指定项目,请配置');
}
$project_id = implode(",", $idlist);
$project_list = $this->model("project")->title_list($project_id);
if ($project_list) {
$open_title = implode(" / ", $project_list) . " - 主题列表";
} else {
$open_title = "主题资源";
}
$condition = " l.project_id IN(" . $project_id . ") ";
$total = $this->model("list")->get_all_total($condition);
if ($rs["is_multiple"]) {
$content = $rs["content"] ? explode(",", $rs["content"]) : array();
$rs["content"] = $content;
}
$this->assign("_project_id_btn", $project_id);
$this->assign("_rs", $rs);
$this->assign("_open_title", $open_title);
return $this->fetch($this->dir_phpok . 'form/html/title_admin_tpl.html', 'abs-file');
}
示例6: exec_f
public function exec_f()
{
$id = $this->get('id', 'system');
if (!$id) {
error(P_Lang('未指定ID'), '', 'error');
}
$rs = $this->model('plugin')->get_one($id);
if (!$rs || !$rs['status']) {
error('插件不存在或未启用');
}
if (!file_exists($this->dir_root . 'plugins/' . $id . '/' . $this->app_id . '.php')) {
error(P_Lang('插件应用{appid}.php不存在', array('appid' => $this->app_id)), '', 'error');
}
include_once $this->dir_root . 'plugins/' . $id . '/' . $this->app_id . '.php';
$name = $this->app_id . '_' . $id;
$cls = new $name();
$mlist = get_class_methods($cls);
$exec = $this->get('exec', 'system');
if (!$exec) {
$exec = 'index';
}
if (!$mlist || !in_array($exec, $mlist)) {
error(P_Lang('插件方法{method}不存在', array('method' => $exec)));
}
$cls->{$exec}();
}
示例7: load_search
private function load_search($keywords)
{
if (!$keywords) {
return false;
}
//取得符合搜索的项目
$condition = "status=1 AND hidden=0 AND is_search !=0 AND module>0";
$list = $this->model('project')->project_all($this->site['id'], 'id', $condition);
if (!$list) {
error(P_Lang('您的网站没有允许可以搜索的信息'), $this->url, "error", 10);
}
$pids = $mids = array();
foreach ($list as $key => $value) {
$pids[] = $value["id"];
$mids[] = $value['module'];
}
$mids = array_unique($mids);
$condition = "l.project_id IN(" . implode(",", $pids) . ") AND l.module_id IN(" . implode(",", $mids) . ") ";
$klist = explode(" ", $keywords);
$kc = array();
$kwlist = array();
foreach ($klist as $key => $value) {
$kwlist[] = '<i>' . $value . '</i>';
$kc[] = " l.seo_title LIKE '%" . $value . "%'";
$kc[] = " l.seo_keywords LIKE '%" . $value . "%'";
$kc[] = " l.seo_desc LIKE '%" . $value . "%'";
$kc[] = " l.title LIKE '%" . $value . "%'";
$kc[] = " l.tag LIKE '%" . $value . "%'";
}
$condition .= "AND (" . implode(" OR ", $kc) . ") ";
$total = $this->model('search')->get_total($condition);
$pageid = $this->get($this->config['pageid'], 'int');
if (!$pageid) {
$pageid = 1;
}
$psize = $this->config['psize'] ? $this->config['psize'] : 30;
$offset = ($pageid - 1) * $psize;
$idlist = $this->model('search')->id_list($condition, $offset, $psize);
if ($idlist) {
$rslist = array();
foreach ($idlist as $key => $value) {
$info = $this->call->phpok('_arc', array('title_id' => $value['id'], 'site' => $this->site['id']));
if ($info) {
$info['_title'] = str_replace($klist, $kwlist, $info['title']);
$rslist[] = $info;
}
}
$this->assign("rslist", $rslist);
}
$pageurl = $this->url('search', '', 'keywords=' . rawurlencode($keywords));
$this->assign("pageurl", $pageurl);
$this->assign("total", $total);
$this->assign("pageid", $pageid);
$this->assign("psize", $psize);
$this->assign("keywords", $keywords);
$this->view("search_list");
exit;
}
示例8: editor_f
public function editor_f()
{
$id = $this->get('id', 'int');
if (!$id) {
$this->json(P_Lang('未指定ID'));
}
$this->model('gd')->update_editor($id);
$this->json(true);
}
示例9: delete_f
public function delete_f()
{
$id = $this->get('id', 'int');
if (!$id) {
$this->json(P_Lang('未指定ID'));
}
$this->model('tag')->delete($id);
$this->json(true);
}
示例10: index_f
function index_f()
{
$admin_name = $_SESSION["admin_account"];
foreach ($_SESSION as $key => $value) {
if (substr($key, 0, 5) == 'admin' && $key != 'admin_lang_id') {
unset($_SESSION[$key]);
}
}
error(P_Lang('管理员{admin_name}成功退出', array('admin_name' => '<span class="red">' . $admin_name . '</span>')), $this->url('login'), 'ok');
}
示例11: submit
public function submit()
{
$paypal = new paypal_payment($this->param['param']["payid"], $this->param['param']["at"]);
$paypal->set_value("action_url", $this->param['param']["action"]);
$price = $GLOBALS['app']->get('mc_gross');
$sn = $GLOBALS['app']->get('invoice');
$checkcode = $GLOBALS['app']->get('custom');
if (!$checkcode) {
phpok_log(P_Lang('异步传输:没有自定义验证串'));
exit('error');
}
if (!$price || !$sn) {
phpok_log(P_Lang('数据异步'));
exit('error');
}
$chk = $paypal->check($price, $sn, $checkcode);
if (!$chk) {
phpok_log(P_Lang('异步传输:验证不能过'));
exit('error');
}
$payment_status = $GLOBALS['app']->get('payment_status');
if ($payment_status != 'Completed') {
phpok_log(P_Lang('异步传输:支付状态是' . $payment_status));
exit('error');
}
$pay_date = $GLOBALS['app']->get('payment_date');
if ($pay_date) {
$pay_date = strtotime($pay_date);
if (!$pay_date) {
$pay_date = $GLOBALS['app']->time;
}
} else {
$pay_date = $GLOBALS['app']->time;
}
$price = $GLOBALS['app']->get('mc_gross');
$array = array('pay_status' => "付款完成", 'pay_date' => $pay_date, 'pay_price' => $price, 'pay_end' => 1);
$array['status'] = '付款完成';
$exchange_rate = $GLOBALS['app']->get('exchange_rate');
if ($exchange_rate) {
$array['pay_currency_rate'] = $exchange_rate;
}
$p_array = array();
$p_array['txn_id'] = $GLOBALS['app']->get('txn_id');
$p_array['txn_type'] = $GLOBALS['app']->get('txn_type');
$p_array['mc_fee'] = $GLOBALS['app']->get('mc_fee');
$p_array['mc_currency'] = $GLOBALS['app']->get('mc_currency');
$p_array['payer_email'] = $GLOBALS['app']->get('payer_email');
$p_array['first_name'] = $GLOBALS['app']->get('first_name');
$p_array['last_name'] = $GLOBALS['app']->get('last_name');
$p_array['payer_business_name'] = $GLOBALS['app']->get('payer_business_name');
$p_array['payer_status'] = $GLOBALS['app']->get('payer_status');
$array['ext'] = serialize($p_array);
$GLOBALS['app']->model('order')->save($array, $this->order['id']);
exit('SUCCESS');
}
示例12: submit
function submit()
{
if ($_SESSION['user_id']) {
$url = $GLOBALS['app']->url('order', 'info', 'id=' . $_GET['id']);
unset($_GET['id']);
} else {
$url = $GLOBALS['app']->url('order', 'info', 'sn=' . $_GET['sn'] . '&passwd=' . $_GET['passwd']);
unset($_GET['sn'], $_GET['passwd']);
}
$paypal = new paypal_payment($this->param['param']["payid"], $this->param['param']["at"]);
$paypal->set_value("action_url", $this->param['param']["action"]);
$price = $GLOBALS['app']->get('mc_gross');
$sn = $GLOBALS['app']->get('invoice');
$checkcode = $GLOBALS['app']->get('custom');
if (!$checkcode || !$price || !$sn) {
error(P_Lang('支付返回异常,请检查'), $url, 'notice');
}
$chk = $paypal->check($price, $sn, $checkcode);
if (!$chk) {
error(P_Lang('数据验证不通过,请检查'), $url, 'notice');
}
$ext = $this->order['ext'];
if ($ext && is_string($ext)) {
$ext = unserialize($this->order['ext']);
}
if ($ext && is_array($ext)) {
if ($ext['txn_id'] && $ext['txn_id'] == $GLOBALS['app']->get('txn_id')) {
error(P_Lang('订单支付成功'), $url, 'ok');
}
}
$payment_status = $GLOBALS['app']->get('payment_status');
if ($payment_status != 'Completed') {
error(P_Lang('支付不确定是否完成,请联系商家确认'), $url, 'notice');
}
$price = $GLOBALS['app']->get('mc_gross');
$array = array('pay_status' => "付款完成", 'pay_date' => $pay_date, 'pay_price' => $price, 'pay_end' => 1);
$array['status'] = '付款完成';
$exchange_rate = $GLOBALS['app']->get('exchange_rate');
if ($exchange_rate) {
$array['pay_currency_rate'] = $exchange_rate;
}
$p_array = array();
$p_array['txn_id'] = $GLOBALS['app']->get('txn_id');
$p_array['txn_type'] = $GLOBALS['app']->get('txn_type');
$p_array['mc_fee'] = $GLOBALS['app']->get('mc_fee');
$p_array['mc_currency'] = $GLOBALS['app']->get('mc_currency');
$p_array['payer_email'] = $GLOBALS['app']->get('payer_email');
$p_array['first_name'] = $GLOBALS['app']->get('first_name');
$p_array['last_name'] = $GLOBALS['app']->get('last_name');
$p_array['payer_business_name'] = $GLOBALS['app']->get('payer_business_name');
$p_array['payer_status'] = $GLOBALS['app']->get('payer_status');
$array['ext'] = serialize($p_array);
$GLOBALS['app']->model('order')->save($array, $this->order['id']);
return true;
}
示例13: checkout_f
public function checkout_f()
{
$rslist = $this->model('cart')->get_all($this->cart_id);
if (!$rslist) {
error(P_Lang('您的购物车里没有任何产品'), $this->url, "notice", 5);
}
//生成随机码,以确定客户通过正确途径下单
$_SESSION['order_spam'] = str_rand(10);
$totalprice = 0;
foreach ($rslist as $key => $value) {
$totalprice += price_format_val($value['price'] * $value['qty'], $value['currency_id'], $this->site['currency_id']);
}
$price = price_format($totalprice, $this->site['currency_id']);
$this->assign('price', $price);
$this->assign("rslist", $rslist);
$shipping = $billing = array();
if ($_SESSION['user_id']) {
$shipping_list = $this->model('address')->address_list($_SESSION['user_id'], 'shipping');
if ($shipping_list) {
foreach ($shipping_list as $key => $value) {
if ($value['is_default']) {
$shipping = $value;
}
}
if (!$shipping) {
reset($shipping_list);
$shipping = current($shipping_list);
}
}
if ($this->site['biz_billing']) {
$billing_list = $this->model('address')->address_list($_SESSION['user_id'], 'billing');
if ($billing_list) {
foreach ($billing_list as $key => $value) {
if ($value['is_default']) {
$billing = $value;
}
}
if (!$billing) {
reset($billing_list);
$billing = current($billing_list);
}
}
}
} else {
if ($_SESSION['address']['shipping']) {
$shipping = $_SESSION['address']['shipping'];
}
if ($_SESSION['address']['billing']) {
$billing = $_SESSION['address']['billing'];
}
}
$this->assign('shipping', $shipping);
$this->assign('billing', $billing);
$this->view("cart_checkout");
}
示例14: xml_f
public function xml_f()
{
$file = $this->get('file', "system");
if (!$file) {
$this->json(P_Lang('未指定XML文件'));
}
if (!file_exists($this->dir_root . 'data/xml/' . $file . '.xml')) {
$this->json(P_Lang('XML文件不存在'));
}
$info = $this->lib('xml')->read($this->dir_root . 'data/xml/' . $file . '.xml');
$this->json($info, true);
}
示例15: alias_f
public function alias_f()
{
$id = $this->get('id', 'int');
if (!$id) {
$this->json(P_Lang('未指定站点ID'));
}
$alias = $this->get('alias');
if (!$alias) {
$this->json(P_Lang('未指定别名'));
}
$this->model('site')->alias_save($alias, $id);
$this->json(true);
}