本文整理汇总了PHP中lang_load函数的典型用法代码示例。如果您正苦于以下问题:PHP lang_load函数的具体用法?PHP lang_load怎么用?PHP lang_load使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了lang_load函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
function main()
{
lang_load('admin.widgets');
# $this->smarty->assign('warnings', admin_widgets_checkall());
global $fp_widgets;
$registered_w = get_registered_widgets();
$registered_ws = get_registered_widgetsets(null);
$this->smarty->assign('fp_registered_widgets', $registered_w);
$wlist = $fp_widgets->getList();
$widget_list = array();
foreach ($registered_ws as $wpos) {
$widget_list[$wpos] = array();
$this->get_widget_lists($wlist, $wpos, $widget_list, $registered_w, true);
unset($wlist[$wpos]);
}
$oldwidget_list = array();
foreach ($wlist as $wpos => $c) {
$this->get_widget_lists($wlist, $wpos, $oldwidget_list, $registered_w, false);
}
$this->smarty->assign('widgetlist', $widget_list);
$this->smarty->assign('oldwidgetlist', $oldwidget_list);
$conf = io_load_file(CONFIG_DIR . 'widgets.conf.php');
$this->smarty->assign('pluginconf', $conf);
return 0;
}
示例2: plugin_qspam_validate
/**
* This plugin denies comments when they're containing "bad words",
* e.g. "href" (which indexes links)., etc.
*
* @global $smarty
* @param boolean $bool
* @param string $contents The comment
* @return unknown
*/
function plugin_qspam_validate($bool, $contents)
{
if (!$bool) {
return false;
}
$qscfg = plugin_getoptions('qspam');
// We're looking for these words:
$BAN_WORDS = '';
if (isset($qscfg['wordlist'])) {
$BAN_WORDS = $qscfg['wordlist'];
} else {
// rudimentary ban of links
$BAN_WORDS = array('href', '[url');
}
$qscfg['number'] = isset($qscfg['number']) ? $qscfg['number'] : 1;
$txt = strtolower(trim($contents['content']));
$count = 0;
while ($w = array_pop($BAN_WORDS)) {
$count += substr_count($txt, strtolower($w));
}
if ($count >= $qscfg['number']) {
global $smarty;
$lang = lang_load('plugin:qspam');
$smarty->assign('error', array($lang['plugin']['qspam']['error']));
return false;
}
return true;
}
示例3: lang_ensure_loaded
function lang_ensure_loaded($p_lang)
{
global $g_lang_strings;
if (!isset($g_lang_strings[$p_lang])) {
lang_load($p_lang);
}
}
示例4: main
function main()
{
lang_load('admin.widgets');
$this->smarty->assign('warnings', admin_widgets_checkall());
$conf = io_load_file(CONFIG_DIR . 'widgets.conf.php');
$this->smarty->assign('pluginconf', $conf);
return 0;
}
示例5: contact_main
function contact_main()
{
global $smarty;
$lang = lang_load('contact');
$smarty->assign('subject', $lang['contact']['head']);
$smarty->assign('content', 'shared:contact.tpl');
contact_form();
}
示例6: lang_load
function &getLanguageFile($reload = false)
{
if (!isset($this->lang) || $reload) {
$_SESSION['load_count'] += 1;
$langinstance = lang_load($this->config['lang']);
$this->lang =& $langinstance;
}
return $this->lang;
}
示例7: plugin_categories_widget
function plugin_categories_widget()
{
global $smarty;
// set this to true if you want show the number
// of categories for each category; please notice:
// not cheap on the server, it should be cached
// somewhere else
// default: disabled
$smarty->assign('categories_showcount', false);
// load plugin strings
// they're located under plugin.PLUGINNAME/lang/LANGID/
$lang = lang_load('plugin:categories');
$entry['subject'] = $lang['plugin']['categories']['subject'];
$entry['content'] = $smarty->fetch('plugin:categories/widget');
return $entry;
}
示例8: plugin_lastcomments_widget
function plugin_lastcomments_widget()
{
if (false === ($f = io_load_file(LASTCOMMENTS_CACHE_FILE))) {
// no comments in cache
$list = array();
} else {
// if file exists and its correctly read, we get the stored list
// (it is stored in encoded form)
$list = unserialize($f);
}
$content = '<ul class="last-comments">';
// cimangi Aggiunta traduzione stringhe
// load plugin strings
// they're located under plugin.PLUGINNAME/lang/LANGID/
$lang = lang_load('plugin:lastcomments');
if ($count = count($list)) {
while ($arr = array_pop($list)) {
theme_comments_filters($arr, $id);
$q = new FPDB_Query(array('id' => $arr['entry']), null);
// first element of the array is dropped, as it is the ID, which
// we already know
@(list(, $entry) = $q->getEntry($query));
if (!$entry) {
$count--;
$update = true;
continue;
}
$content .= "<li>\n\t\t\t<blockquote class=\"comment-quote\" cite=\"comments.php?entry={$arr['entry']}#{$arr['id']}\">\n\t\t\t{$arr['content']}\n\t\t\t<p><a href=\"" . get_comments_link($arr['entry']) . "#{$arr['id']}\">{$arr['name']} - {$entry['subject']}</a></p>\n\t\t\t</blockquote></li>\n";
}
$subject = $lang['plugin']['lastcomments']['last'] . ' ' . $count . ' ' . $lang['plugin']['lastcomments']['comments'];
}
if (!$count) {
if ($update) {
fs_delete(LASTCOMMENTS_CACHE_FILE);
}
$content .= '<li>' . $lang['plugin']['lastcomments']['no_comments'] . '</li>';
$subject = $lang['plugin']['lastcomments']['no_new_comments'];
}
$content .= '</ul>';
$entry['subject'] = $subject;
$entry['content'] = $content;
return $entry;
}
示例9: plugin_lastentries_widget
function plugin_lastentries_widget()
{
global $fpdb;
// load plugin strings
// they're located under plugin.PLUGINNAME/lang/LANGID/
$lang = lang_load('plugin:lastentries');
$num = 10;
####################
/*
$queryId = $fpdb->query("fullparse:false,start:0,count:$num");
$fpdb->doquery($queryId);
$fpdb->getQuery
*/
$q = new FPDB_Query(array('fullparse' => false, 'start' => 0, 'count' => $num), null);
$string = '<ul>';
$count = 0;
while ($q->hasmore()) {
list($id, $entry) = $q->getEntry();
$link = get_permalink($id);
$string .= '<li>';
$admin = BLOG_BASEURL . "admin.php?p=entry&entry=";
if (user_loggedin()) {
// if loggedin prints a "edit" link
$string .= "<a href=\"{$admin}{$id}\">[" . $lang['plugin']['lastentries']['edit'] . "]</a>";
}
$string .= "<a href=\"{$link}\">{$entry['subject']}</a></li>\n";
$count++;
}
if ($string == '<ul>') {
$string .= '<li><a href="admin.php?p=entry&action=write">' . $lang['plugin']['lastentries']['add_entry'] . '</a></li>';
$subject = $lang['plugin']['lastentries']['no_entries'];
} else {
$subject = $lang['plugin']['lastentries']['subject_before_count'] . $count . $lang['plugin']['lastentries']['subject_after_count'];
}
$string .= '</ul>';
$widget = array();
$widget['subject'] = $subject;
$widget['content'] = $string;
return $widget;
}
示例10: LayoutDefault
function LayoutDefault($content = array())
{
$this->pagecontent = $content;
$this->fpdb =& new FPDB();
$GLOBALS['fpdb'] =& $this->fpdb;
$this->fp_widgets =& new widget_indexer();
$GLOBALS['fp_widgets'] =& $this->fp_widgets;
$this->smarty =& $GLOBALS['_FP_SMARTY'];
$GLOBALS['fp_config'] =& $this->config;
$this->config = $GLOBALS['fp_config']['general'];
$this->theme = theme_loadsettings();
$GLOBALS['theme'] =& $this->theme;
$this->lang = lang_load();
$GLOBALS['lang'] =& $this->lang;
// user_loggedin() or sess_setup();
plugin_loadall();
// init smarty
$this->smarty->compile_dir = CACHE_DIR;
$this->smarty->cache_dir = SMARTY_DIR . 'cache/';
$this->smarty->caching = 0;
do_action('init');
}
示例11: plugin_adminarea_widget
function plugin_adminarea_widget()
{
// load plugin strings
// they're located under plugin.PLUGINNAME/lang/LANGID/
$lang = lang_load('plugin:adminarea');
$baseurl = BLOG_BASEURL;
if ($user = user_loggedin()) {
$userid = $user['userid'];
$string = <<<END
\t\t<p>{$lang['plugin']['adminarea']['welcome']} <strong>{$userid}</strong> !</p>
\t\t<ul>
\t\t<li><a href="{$baseurl}admin.php">{$lang['plugin']['adminarea']['admin_panel']}</a></li>
\t\t<li><a href="{$baseurl}admin.php?p=entry&action=write">{$lang['plugin']['adminarea']['add_entry']}</a></li>
\t\t<li><a href="{$baseurl}login.php?do=logout">{$lang['plugin']['adminarea']['logout']}</a></li>
\t\t</ul>
END;
} else {
$string = '<ul><li><a href="' . $baseurl . 'login.php">Login</a></li></ul>';
}
$entry['subject'] = $lang['plugin']['adminarea']['subject'];
$entry['content'] = $string;
return $entry;
}
示例12: plugin_load
function plugin_load($plugin, $checkonly = true, $langload = true)
{
global $lang;
$errno = 0;
$errors = false;
if (file_exists($f = PLUGINS_DIR . "{$plugin}/plugin.{$plugin}.php")) {
$errno = 1;
// 1 means exists
} elseif (file_exists($f = PLUGINS_DIR . "{$plugin}/{$plugin}.php")) {
$errno = 2;
// 2 means exists but filename is oldstyle
}
if ($errno > 0) {
ob_start();
include_once $f;
ob_end_clean();
}
if ($langload) {
@lang_load("plugin:{$plugin}");
}
if ($checkonly) {
$func = "plugin_{$plugin}_setup";
if (is_callable($func)) {
$errno = $func();
}
if ($errno <= 0) {
if (isset($lang['plugin'][$plugin]['errors'][$errno])) {
$errors = "[<strong>{$plugin}</strong>] {$lang['plugin'][$plugin]['errors'][$errno]}";
} elseif ($errno < 0) {
$errors = "[<strong>{$plugin}</strong>] " . sprintf($lang['admin']['plugin']['errors']['generic'], $errno);
} else {
$errors = "[<strong>{$plugin}</strong>] " . $lang['admin']['plugin']['errors']['notfound'];
}
}
}
return $errors;
}
示例13: lang_load
<?php
//include('constant_inc.php');
function lang_load($p_lang)
{
global $g_lang_strings, $g_lang_current;
// if ( $g_lang_current == $p_lang ) {
// return;
// }
// define current language here so that when custom_strings_inc is
// included it knows the current language
$g_lang_current = $p_lang;
//$t_lang_dir = dirname ( dirname ( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR;
$t_lang_dir = './';
require_once $t_lang_dir . 'strings_' . $p_lang . '.inc';
$t_vars = get_defined_vars();
// print(sizeof($t_vars) . "\n");
// print_r(array_keys($t_vars));
foreach (array_keys($t_vars) as $t_var) {
$t_lang_var = ereg_replace('^s_', '', $t_var);
if ($t_lang_var != $t_var || 'MANTIS_ERROR' == $t_var) {
$g_lang_strings[$t_lang_var] = ${$t_var};
}
}
}
lang_load('english');
print_r($g_lang_strings);
//print_r(array_keys(get_defined_vars()));
示例14: admin_panelstrings
function admin_panelstrings($panelprefix)
{
global $lang, $smarty;
lang_load('admin');
lang_load($panelprefix);
$smarty->assign('subject', $lang['admin']['head']);
$smarty->assign('menubar', admin_getpanels());
add_filter('wp_title', 'admin_panel_title', 10, 2);
}
示例15: main
function main()
{
//$conf = io_load_file(CONFIG_DIR . 'plugins.conf.php');
$this->smarty->assign('warnings', $this->errors);
$this->smarty->assign('enabledlist', $this->fp_plugins);
lang_load('admin.plugin');
return 0;
}