本文整理汇总了PHP中get_current_lang函数的典型用法代码示例。如果您正苦于以下问题:PHP get_current_lang函数的具体用法?PHP get_current_lang怎么用?PHP get_current_lang使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_current_lang函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: tool_private_is_private_post
function tool_private_is_private_post($post_id)
{
$go_private = get_option(TOOL_PRIVATE_OPTIONS_GO_PRIVATE);
if ($go_private && $go_private == "1") {
return true;
} else {
if ($go_private && $go_private == "2") {
$private_items = get_option(TOOL_PRIVATE_OPTIONS_ITEMS . "-" . get_current_lang());
if (!empty($private_items)) {
$parent_ids = get_post_ancestors($post_id);
$private_items = explode(",", $private_items);
if (in_array($post_id, $private_items)) {
return true;
} else {
foreach ($parent_ids as $parent_id) {
if (in_array($parent_id, $private_items)) {
return true;
}
}
}
}
}
}
return false;
}
开发者ID:studio-montana,项目名称:custom,代码行数:25,代码来源:private.php
示例2: site_url
function site_url($uri = '', $lang = '')
{
$CI =& get_instance();
if ($lang == '') {
$lang = get_current_lang();
}
$final_url = $CI->config->site_url($lang . '/' . $uri);
$CI->load->config('business_directory');
if ($CI->config->item('use_ssl') == 'yes') {
$final_url = str_replace('http://', 'https://', $final_url);
}
#uncomment this line if you want to force
return $final_url;
}
开发者ID:GiovanniV,项目名称:Santa-Barbara-Business-Directory,代码行数:14,代码来源:MY_url_helper.php
示例3: get_instance
<?php
}
?>
}
</style>
<script type="text/javascript">var old_ie = 0;</script>
<!--[if lte IE 8]> <script type="text/javascript"> old_ie = 1; </script> < ![endif]-->
</head>
<?php
$CI = get_instance();
$curr_lang = get_current_lang();
if ($curr_lang == 'ar' || $curr_lang == 'fa' || $curr_lang == 'he' || $curr_lang == 'ur') {
?>
<link rel="stylesheet" href="<?php
echo theme_url();
?>
/assets/css/rtl-fix.css">
<body class="home" dir="rtl">
<?php
} else {
?>
<body class="home" dir="<?php
echo get_settings('site_settings', 'site_direction', 'ltr');
?>
">
<?php
开发者ID:Ripudamangithub,项目名称:donopen,代码行数:31,代码来源:template_view.php
示例4: explode
* $Date: 2009-12-14 17:22:19 +0800 (周一, 2009-12-14) $
* $Id: index.php 16882 2009-12-14 09:22:19Z liubo $
*/
require_once './includes/init.php';
/* 初始化EC的字符集与语言变量*/
$updater_lang = $ec_charset = '';
if (!empty($_POST['lang'])) {
$lang_charset = explode('_', $_POST['lang']);
$updater_lang = $lang_charset[0] . '_' . $lang_charset[1];
$ec_charset = $lang_charset[2];
}
if (empty($updater_lang)) {
if (defined('EC_LANGUAGE')) {
$updater_lang = EC_LANGUAGE;
} else {
$updater_lang = get_current_lang();
if ($updater_lang === false) {
die('Please set system\'s language!');
}
}
}
if (empty($ec_charset)) {
if (isset($_COOKIE['ECCC'])) {
$ec_charset = $_COOKIE['ECCC'];
} elseif (defined('EC_CHARSET')) {
$ec_charset = EC_CHARSET;
} elseif (get_current_version() < 'v2.6.0') {
$ec_charset = 'utf-8';
} else {
$ec_charset = 'utf-8';
}
开发者ID:dw250100785,项目名称:ECShop-1,代码行数:31,代码来源:index.php
示例5: render_widgets
function render_widgets($position = '')
{
$CI = get_instance();
$CI->load->helper('inflector');
$CI->load->helper('file');
$widgets = get_widgets_by_position($position);
if (!empty($widgets)) {
foreach ($widgets as $row) {
$query = $CI->db->get_where('widgets', array('alias' => $row));
if ($query->num_rows() > 0) {
$row = $query->row();
if ($row->status == 1) {
$curr_lang = get_current_lang();
if (read_file('./application/modules/widgets/' . $curr_lang . '_' . $row->alias . '.php') != FALSE) {
require './application/modules/widgets/' . $curr_lang . '_' . $row->alias . '.php';
} else {
if (read_file('./application/modules/widgets/' . $row->alias . '.php') != FALSE) {
require './application/modules/widgets/' . $row->alias . '.php';
}
}
} else {
if ($row->status == 0) {
echo '';
} else {
echo '';
}
}
} else {
echo '';
}
}
}
}
开发者ID:priyranjansingh,项目名称:classified,代码行数:33,代码来源:dbcbase_helper.php
示例6: social_sharing_meta_tags_for_post
function social_sharing_meta_tags_for_post($post = '')
{
if ($post != '' && $post->num_rows() > 0) {
$CI = get_instance();
$post = $post->row();
$curr_lang = get_current_lang();
$site_title = get_settings('site_settings', 'site_title', 'Memento');
$title = get_post_data_by_lang($post, 'title');
$detail_link = site_url('ads/' . $post->unique_id . '/' . dbc_url_title($title));
$meta = '<meta name="twitter:card" content="photo" />' . "\n" . '<meta name="twitter:site" content="' . $site_title . '" />' . "\n" . '<meta name="twitter:image" content="' . get_featured_photo_by_id($post->featured_img) . '" />' . "\n" . '<meta property="og:title" content="' . $title . '" />' . "\n" . '<meta property="og:site_name" content="' . $site_title . '" />' . "\n" . '<meta property="og:url" content="' . $detail_link . '" />' . "\n" . '<meta property="og:description" content="Click to view detail..." />' . "\n" . '<meta property="og:type" content="article" />' . "\n" . '<meta property="og:image" content="' . get_featured_photo_by_id($post->featured_img) . '" />' . '<meta property="fb:app_id" content="' . get_settings('memento_settings', 'fb_app_id', 'none') . '" />';
return $meta;
} else {
return '';
}
}
开发者ID:GiovanniV,项目名称:Santa-Barbara-Business-Directory,代码行数:15,代码来源:dbcbusiness_helper.php
示例7: rss
public function rss()
{
$this->load->helper('xml');
$curr_lang = get_current_lang();
if ($curr_lang == '') {
$curr_lang = default_lang();
}
$value = array();
$value['curr_lang'] = $curr_lang;
$value['feed_name'] = translate(get_settings('site_settings', 'site_title', 'Santa Barbara'));
$value['encoding'] = 'utf-8';
$value['feed_url'] = site_url('show/rss');
$value['page_description'] = lang_key('your web description');
$value['page_language'] = $curr_lang . '-' . $curr_lang;
$value['creator_email'] = get_settings('webadmin_email', 'contact_email', '');
$value['posts'] = $this->show_model->get_properties_by_range(0, $this->PER_PAGE, 'id', 'desc');
# header("Content-Type: application/rss+xml");
load_view('rss_view', $value, FALSE, $this->active_theme);
}
开发者ID:GiovanniV,项目名称:Santa-Barbara-Business-Directory,代码行数:19,代码来源:show_core.php
示例8: savesitesettings
public function savesitesettings($key = 'site_settings')
{
$this->load->model('options_model');
foreach ($_POST as $k => $value) {
if ($k != 'ga_tracking_code') {
$this->form_validation->set_rules($k, $k, 'required');
}
}
if ($this->form_validation->run() == FALSE) {
$this->sitesettings($key, 'error');
} else {
if (constant("ENVIRONMENT") == 'demo') {
$this->session->set_flashdata('msg', '<div class="alert alert-success">Data updated.[NOT AVAILABLE ON DEMO]</div>');
} else {
$data['values'] = json_encode($_POST);
$res = $this->options_model->getvalues($key);
if ($res == '') {
$data['key'] = $key;
$this->options_model->addvalues($data);
} else {
$this->options_model->updatevalues($key, $data);
}
$this->session->set_flashdata('msg', '<div class="alert alert-success">' . lang_key('data_updated') . '</div>');
}
$current_lang = get_current_lang();
$url = site_url('admin/system/sitesettings/' . $key);
$url = str_replace('/' . $current_lang . '/', '/' . default_lang() . '/', $url);
redirect($url);
}
}
开发者ID:Ripudamangithub,项目名称:donopen,代码行数:30,代码来源:system_core.php
示例9: tool_private_settings_save
/**
* save settings
*/
function tool_private_settings_save()
{
if (!current_user_can('administrator')) {
return;
}
if (!isset($_POST[TOOL_PRIVATE_OPTIONS_NONCE_ACTION]) || !wp_verify_nonce($_POST[TOOL_PRIVATE_OPTIONS_NONCE_ACTION], TOOL_PRIVATE_OPTIONS_NONCE_ACTION)) {
return;
}
// TOOL_PRIVATE_OPTIONS_GO_PRIVATE
if (isset($_POST[TOOL_PRIVATE_OPTIONS_GO_PRIVATE]) && !empty($_POST[TOOL_PRIVATE_OPTIONS_GO_PRIVATE])) {
if (!get_option(TOOL_PRIVATE_OPTIONS_GO_PRIVATE)) {
add_option(TOOL_PRIVATE_OPTIONS_GO_PRIVATE, sanitize_text_field($_POST[TOOL_PRIVATE_OPTIONS_GO_PRIVATE]));
} else {
update_option(TOOL_PRIVATE_OPTIONS_GO_PRIVATE, sanitize_text_field($_POST[TOOL_PRIVATE_OPTIONS_GO_PRIVATE]));
}
} else {
delete_option(TOOL_PRIVATE_OPTIONS_GO_PRIVATE);
}
// TOOL_PRIVATE_OPTIONS_ITEMS
$key = TOOL_PRIVATE_OPTIONS_ITEMS . "-" . get_current_lang();
$items = "";
foreach ($_POST as $k => $v) {
if (startsWith($k, "tool-private-item-")) {
if ($v = "on") {
$id = str_replace("tool-private-item-", "", $k);
if (!empty($items)) {
$items .= ",";
}
$items .= $id;
}
}
}
if (!empty($items)) {
if (!get_option($key)) {
add_option($key, $items);
} else {
update_option($key, $items);
}
} else {
delete_option($key);
}
// TOOL_PRIVATE_OPTIONS_MESSAGE
$key = TOOL_PRIVATE_OPTIONS_MESSAGE . "-" . get_current_lang();
if (isset($_POST[$key]) && !empty($_POST[$key])) {
if (!get_option($key)) {
add_option($key, sanitize_text_field($_POST[$key]));
} else {
update_option($key, sanitize_text_field($_POST[$key]));
}
} else {
delete_option($key);
}
}
开发者ID:studio-montana,项目名称:custom,代码行数:56,代码来源:options.php
示例10: get_option
?>
</div>
</div><!-- .site-branding -->
</div>
</header><!-- .site-header -->
<div class="main site-main">
<div class="site-main-container">
<div id="primary" class="content-area tool-private">
<div id="content" class="site-content" role="main">
<?php
$private_message = get_option(TOOL_PRIVATE_OPTIONS_MESSAGE . "-" . get_current_lang(), "");
if (!empty($private_message)) {
?>
<h2><?php
echo $private_message;
?>
</h2>
<?php
}
?>
<div class="button-wrapper">
<a href="<?php
echo wp_login_url(get_current_url(true));
?>
" class="button"><?php
_e("sign in", CUSTOM_PLUGIN_TEXT_DOMAIN);
开发者ID:studio-montana,项目名称:custom,代码行数:31,代码来源:tool-private-template.php
示例11: get_current_lang
echo TOOL_PRIVATE_OPTIONS_MESSAGE . "-" . get_current_lang();
?>
"><?php
_e("Message", CUSTOM_PLUGIN_TEXT_DOMAIN);
?>
: </label>
</th>
<td valign="middle">
<?php
$meta = get_option(TOOL_PRIVATE_OPTIONS_MESSAGE . "-" . get_current_lang(), "");
?>
<input type="text" id="<?php
echo TOOL_PRIVATE_OPTIONS_MESSAGE . "-" . get_current_lang();
?>
" name="<?php
echo TOOL_PRIVATE_OPTIONS_MESSAGE . "-" . get_current_lang();
?>
" value="<?php
echo esc_attr($meta);
?>
" size="40" placeholder="<?php
_e("Private area");
?>
..." />
</td>
<td valign="middle"></td>
</tr>
<tr valign="top" class="private-options private-options-2">
<th class="metabox_label_column" align="left" valign="middle"></th>
<td valign="middle">
<?php
开发者ID:studio-montana,项目名称:custom,代码行数:31,代码来源:options-fields.php
注:本文中的get_current_lang函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论