本文整理汇总了PHP中load_language函数的典型用法代码示例。如果您正苦于以下问题:PHP load_language函数的具体用法?PHP load_language怎么用?PHP load_language使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了load_language函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: on_index_thumbnails
static function on_index_thumbnails($thumbs)
{
global $page, $template;
$total = count($page['items']);
if (count($thumbs) >= $total) {
add_event_handler('loc_end_index', array('RVTS', 'on_end_index'));
return $thumbs;
}
$url_model = str_replace('123456789', '%start%', duplicate_index_url(array('start' => 123456789)));
$ajax_url_model = add_url_params($url_model, array('rvts' => '%per%'));
$url_model = str_replace('&', '&', $url_model);
$ajax_url_model = str_replace('&', '&', $ajax_url_model);
$my_base_name = basename(dirname(__FILE__));
$ajax_loader_image = get_root_url() . "plugins/{$my_base_name}/ajax-loader.gif";
$template->func_combine_script(array('id' => 'jquery', 'load' => 'footer', 'path' => 'themes/default/js/jquery.min.js'));
$template->func_combine_script(array('id' => $my_base_name, 'load' => 'async', 'path' => 'plugins/' . $my_base_name . '/rv_tscroller.min.js', 'require' => 'jquery', 'version' => RVTS_VERSION));
$start = (int) $page['start'];
$per_page = $page['nb_image_page'];
$moreMsg = 'See the remaining %d photos';
if ('en' != $GLOBALS['lang_info']['code']) {
load_language('lang', dirname(__FILE__) . '/');
$moreMsg = l10n($moreMsg);
}
// the String.fromCharCode comes from google bot which somehow manage to get these urls
$template->block_footer_script(null, "var RVTS = {\najaxUrlModel: String.fromCharCode(" . ord($ajax_url_model[0]) . ")+'" . substr($ajax_url_model, 1) . "',\nstart: {$start},\nperPage: {$per_page},\nnext: " . ($start + $per_page) . ",\ntotal: {$total},\nurlModel: String.fromCharCode(" . ord($url_model[0]) . ")+'" . substr($url_model, 1) . "',\nmoreMsg: '{$moreMsg}',\nprevMsg: '" . l10n("Previous") . "',\najaxLoaderImage: '{$ajax_loader_image}'\n};\njQuery('.navigationBar').hide();");
return $thumbs;
}
示例2: NBMSInfos
function NBMSInfos($dir)
{
$path = $dir;
$plg_data = implode('', file($path . 'main.inc.php'));
if (preg_match("|Plugin Name: (.*)|", $plg_data, $val)) {
$plugin['name'] = trim($val[1]);
}
if (preg_match("|Version: (.*)|", $plg_data, $val)) {
$plugin['version'] = trim($val[1]);
}
if (preg_match("|Plugin URI: (.*)|", $plg_data, $val)) {
$plugin['uri'] = trim($val[1]);
}
if ($desc = load_language('description.txt', $path . '/', array('return' => true))) {
$plugin['description'] = trim($desc);
} elseif (preg_match("|Description: (.*)|", $plg_data, $val)) {
$plugin['description'] = trim($val[1]);
}
if (preg_match("|Author: (.*)|", $plg_data, $val)) {
$plugin['author'] = trim($val[1]);
}
if (preg_match("|Author URI: (.*)|", $plg_data, $val)) {
$plugin['author uri'] = trim($val[1]);
}
if (!empty($plugin['uri']) and strpos($plugin['uri'], 'extension_view.php?eid=')) {
list(, $extension) = explode('extension_view.php?eid=', $plugin['uri']);
if (is_numeric($extension)) {
$plugin['extension'] = $extension;
}
}
// IMPORTANT SECURITY !
$plugin = array_map('htmlspecialchars', $plugin);
return $plugin;
}
示例3: osm_apply_menu
function osm_apply_menu($menu_ref_arr)
{
global $template, $page, $conf;
$menu =& $menu_ref_arr[0];
if (($block = $menu->get_block('mbLinks')) != null) {
include_once dirname(__FILE__) . '/include/functions.php';
include_once dirname(__FILE__) . '/include/functions_map.php';
osm_load_language();
load_language('plugin.lang', OSM_PATH);
// Comment are used only with this condition index.php l294
if ($page['start'] == 0 and !isset($page['chronology_field'])) {
$js_data = osm_get_items($page);
if ($js_data != array()) {
$local_conf = array();
$local_conf['contextmenu'] = 'false';
$local_conf['control'] = true;
$local_conf['img_popup'] = false;
$local_conf['popup'] = 2;
$local_conf['center_lat'] = 0;
$local_conf['center_lng'] = 0;
$local_conf['zoom'] = 2;
$local_conf['autocenter'] = 1;
$local_conf['divname'] = 'mapmenu';
$local_conf['paths'] = osm_get_gps($page);
$height = isset($conf['osm_conf']['main_menu']['height']) ? $conf['osm_conf']['main_menu']['height'] : '200';
$js = osm_get_js($conf, $local_conf, $js_data);
$template->set_template_dir(dirname(__FILE__) . '/template/');
$template->assign(array('OSM_PATH' => embellish_url(get_gallery_home_url() . OSM_PATH), 'OSMJS' => $js, 'HEIGHT' => $height));
$block->template = 'osm-menu.tpl';
}
}
}
}
示例4: oauth_init
/**
* plugin initialization
*/
function oauth_init()
{
global $conf, $page, $hybridauth_conf, $template;
load_language('plugin.lang', OAUTH_PATH);
$conf['oauth'] = safe_unserialize($conf['oauth']);
// check config
if (defined('IN_ADMIN')) {
if (empty($hybridauth_conf) and strpos(@$_GET['page'], 'plugin-oAuth') === false) {
$page['warnings'][] = '<a href="' . OAUTH_ADMIN . '">' . l10n('Social Connect: You need to configure the credentials') . '</a>';
}
if (!function_exists('curl_init')) {
$page['warnings'][] = l10n('Social Connect: PHP Curl extension is needed');
}
}
// in case of registration aborded
if (script_basename() == 'index' and ($oauth_id = pwg_get_session_var('oauth_new_user')) !== null) {
pwg_unset_session_var('oauth_new_user');
if ($oauth_id[0] == 'Persona') {
oauth_assign_template_vars(get_gallery_home_url());
$template->block_footer_script(null, 'navigator.id.logout();');
} else {
require_once OAUTH_PATH . 'include/hybridauth/Hybrid/Auth.php';
try {
$hybridauth = new Hybrid_Auth($hybridauth_conf);
$adapter = $hybridauth->getAdapter($oauth_id[0]);
$adapter->logout();
} catch (Exception $e) {
}
}
}
}
示例5: TAT_no_photo_yet
function TAT_no_photo_yet()
{
global $template;
load_language('plugin.lang', PHPWG_PLUGINS_PATH . 'TakeATour/');
$template->set_prefilter('no_photo_yet', 'TAT_no_photo_yet_prefilter');
$template->assign(array('F_ACTION' => get_root_url() . 'admin.php', 'pwg_token' => get_pwg_token()));
}
示例6: osm_load_language
function osm_load_language()
{
global $lang, $lang_info, $conf;
if (isset($lang['Map']) or $lang_info['code'] == 'en' and !$conf['debug_l10n']) {
return;
}
load_language('lang', dirname(__FILE__) . '/../');
}
示例7: Controller_ZobBase
/**
* 构造函数
*
* 负责根据用户的 session 设置载入语言文件
*
* @return Controller_OfficeBase
*/
function Controller_ZobBase()
{
if (isset($_SESSION['LANG'])) {
$lang = $_SESSION['LANG'];
$languages = FLEA::getAppInf('languages');
if (in_array($lang, $languages, true)) {
FLEA::setAppInf('defaultLanguage', $lang);
}
}
load_language('ui, exception');
}
示例8: tg_groups_display
function tg_groups_display()
{
global $conf, $template, $user, $tags, $page;
load_language('plugin.lang', PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
load_language('lang', PHPWG_ROOT_PATH . PWG_LOCAL_DIR, array('no_fallback' => true, 'local' => true));
$template->set_prefilter('tags', 'tg_add_display_link_prefilter');
$template->assign('U_TAG_GROUPS', get_root_url() . 'tags.php?display_mode=groups');
if ($page['tg_display']) {
// echo __FILE__.'::'.__LINE__.' display_mode=groups<br>';
$template->set_prefilter('tags', 'tg_groups_display_prefilter');
$template->assign('display_mode', 'groups');
// we want tags diplayed in alphabetic order
usort($tags, 'tag_alpha_compare');
$current_tag_group = null;
$nb_tags = count($tags);
$current_column = 1;
$current_tag_idx = 0;
$tag_group = array('tags' => array());
foreach ($tags as $tag) {
// if the tag belongs to no group, we don't show it on the "tag by
// group" display mode
if (strpos($tag['name'], ':') === false) {
continue;
} else {
list($tag['group'], $tag['name']) = explode(':', $tag['name'], 2);
$tag['group'] = preg_replace('/^[^=]*=/', '', $tag['group']);
}
if ($current_tag_idx == 0) {
$current_tag_group = $tag['group'];
$tag_group['TITLE'] = $tag['group'];
}
// new group?
if ($tag['group'] !== $current_tag_group) {
if ($current_column < $conf['tag_letters_column_number'] and $current_tag_idx > $current_column * $nb_tags / $conf['tag_letters_column_number']) {
$tag_group['CHANGE_COLUMN'] = true;
$current_column++;
}
$tag_group['TITLE'] = $current_tag_group;
$template->append('tag_groups', $tag_group);
$current_tag_group = $tag['group'];
$tag_group = array('tags' => array());
}
array_push($tag_group['tags'], array_merge($tag, array('URL' => make_index_url(array('tags' => array($tag))))));
$current_tag_idx++;
}
// flush last group
if (count($tag_group['tags']) > 0) {
unset($tag_group['CHANGE_COLUMN']);
$tag_group['TITLE'] = $current_tag_group;
$template->append('tag_groups', $tag_group);
}
}
}
示例9: osm_render_category
function osm_render_category()
{
global $template, $page, $conf, $filter;
include_once dirname(__FILE__) . '/include/functions.php';
include_once dirname(__FILE__) . '/include/functions_map.php';
osm_load_language();
load_language('plugin.lang', OSM_PATH);
// TF, 20160102: pass config as parameter
$js_data = osm_get_items($conf, $page);
if ($js_data != array()) {
$local_conf = array();
$local_conf['contextmenu'] = 'false';
$local_conf['control'] = true;
$local_conf['img_popup'] = false;
$local_conf['popup'] = 1;
$local_conf['center_lat'] = 0;
$local_conf['center_lng'] = 0;
$local_conf['zoom'] = 2;
$local_conf['auto_center'] = 1;
// TF, 20160102: pass config as parameter
$local_conf['paths'] = osm_get_gps($conf, $page);
$height = isset($conf['osm_conf']['category_description']['height']) ? $conf['osm_conf']['category_description']['height'] : '200';
$width = isset($conf['osm_conf']['category_description']['width']) ? $conf['osm_conf']['category_description']['width'] : 'auto';
$js = osm_get_js($conf, $local_conf, $js_data);
$template->set_filename('map', dirname(__FILE__) . '/template/osm-category.tpl');
$template->assign(array('CONTENT_ENCODING' => get_pwg_charset(), 'OSM_PATH' => embellish_url(get_gallery_home_url() . OSM_PATH), 'HOME' => make_index_url(), 'HOME_PREV' => isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : get_absolute_root_url(), 'HOME_NAME' => l10n("Home"), 'HOME_PREV_NAME' => l10n("Previous"), 'OSMJS' => $js, 'HEIGHT' => $height, 'WIDTH' => $width));
$osm_content = $template->parse('map', true);
//$osm_content = '<div id="osmmap"><div class="map_title">'.l10n('EDIT_MAP').'</div>' . $osm_content . '</div>';
$index = isset($conf['osm_conf']['category_description']['index']) ? $conf['osm_conf']['category_description']['index'] : 0;
// 0 - PLUGIN_INDEX_CONTENT_BEGIN
// 1 - PLUGIN_INDEX_CONTENT_COMMENT
// 2 - PLUGIN_INDEX_CONTENT_END
if ($index <= 1) {
// From index category comment at L300
if ($page['start'] == 0 and !isset($page['chronology_field'])) {
if (empty($page['comment'])) {
$page['comment'] = $osm_content;
} else {
if ($index == 0) {
$page['comment'] = '<div>' . $osm_content . $page['comment'] . '</div>';
} else {
$page['comment'] = '<div>' . $page['comment'] . $osm_content . '</div>';
}
}
}
} else {
$osm_content = '<div id="osmmap">' . $osm_content . '</div>';
$template->concat('PLUGIN_INDEX_CONTENT_END', "\n" . $osm_content);
}
}
}
示例10: upgrade_100_110
function upgrade_100_110()
{
global $conf;
load_language('plugin.lang', PH_PATH);
// Upgrading options - Changing config variables to assoc array
// ------------------------------------------------------------
// Upgrade $conf_PH options
$conf_PH = unserialize($conf['PruneHistory']);
$Newconf_PH = array('PHVersion' => $conf_PH[0], 'AUTOPRUNE' => $conf_PH[1], 'RANGEVALUE' => $conf_PH[2], 'RANGE' => $conf_PH[3]);
// unset obsolete conf
// -------------------
for ($i = 0; $i <= 3; $i++) {
unset($conf_PH[$i]);
}
$update_conf = serialize($Newconf_PH);
conf_update_param('PruneHistory', pwg_db_real_escape_string($update_conf));
}
示例11: osm_render_element_content
function osm_render_element_content()
{
global $template, $picture, $page, $conf;
load_language('plugin.lang', OSM_PATH);
if (empty($page['image_id'])) {
return;
}
// Load coordinates from picture
$query = 'SELECT latitude,longitude FROM ' . IMAGES_TABLE . ' WHERE id = \'' . $page['image_id'] . '\' ;';
//FIXME LIMIT 1 ?
$result = pwg_query($query);
$row = pwg_db_fetch_assoc($result);
if (!$row or !$row['latitude'] or empty($row['latitude'])) {
return;
}
$lat = $row['latitude'];
$lon = $row['longitude'];
// Load parameter, fallback to default if unset
$height = isset($conf['osm_conf']['right_panel']['height']) ? $conf['osm_conf']['right_panel']['height'] : '200';
$zoom = isset($conf['osm_conf']['right_panel']['zoom']) ? $conf['osm_conf']['right_panel']['zoom'] : '12';
$osmname = isset($conf['osm_conf']['right_panel']['link']) ? $conf['osm_conf']['right_panel']['link'] : 'Location';
$osmnamecss = isset($conf['osm_conf']['right_panel']['linkcss']) ? $conf['osm_conf']['right_panel']['linkcss'] : '';
$showosm = isset($conf['osm_conf']['right_panel']['showosm']) ? $conf['osm_conf']['right_panel']['showosm'] : 'true';
if (strlen($osmnamecss) != 0) {
$osmnamecss = "style='" . $osmnamecss . "'";
}
$osmlink = "https://openstreetmap.org/?mlat=" . $lat . "&mlon=" . $lon . "&zoom=12&layers=M";
$local_conf = array();
$local_conf['contextmenu'] = 'false';
$local_conf['control'] = false;
$local_conf['img_popup'] = false;
$local_conf['popup'] = 2;
$local_conf['center_lat'] = $lat;
$local_conf['center_lng'] = $lon;
$local_conf['zoom'] = $zoom;
// TF, 20160102: pass config as parameter
$js_data = osm_get_items($conf, $page);
$js = osm_get_js($conf, $local_conf, $js_data);
// Select the template
$template->set_filenames(array('osm_content' => dirname(__FILE__) . "/template/osm-picture.tpl"));
// Assign the template variables
$template->assign(array('HEIGHT' => $height, 'OSMJS' => $js, 'OSM_PATH' => embellish_url(get_gallery_home_url() . OSM_PATH), 'OSMNAME' => $osmname, 'OSMNAMECSS' => $osmnamecss, 'SHOWOSM' => $showosm, 'OSMLINK' => $osmlink));
// Return the rendered html
$osm_content = $template->parse('osm_content', true);
return $osm_content;
}
示例12: NBMS_prefilter
function NBMS_prefilter($content, &$smarty)
{
global $template, $lang;
load_language('plugin.lang', NBMS_PATH);
$search = '<p class="bottomButtons">';
$addon = '
<fieldset>
<legend>{\'NBMS_Section\'|@translate}</legend>
<ul>
<li>
<span class="property">{\'NBMS_Text\'|@translate}</span>
{html_radios name=\'NBM_Subscription\' options=$radio_options selected=$NBMS}
</li>
</ul>
</fieldset>
';
$replacement = $addon . $search;
return str_replace($search, $replacement, $content);
}
示例13: PH_version_update
/**
* Function to update plugin version number in config table
* Used everytime a new version is updated even if no database
* upgrade is needed
*/
function PH_version_update()
{
global $conf;
load_language('plugin.lang', PH_PATH);
// Get current plugin version
// --------------------------
$plugin = PHInfos(PH_PATH);
$version = $plugin['version'];
// Upgrading options
// -----------------
$query = '
SELECT value
FROM ' . CONFIG_TABLE . '
WHERE param = "PruneHistory"
;';
$result = pwg_query($query);
$conf_PH = pwg_db_fetch_assoc($result);
$Newconf_PH = unserialize($conf_PH['value']);
$Newconf_PH['PHVersion'] = $version;
$update_conf = serialize($Newconf_PH);
conf_update_param('PruneHistory', pwg_db_real_escape_string($update_conf));
// Check #_plugin table consistency
// Only useful if a previous version upgrade has not worked correctly (rare case)
// ------------------------------------------------------------------------------
$query = '
SELECT version
FROM ' . PLUGINS_TABLE . '
WHERE id = "PruneHistory"
;';
$data = pwg_db_fetch_assoc(pwg_query($query));
if (empty($data['version']) or $data['version'] != $version) {
$query = '
UPDATE ' . PLUGINS_TABLE . '
SET version="' . $version . '"
WHERE id = "PruneHistory"
LIMIT 1
;';
pwg_query($query);
}
}
示例14: upgrade_240_250
function upgrade_240_250()
{
global $conf;
load_language('plugin.lang', REGFLUXBB_PATH);
$plugin = RegFluxBB_Infos(REGFLUXBB_PATH);
$version = $plugin['version'];
// Upgrading options - Changing config variables to assoc array
// ------------------------------------------------------------
$conf_RegFluxBB = isset($conf['Register_FluxBB']) ? explode(";", $conf['Register_FluxBB']) : array();
$Newconf_RegFluxBB = array('REGFLUXBB_VERSION' => $version, 'FLUXBB_PREFIX' => $conf_RegFluxBB[0], 'FLUXBB_ADMIN' => $conf_RegFluxBB[1], 'FLUXBB_GUEST' => $conf_RegFluxBB[2], 'FLUXBB_DEL_PT' => $conf_RegFluxBB[3], 'FLUXBB_CONFIRM' => $conf_RegFluxBB[4], 'FLUXBB_DETAIL' => $conf_RegFluxBB[5], 'FLUXBB_UAM_LINK' => $conf_RegFluxBB[6], 'FLUXBB_GROUP' => $conf_RegFluxBB[7]);
$update_conf = serialize($Newconf_RegFluxBB);
$q = '
DELETE FROM ' . CONFIG_TABLE . '
WHERE param="Register_FluxBB" LIMIT 1
;';
pwg_query($q);
$q = '
INSERT INTO ' . CONFIG_TABLE . ' (param, value, comment)
VALUES ("Register_FluxBB","' . pwg_db_real_escape_string($update_conf) . '","Register_FluxBB parameters")
;';
pwg_query($q);
}
示例15: modus_smarty_prefilter
function modus_smarty_prefilter($source)
{
global $lang, $conf;
$source = str_replace('<div id="imageHeaderBar">', '<div class=titrePage id=imageHeaderBar>', $source);
$source = str_replace('<div id=imageHeaderBar>', '<div class=titrePage id=imageHeaderBar>', $source);
if (!isset($lang['modus_theme'])) {
load_language('theme.lang', dirname(__FILE__) . '/');
}
// picture page actionButtons wrap for mobile
if (strpos($source, '<div id="imageToolBar">') !== false || strpos($source, '<div id=imageToolBar>') !== false) {
if (!($pos = strpos($source, '<div class="actionButtons">'))) {
$pos = strpos($source, '<div class=actionButtons>');
}
if ($pos !== false) {
$source = substr_replace($source, '<div class=actionButtonsWrapper><a id=imageActionsSwitch class=pwg-button><span class="pwg-icon pwg-icon-ellipsis"></span></a>{combine_script version=1 id=\'modus.async\' path="themes/`$themeconf.id`/js/modus.async.js" load=\'async\'}', $pos, 0);
$pos = strpos($source, 'caddie', $pos + 1);
$pos = strpos($source, '</div>', $pos + 1);
$source = substr_replace($source, '</div>', $pos, 0);
}
}
/* move imageNumber from imageToolBar to imageHeaderBar*/
if (preg_match('#<div[ a-zA-Z"=]+id="?imageHeaderBar"?>#', $source, $matches, PREG_OFFSET_CAPTURE) && preg_match('#<div class="?imageNumber"?>{\\$PHOTO}</div>#', $source, $matches2, PREG_OFFSET_CAPTURE, $matches[0][1] + 20)) {
$source = substr_replace($source, '', $matches2[0][1], strlen($matches2[0][0]));
$source = substr_replace($source, $matches2[0][0], $matches[0][1] + strlen($matches[0][0]), 0);
}
if (($pos = strpos($source, '<ul class="categoryActions">')) !== false || ($pos = strpos($source, '<ul class=categoryActions>')) !== false) {
if (($pos2 = strpos($source, '</ul>', $pos)) !== false && substr_count($source, '<li>', $pos, $pos2 - $pos) > 2) {
$source = substr_replace($source, '<a id=albumActionsSwitcher class=pwg-button><span class="pwg-icon pwg-icon-ellipsis"></span></a>{combine_script version=1 id=\'modus.async\' path="themes/`$themeconf.id`/js/modus.async.js" load=\'async\'}', $pos, 0);
}
}
$re = preg_quote('<img title="{$cat.icon_ts.TITLE}" src="', '/') . '[^>]+' . preg_quote('/recent{if $cat.icon_ts.IS_CHILD_DATE}_by_child{/if}.png"', '/') . '[^>]+' . preg_quote('alt="(!)">', '/');
$source = preg_replace('/' . $re . '/', '<span class=albSymbol title="{$cat.icon_ts.TITLE}">{if $cat.icon_ts.IS_CHILD_DATE}' . MODUS_STR_RECENT_CHILD . '{else}' . MODUS_STR_RECENT . '{/if}</span>', $source);
$re = preg_quote('<img title="{$thumbnail.icon_ts.TITLE}" src="', '/') . '[^>]+' . preg_quote('/recent.png" alt="(!)">', '/');
$source = preg_replace('/' . $re . '/', '<span class=albSymbol title="{$thumbnail.icon_ts.TITLE}">' . MODUS_STR_RECENT . '</span>', $source);
return $source;
}