本文整理汇总了PHP中cmsCore::loadLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsCore::loadLanguage方法的具体用法?PHP cmsCore::loadLanguage怎么用?PHP cmsCore::loadLanguage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsCore
的用法示例。
在下文中一共展示了cmsCore::loadLanguage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: search_blogs
function search_blogs($query, $look)
{
$inDB = cmsDatabase::getInstance();
$searchModel = cms_model_search::initModel();
global $_LANG;
$sql = "SELECT con.*, cat.title cat_title, cat.id cat_id, cat.owner owner, cat.user_id user_id, cat.seolink as bloglink\n\t\t\tFROM cms_blog_posts con\n\t\t\tINNER JOIN cms_blogs cat ON cat.id = con.blog_id AND cat.allow_who = 'all' AND cat.owner = 'user'\n\t\t\tWHERE MATCH(con.title, con.content) AGAINST ('{$query}' IN BOOLEAN MODE) AND con.published = 1 LIMIT 100";
$result = $inDB->query($sql);
if ($inDB->num_rows($result)) {
cmsCore::loadLanguage('components/blogs');
cmsCore::loadModel('blogs');
$model = new cms_model_blogs();
while ($item = $inDB->fetch_assoc($result)) {
$result_array = array();
$result_array['link'] = $model->getPostURL($item['bloglink'], $item['seolink']);
$result_array['place'] = $_LANG['BLOG'] . ' «' . $item['cat_title'] . '»';
$result_array['placelink'] = $model->getBlogURL($item['bloglink']);
$result_array['description'] = $searchModel->getProposalWithSearchWord($item['content_html']);
$result_array['title'] = $item['title'];
$result_array['pubdate'] = $item['pubdate'];
$result_array['session_id'] = session_id();
$searchModel->addResult($result_array);
}
}
return;
}
示例2: search_content
function search_content($query, $look) {
global $_LANG;
$sql = "SELECT con.*, cat.title cat_title, cat.id cat_id, cat.seolink as cat_seolink, cat.parent_id as cat_parent_id
FROM cms_content con
INNER JOIN cms_category cat ON cat.id = con.category_id AND cat.published = 1
WHERE MATCH(con.title, con.content) AGAINST ('". $query ."' IN BOOLEAN MODE) AND con.is_end = 0 AND con.published = 1 LIMIT 100";
$result = cmsCore::c('db')->query($sql);
if (cmsCore::c('db')->num_rows($result)) {
cmsCore::loadLanguage('components/content');
while ($item = cmsCore::c('db')->fetch_assoc($result)) {
$result_array = array(
'link' => '/'. $item['seolink'] .'.html',
'place' => $_LANG['CATALOG_ARTICLES'],
'placelink' => '/'. ($item['cat_parent_id']>0 ? $item['cat_seolink'] : $item['seolink'] .'.html'),
'description' => cmsCore::m('search')->getProposalWithSearchWord($item['content']),
'title' => $item['title'],
'imageurl' => (file_exists(PATH .'/images/content/medium/'. ceil($item['id']/100) .'/article'. $item['id' ] .'.jpg') ? '/images/content/medium/'. ceil($item['id']/100) .'/article'. $item['id' ] .'.jpg' : ''),
'pubdate' => $item['pubdate']
);
cmsCore::m('search')->addResult($result_array);
}
}
return;
}
示例3: __construct
private function __construct()
{
$this->inDB = cmsDatabase::getInstance();
cmsCore::loadLanguage('components/blogs');
cmsCore::loadLib('tags');
cmsCore::loadLib('karma');
}
示例4: __construct
function __construct(){
$this->inDB = cmsDatabase::getInstance();
$this->inCore = cmsCore::getInstance();
$this->config = $this->inCore->loadComponentConfig('users');
cmsCore::loadLanguage('components/users');
cmsCore::loadClass('form');
}
示例5: parseParams
private function parseParams()
{
global $_LANG;
// подключим LANG файл
cmsCore::loadLanguage('admin/' . (string) $this->xml->info->type . 's/' . (string) $this->xml->info->id);
$pref = mb_strtoupper(substr($this->xml->info->type, 0, 3));
foreach ($this->xml->params->param as $p) {
$param = array();
// заполняем атрибутами массив и приводим к строке значения
foreach ($p->attributes() as $key => $value) {
$param[$key] = (string) $value;
}
if ($param['name'] == 'tpl') {
continue;
}
// Если есть элементы списка
if (isset($p->option)) {
foreach ($p->option as $o) {
$opt = array();
foreach ($o->attributes() as $k => $v) {
$opt[$k] = (string) $v;
}
$tolk = $pref . '_' . mb_strtoupper($param['name'] . '_OPT' . ($opt['value'] ? '_' . $opt['value'] : ''));
$opt['title'] = isset($_LANG[$tolk]) ? $_LANG[$tolk] : (isset($opt['title']) ? $opt['title'] : '');
if (!$opt['title']) {
$opt['title'] = $opt['value'];
}
$param['tag_option'][] = $opt;
}
}
// Возможные lang ключи для параметров
// если ключ для поля есть, то возвращается его значение
// $param['name'] считается уникальным для каждого параметра xml
// на его основе и строим ключи
// если таких элеменов в массиве $_LANG нет, предполагаем, что соответствующие элементы
// title, hint и units заданы в xml и используем их
$ulk = $pref . '_' . mb_strtoupper($param['name']) . '_UNITS';
$tlk = $pref . '_' . mb_strtoupper($param['name']);
$hlk = $pref . '_' . mb_strtoupper($param['name']) . '_HINT';
$param['title'] = isset($_LANG[$tlk]) ? $_LANG[$tlk] : $param['title'];
if (!$param['title']) {
$param['title'] = $param['name'];
}
$param['hint'] = isset($_LANG[$hlk]) ? $_LANG[$hlk] : (isset($param['hint']) ? $param['hint'] : '');
$param['units'] = isset($_LANG[$ulk]) ? $_LANG[$ulk] : (isset($param['units']) ? $param['units'] : '');
//получаем значение параметра
$value = $this->getParamValue($param['name'], isset($param['default']) ? $param['default'] : '');
//если это массив, склеиваем в строку
if (is_array($value)) {
$value = implode('|', $value);
}
$param['value'] = $value;
$param['html'] = $this->getParamHTML($param);
$this->params[] = $param;
}
$param = array('type' => 'string', 'title' => $_LANG['AD_MODULE_TEMPLATE'], 'name' => 'tpl', 'value' => $this->getParamValue('tpl', ''));
$param['html'] = $this->getParamHTML($param);
$this->params[] = $param;
return;
}
示例6: __construct
public function __construct()
{
$this->inDB = cmsDatabase::getInstance();
$this->config = cmsCore::getInstance()->loadComponentConfig('clubs');
cmsCore::loadLanguage('components/clubs');
cmsCore::loadLib('karma');
}
示例7: __construct
public function __construct($labels = array())
{
$this->inDB = cmsDatabase::getInstance();
$this->config = cmsCore::getInstance()->loadComponentConfig('comments');
cmsCore::loadLanguage('components/comments');
$this->labels = array_merge(self::getDefaultLabels(), $labels);
}
示例8: search_photos
function search_photos($query, $look) {
$sql = "SELECT f.*, a.title as cat, a.id as cat_id
FROM cms_photo_files f
INNER JOIN cms_photo_albums a ON a.id = f.album_id AND a.published = 1 AND a.NSDiffer = ''
WHERE MATCH(f.title, f.description) AGAINST ('". $query ."' IN BOOLEAN MODE) AND f.published = 1";
$result = cmsCore::c('db')->query($sql);
if (cmsCore::c('db')->num_rows($result)) {
global $_LANG;
cmsCore::loadLanguage('components/photos');
while ($item = cmsCore::c('db')->fetch_assoc($result)) {
$result_array = array(
'link' => '/photos/photo'. $item['id'] .'.html',
'place' => $_LANG['PHOTOALBUM'] .' «'. $item['cat'] .'»',
'placelink' => '/photos/'. $item['cat_id'],
'description' => cmsCore::m('search')->getProposalWithSearchWord($item['description']),
'title' => $item['title'],
'imageurl' => (file_exists(PATH .'/images/photos/medium/'. $item['file']) ? '/images/photos/medium/'. $item['file'] : ''),
'pubdate' => $item['pubdate']
);
cmsCore::m('search')->addResult($result_array);
}
}
return;
}
示例9: search_faq
function search_faq($query, $look) {
global $_LANG;
$sql = "SELECT con.*, cat.title cat_title, cat.id cat_id
FROM cms_faq_quests con
INNER JOIN cms_faq_cats cat ON cat.id = con.category_id AND cat.published = 1
WHERE MATCH(con.quest, con.answer) AGAINST ('". $query ."' IN BOOLEAN MODE) AND con.published = 1 LIMIT 100";
$result = cmsCore::c('db')->query($sql);
if (cmsCore::c('db')->num_rows($result)) {
cmsCore::loadLanguage('components/faq');
while($item = cmsCore::c('db')->fetch_assoc($result)) {
$result_array = array(
'link' => '/faq/quest'. $item['id'] .'.html',
'place' => $_LANG['FAQ'] .' → '. $item['cat_title'],
'placelink' => '/faq/'. $item['cat_id'],
'description' => cmsCore::m('search')->getProposalWithSearchWord($item['answer']),
'title' => mb_substr($item['quest'], 0, 70) .'...',
'pubdate' => $item['pubdate']
);
cmsCore::m('search')->addResult($result_array);
}
}
return;
}
示例10: mod_search
function mod_search($module_id, $cfg)
{
cmsCore::loadModel('search');
cmsCore::loadLanguage('components/search');
$model = cms_model_search::initModel();
cmsPage::initTemplate('modules', $cfg['tpl'])->assign('enable_components', $model->getEnableComponentsWithSupportSearch())->display($cfg['tpl']);
return true;
}
示例11: mod_usersearch
function mod_usersearch($mod, $cfg) {
cmsCore::loadLanguage('components/users');
cmsPage::initTemplate('modules', $cfg['tpl'])->
assign('cfg', $cfg)->
display();
return true;
}
示例12: __construct
private function __construct($form_id, $values = array(), $is_admin = false)
{
$this->form_id = cmsDatabase::getInstance()->escape_string($form_id);
$this->values = $values;
$this->is_admin = $is_admin;
cmsCore::loadLanguage('components/forms');
$this->loadFormData();
$this->form_fields = $this->getFormFields($this->form_id);
}
示例13: sphinx_add_result_forum
function sphinx_add_result_forum($items) {
$inCore = cmsCore::getInstance();
global $_LANG;
cmsCore::loadLanguage('components/forum');
$config = $inCore->loadComponentConfig('forum');
$search_model = cms_model_search::initModel();
foreach ($items as $id => $item) {
if (!cmsCore::checkContentAccess($item['attrs']['access_list'])) { continue; }
$pages = ceil($item['attrs']['post_count'] / $config['pp_thread']);
$result_array = array(
'link' => '/forum/thread'. $id .'-'. $pages .'.html',
'place' => $item['attrs']['forum'],
'placelink' => '/forum/'. $item['attrs']['forum_id'],
'description' => $search_model->getProposalWithSearchWord($item['attrs']['description']),
'title' => $item['attrs']['title'],
'pubdate' => date('Y-m-d H:i:s', $item['attrs']['pubdate'])
);
$search_model->addResult($result_array);
}
// Ищем в тексте постов
$cl = new SphinxClient();
$cl->SetServer('127.0.0.1', 9312);
$cl->SetMatchMode(SPH_MATCH_EXTENDED2);
$cl->SetLimits(0, 100);
$result = $cl->Query($search_model->against, $search_model->config['Sphinx_Search']['prefix'] .'_forum_posts');
if ($result !== false) {
foreach ($result['matches'] as $id => $item) {
$pages = ceil($item['attrs']['post_count'] / $config['pp_thread']);
$post_page = ($pages > 1) ? postPage::getPage($item['attrs']['thread_id'], $id, $config['pp_thread']) : 1;
$result_array = array(
'link' => '/forum/thread'. $item['attrs']['thread_id'] .'-'. $post_page .'.html#'. $id,
'place' => $_LANG['FORUM_POST'],
'placelink' => '/forum/thread'. $item['attrs']['thread_id'] .'-'. $post_page .'.html#'. $id,
'description' => $search_model->getProposalWithSearchWord($item['attrs']['content_html']),
'title' => $item['attrs']['thread'],
'imageurl' => $item['attrs']['fileurl'],
'pubdate' => date('Y-m-d H:i:s', $item['attrs']['pubdate'])
);
$search_model->addResult($result_array);
}
}
return;
}
示例14: mod_user_stats
function mod_user_stats($module_id, $cfg)
{
$inDB = cmsDatabase::getInstance();
cmsCore::loadLanguage('components/users');
global $_LANG;
if (!isset($cfg['show_total'])) {
$cfg['show_total'] = 1;
}
if (!isset($cfg['show_online'])) {
$cfg['show_online'] = 1;
}
if (!isset($cfg['show_gender'])) {
$cfg['show_gender'] = 1;
}
if (!isset($cfg['show_city'])) {
$cfg['show_city'] = 1;
}
$total_usr = cmsUser::getCountAllUsers();
if ($cfg['show_gender']) {
$gender_stats = array();
//male
$gender_stats['male'] = $inDB->rows_count('cms_users u INNER JOIN cms_user_profiles p ON p.user_id = u.id', "u.is_locked = 0 AND u.is_deleted = 0 AND p.gender = 'm'");
//female
$gender_stats['female'] = $inDB->rows_count('cms_users u INNER JOIN cms_user_profiles p ON p.user_id = u.id', "u.is_locked = 0 AND u.is_deleted = 0 AND p.gender = 'f'");
//unknown
$gender_stats['unknown'] = $total_usr - $gender_stats['male'] - $gender_stats['female'];
}
if ($cfg['show_city']) {
$sql = "SELECT IF (p.city != '', p.city, '{$_LANG['NOT_DECIDE']}') city, COUNT( p.user_id ) count\n FROM cms_users u\n LEFT JOIN cms_user_profiles p ON p.user_id = u.id\n WHERE u.is_locked =0 AND u.is_deleted =0\n GROUP BY p.city";
$rs = $inDB->query($sql);
$city_stats = array();
if ($inDB->num_rows($rs)) {
while ($row = $inDB->fetch_assoc($rs)) {
if ($row['city'] != $_LANG['NOT_DECIDE']) {
$row['href'] = '/users/city/' . urlencode($row['city']);
} else {
$row['href'] = '';
}
$row['city'] = icms_ucfirst(mb_strtolower($row['city']));
$city_stats[] = $row;
}
}
}
if ($cfg['show_online']) {
$people = cmsUser::getOnlineCount();
}
if ($cfg['show_bday']) {
$bday = cmsUser::getBirthdayUsers();
}
cmsPage::initTemplate('modules', 'mod_user_stats')->assign('cfg', $cfg)->assign('total_usr', $total_usr)->assign('gender_stats', $gender_stats)->assign('city_stats', $city_stats)->assign('usr_online', cmsUser::sessionGet('usr_online'))->assign('people', $people)->assign('bday', $bday)->display('mod_user_stats.tpl');
return true;
}
示例15: __construct
public function __construct() {
$this->query = self::getQuery();
$this->look = cmsCore::request('look', 'str', 'allwords');
$this->page = cmsCore::request('page', 'int', 1);
$this->from_pubdate = cmsCore::request('from_pubdate', 'str', '');
$this->order_by_date = cmsCore::request('order_by_date', array(0, 1), 0);
$this->from_component = self::getComponentsArrayForSearch();
$this->config = cmsCore::getInstance()->loadComponentConfig('search');
cmsCore::loadLib('tags');
$this->getComponentsWithSupportSearch();
$this->parametrs_array = $this->gatherAnArrayOfQueryParametrs();
cmsCore::loadLanguage('other/sphinx');
}