本文整理汇总了PHP中Localization::replacePlaceholder方法的典型用法代码示例。如果您正苦于以下问题:PHP Localization::replacePlaceholder方法的具体用法?PHP Localization::replacePlaceholder怎么用?PHP Localization::replacePlaceholder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Localization
的用法示例。
在下文中一共展示了Localization::replacePlaceholder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Localization
if (empty($data['language'])) {
$language_file = $settings['default_page_language'] . '.page.lang.php';
} else {
$language_file = $data['language'] . '.page.lang.php';
}
#require('./cms/includes/classes/Localization.class.php');
#$loc = new Localization('./cms/lang/'.$language_file);
$localization = new Localization(BASE_PATH . 'cms/lang/' . $language_file);
mb_internal_encoding(Localization::$lang['charset']);
#require('./cms/lang/'.$language_file);
#$template->set_lang($lang);
setlocale(LC_ALL, Localization::$lang['locale']);
define('CHARSET', Localization::$lang['charset']);
#define('TIME_FORMAT', Localization::$lang['time_format']);
#define('TIME_FORMAT_FULL', Localization::$lang['time_format_full']);
$localization->replacePlaceholder('page', $data['title'], 'back_title');
$template->assign('website_title', $settings['website_title']);
$template->assign('photo_data', $photo_data);
$template->assign('page', $data['page']);
$template->assign('title', $data['title']);
$template->assign('settings', $settings);
if (isset($_SESSION[$settings['session_prefix'] . 'user_id'])) {
$template->assign('admin', true);
}
// photo comments:
if ($settings['photos_commentable'] == 1) {
$show_comments = $photo->show_comments();
$template->assign('show_comments', $show_comments);
include BASE_PATH . 'cms/includes/photo_comment.inc.php';
}
#header('Content-Type: text/html; charset='.$lang['charset']);
示例2: intval
$template->assign('status', intval($data['status']));
if ($data['page'] == $settings['index_page']) {
$template->assign('canonical', BASE_URL);
}
if (isset($_SESSION[$settings['session_prefix'] . 'user_id']) && is_authorized_to_edit($_SESSION[$settings['session_prefix'] . 'user_id'], $_SESSION[$settings['session_prefix'] . 'user_type'], $data['author'], $data['edit_permission'], $data['edit_permission_general'])) {
$authorized_to_edit = true;
} else {
$authorized_to_edit = false;
}
$template->assign('authorized_to_edit', $authorized_to_edit);
$template->assign('timestamp', $data['time']);
#$template->assign('created', format_time($loc->lang['time_format'], $data['time']));
#$template->assign('last_modified', format_time($loc->lang['time_format'], $data['last_modified']));
if ($data['display_time'] == 1) {
$template->assign('display_time', true);
$localization->replacePlaceholder('time', $data['time'], 'page_time', Localization::FORMAT_TIME);
} else {
$template->assign('display_time', false);
}
$localization->replacePlaceholder('last_modified', $data['last_modified'], 'page_last_modified', Localization::FORMAT_TIME);
$localization->replacePlaceholder('created', $data['time'], 'page_last_modified', Localization::FORMAT_TIME);
#$template->assign('lang', $lang['lang']);
$content_type = $data['content_type'] ? $data['content_type'] : 'text/html';
#$charset = $data['charset'] ? $data['charset'] : $loc->lang['charset'];
$template_file = $data['template'];
if ($data['type'] != 'default') {
include BASE_PATH . 'cms/config/page_types.conf.php';
if (isset($page_types[$data['type']]['page_type'])) {
include BASE_PATH . 'cms/includes/page_types/' . $page_types[$data['type']]['page_type'];
}
} else {