本文整理汇总了PHP中core::load_lng方法的典型用法代码示例。如果您正苦于以下问题:PHP core::load_lng方法的具体用法?PHP core::load_lng怎么用?PHP core::load_lng使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core
的用法示例。
在下文中一共展示了core::load_lng方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
/**
* @package JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
define('_IN_JOHNCMS', 1);
$rootpath = '';
require 'incfiles/core.php';
$textl = $lng['registration'];
$headmod = 'registration';
require 'incfiles/head.php';
$lng_reg = core::load_lng('registration');
// Если регистрация закрыта, выводим предупреждение
if (core::$deny_registration || !$set['mod_reg']) {
echo '<p>' . $lng_reg['registration_closed'] . '</p>';
require 'incfiles/end.php';
exit;
}
$captcha = isset($_POST['captcha']) ? trim($_POST['captcha']) : NULL;
$reg_nick = isset($_POST['nick']) ? trim($_POST['nick']) : '';
$lat_nick = functions::rus_lat(mb_strtolower($reg_nick));
$reg_pass = isset($_POST['password']) ? trim($_POST['password']) : '';
$reg_name = isset($_POST['imname']) ? trim($_POST['imname']) : '';
$reg_about = isset($_POST['about']) ? trim($_POST['about']) : '';
$reg_sex = isset($_POST['sex']) ? functions::check(mb_substr(trim($_POST['sex']), 0, 2)) : '';
echo '<div class="phdr"><b>' . $lng['registration'] . '</b></div>';
if (isset($_POST['submit'])) {
示例2: define
<?php
/**
* @package JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
define('_IN_JOHNCMS', 1);
$headmod = 'library';
require_once '../incfiles/core.php';
$lng_lib = core::load_lng('library');
$textl = $lng['library'];
// Ограничиваем доступ к Библиотеке
$error = '';
if (!$set['mod_lib'] && $rights < 7) {
$error = $lng_lib['library_closed'];
} elseif ($set['mod_lib'] == 1 && !$user_id) {
$error = $lng['access_guest_forbidden'];
}
if ($error) {
require_once '../incfiles/head.php';
echo '<div class="rmenu"><p>' . $error . '</p></div>';
require_once '../incfiles/end.php';
exit;
}
// Заголовки библиотеки
if ($id) {
$req = mysql_query("SELECT * FROM `lib` WHERE `id`= '{$id}'");
示例3: defined
<?php
/**
* @package JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
$headmod = 'userban';
$lng_ban = core::load_lng('ban');
require '../incfiles/head.php';
$ban = isset($_GET['ban']) ? intval($_GET['ban']) : 0;
switch ($mod) {
case 'do':
/*
-----------------------------------------------------------------
Баним пользователя (добавляем Бан в базу)
-----------------------------------------------------------------
*/
if ($rights < 1 || $rights < 6 && $user['rights'] || $rights <= $user['rights']) {
echo functions::display_error($lng_ban['ban_rights']);
} else {
echo '<div class="phdr"><b>' . $lng_ban['ban_do'] . '</b></div>';
echo '<div class="rmenu"><p>' . functions::display_user($user) . '</p></div>';
if (isset($_POST['submit'])) {
$error = false;
$term = isset($_POST['term']) ? intval($_POST['term']) : false;
$timeval = isset($_POST['timeval']) ? intval($_POST['timeval']) : false;
示例4: define
<?php
/**
* @package JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
define('_IN_JOHNCMS', 1);
require '../incfiles/core.php';
$lng_faq = core::load_lng('faq');
$lng_smileys = core::load_lng('smileys');
$textl = 'FAQ';
$headmod = 'faq';
require '../incfiles/head.php';
// Обрабатываем ссылку для возврата
if (empty($_SESSION['ref'])) {
$_SESSION['ref'] = isset($_SERVER['HTTP_REFERER']) ? htmlspecialchars($_SERVER['HTTP_REFERER']) : $home;
}
// Сколько смайлов разрешено выбрать пользователям?
$user_smileys = 20;
switch ($act) {
case 'forum':
/*
-----------------------------------------------------------------
Правила Форума
-----------------------------------------------------------------
*/
echo '<div class="phdr"><a href="faq.php"><b>F.A.Q.</b></a> | ' . $lng_faq['forum_rules'] . '</div>' . '<div class="menu"><p>' . $lng_faq['forum_rules_text'] . '</p></div>' . '<div class="phdr"><a href="' . $_SESSION['ref'] . '">' . $lng['back'] . '</a></div>';
示例5: defined
/**
* @package JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
defined('_IN_JOHNADM') or die('Error: restricted access');
// Проверяем права доступа
if ($rights < 9) {
header('Location: http://johncms.com/?err');
exit;
}
$panel_lng = core::load_lng('panel_lng');
/*
-----------------------------------------------------------------
Читаем каталог с файлами языков
-----------------------------------------------------------------
*/
$lng_list = array();
$lng_desc = array();
foreach (glob('../incfiles/languages/*/_core.ini') as $val) {
$dir = explode('/', dirname($val));
$iso = array_pop($dir);
$desc = parse_ini_file($val);
$lng_list[$iso] = isset($desc['name']) && !empty($desc['name']) ? $desc['name'] : $iso;
$lng_desc[$iso] = $desc;
}
/*
示例6: define
<?php
/**
* @package JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
define('_IN_JOHNCMS', 1);
require '../incfiles/core.php';
$lng_profile = core::load_lng('profile');
$textl = $lng_profile['album'];
$headmod = 'album';
$max_album = 10;
$max_photo = 200;
$al = isset($_REQUEST['al']) ? abs(intval($_REQUEST['al'])) : NULL;
$img = isset($_REQUEST['img']) ? abs(intval($_REQUEST['img'])) : NULL;
/*
-----------------------------------------------------------------
Закрываем от неавторизованных юзеров
-----------------------------------------------------------------
*/
if (!$user_id) {
require '../incfiles/head.php';
echo functions::display_error($lng['access_guest_forbidden']);
require '../incfiles/end.php';
exit;
}
/*
示例7: define
<?php
/**
* @package JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
define('_IN_JOHNCMS', 1);
require '../incfiles/core.php';
$lng_pass = core::load_lng('pass');
$textl = $lng_pass['password_restore'];
require '../incfiles/head.php';
function passgen($length)
{
$vals = "abcdefghijklmnopqrstuvwxyz0123456789";
$result = '';
for ($i = 1; $i <= $length; $i++) {
$result .= $vals[rand(0, strlen($vals))];
}
return $result;
}
switch ($act) {
case 'sent':
/*
-----------------------------------------------------------------
Отправляем E-mail с инструкциями по восстановлению пароля
-----------------------------------------------------------------
*/
示例8: display_place
/**
* Показываем местоположение пользователя
*
* @param int $user_id
* @param string $place
*
* @return mixed|string
*/
public static function display_place($user_id = 0, $place = '')
{
global $headmod;
$place = explode(",", $place);
$placelist = parent::load_lng('places');
if (array_key_exists($place[0], $placelist)) {
if ($place[0] == 'profile') {
if ($place[1] == $user_id) {
return '<a href="' . self::$system_set['homeurl'] . '/users/profile.php?user=' . $place[1] . '">' . $placelist['profile_personal'] . '</a>';
} else {
$user = self::get_user($place[1]);
return $placelist['profile'] . ': <a href="' . self::$system_set['homeurl'] . '/users/profile.php?user=' . $user['id'] . '">' . $user['name'] . '</a>';
}
} elseif ($place[0] == 'online' && isset($headmod) && $headmod == 'online') {
return $placelist['here'];
} else {
return str_replace('#home#', self::$system_set['homeurl'], $placelist[$place[0]]);
}
}
return '<a href="' . self::$system_set['homeurl'] . '/index.php">' . $placelist['homepage'] . '</a>';
}
示例9: defined
<?php
/**
* @package JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
$lng_set = core::load_lng('settings');
$textl = $lng['settings'];
require '../incfiles/head.php';
/*
-----------------------------------------------------------------
Проверяем права доступа
-----------------------------------------------------------------
*/
if ($user['id'] != $user_id) {
echo functions::display_error($lng['access_forbidden']);
require '../incfiles/end.php';
exit;
}
$menu = array(!$mod ? '<b>' . $lng['common_settings'] . '</b>' : '<a href="profile.php?act=settings">' . $lng['common_settings'] . '</a>', $mod == 'forum' ? '<b>' . $lng['forum'] . '</b>' : '<a href="profile.php?act=settings&mod=forum">' . $lng['forum'] . '</a>');
/*
-----------------------------------------------------------------
Пользовательские настройки
-----------------------------------------------------------------
*/
switch ($mod) {
示例10: mysql_fetch_assoc
}
} else {
// Выводим сообщение об ошибке
require '../incfiles/head.php';
echo functions::display_error($error, '<a href="index.php?act=nt&id=' . $id . '">' . $lng['repeat'] . '</a>');
require '../incfiles/end.php';
exit;
}
} else {
$res_r = mysql_fetch_assoc($req_r);
$req_c = mysql_query("SELECT * FROM `forum` WHERE `id` = '" . $res_r['refid'] . "'");
$res_c = mysql_fetch_assoc($req_c);
require '../incfiles/head.php';
if ($datauser['postforum'] == 0) {
if (!isset($_GET['yes'])) {
$lng_faq = core::load_lng('faq');
echo '<p>' . $lng_faq['forum_rules_text'] . '</p>';
echo '<p><a href="index.php?act=nt&id=' . $id . '&yes">' . $lng_forum['agree'] . '</a> | <a href="index.php?id=' . $id . '">' . $lng_forum['not_agree'] . '</a></p>';
require '../incfiles/end.php';
exit;
}
}
$msg_pre = functions::checkout($msg, 1, 1);
if ($set_user['smileys']) {
$msg_pre = functions::smileys($msg_pre, $datauser['rights'] ? 1 : 0);
}
$msg_pre = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $msg_pre);
echo '<div class="phdr"><a href="index.php?id=' . $id . '"><b>' . $lng['forum'] . '</b></a> | ' . $lng_forum['new_topic'] . '</div>';
if ($msg && $th && !isset($_POST['submit'])) {
echo '<div class="list1"><img src="../theme/default/images/op.gif" border="0" alt="op" /> <span style="font-weight: bold">' . $th . '</span></div>' . '<div class="list2">' . functions::display_user($datauser, array('iphide' => 1, 'header' => '<span class="gray">(' . functions::display_date(time()) . ')</span>', 'body' => $msg_pre)) . '</div>';
}
示例11: define
<?php
/*
dev agssbuzz@catroxs.org
site http://catroxs.org
*/
define('_IN_JOHNCMS', 1);
$headmod = 'journal';
require '../incfiles/core.php';
$lng_forum = core::load_lng('forum');
$textl = 'Forum Notifikasi';
require '../incfiles/head.php';
if (!$user_id) {
echo 'Anda belum login';
require '../incfiles/end_utama.php';
exit;
}
echo '<div class="phdr"><b>Forum Notifikasi</b></div>';
if ($datauser['journal_forum']) {
echo '<div class="topmenu">Notifikasi Baru : ' . $datauser['journal_forum'] . '</div>';
mysql_query("UPDATE `users` SET `journal_forum`='0' WHERE `id` = '{$user_id}'");
}
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `id_user`='{$user_id}'" . ($rights >= 7 ? "" : " AND `close` != '1'")), 0);
if ($total) {
$req = mysql_query("SELECT `forum`.*, `users`.`sex`, `users`.`rights`, `users`.`lastdate`, `users`.`status`, `users`.`datereg`\n \tFROM `forum` LEFT JOIN `users` ON `forum`.`user_id` = `users`.`id`\n \tWHERE `forum`.`type` = 'm' AND `forum`.`id_user`='{$user_id}'" . ($rights >= 7 ? "" : " AND `forum`.`close` != '1'") . " ORDER BY `forum`.`id` DESC LIMIT {$start}, {$kmess}");
while (($res = mysql_fetch_assoc($req)) !== false) {
if ($res['close']) {
echo '<div class="rmenu">';
} else {
echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
}
示例12: define
<?php
/**
* @package JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
define('_IN_JOHNCMS', 1);
require_once "../incfiles/core.php";
$lng_pm = core::load_lng('pm');
$headmod = 'ignor';
$textl = 'Block List';
require_once '../incfiles/head.php';
if (!empty($_SESSION['uid'])) {
if (!empty($_GET['act'])) {
$act = $_GET['act'];
}
switch ($act) {
case "add":
echo '<div class="phdr">' . $lng_pm['add_to_ignor'] . '</div>';
echo "<form action='ignor.php?act=edit&add=1' method='post'>" . $lng_pm['enter_nick'] . "<br/>";
echo "<input type='text' name='nik' value='' /><br/><input type='submit' value='" . $lng['add'] . "' /></form>";
echo '<a href="ignor.php">' . $lng['back'] . '</a><br/>';
break;
case "edit":
if (!empty($_POST['nik'])) {
$nik = functions::check($_POST['nik']);
} elseif (!empty($_GET['nik'])) {
示例13: defined
<?php
/**
* @package JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
$lng_karma = core::load_lng('karma');
$textl = $lng['karma'];
require '../incfiles/head.php';
if ($set_karma['on']) {
switch ($mod) {
case 'vote':
/*
-----------------------------------------------------------------
Отдаем голос за пользователя
-----------------------------------------------------------------
*/
if (!$datauser['karma_off'] && !$ban) {
$error = array();
if ($user['rights'] && $set_karma['adm']) {
$error[] = $lng_karma['error_not_for_admins'];
}
if ($user['ip'] == $ip) {
$error[] = $lng_karma['error_rogue'];
}
if ($datauser['total_on_site'] < $set_karma['karma_time'] || $datauser['postforum'] < $set_karma['forum']) {