本文整理汇总了PHP中Anchors::check_better_lang方法的典型用法代码示例。如果您正苦于以下问题:PHP Anchors::check_better_lang方法的具体用法?PHP Anchors::check_better_lang怎么用?PHP Anchors::check_better_lang使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Anchors
的用法示例。
在下文中一共展示了Anchors::check_better_lang方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$context['content_wrap'] = 'article';
global $render_overlaid;
$whole_rendering = !$render_overlaid;
if ($render_overlaid) {
$context['text'] .= '<div class="hidden require-overlaid"></div>' . "\n";
}
// view.php/12/nick name induces no particular processing
// sanity check
if ($zoom_index < 1) {
$zoom_index = 1;
}
// get the item from the database
$item = Articles::get($id);
// redirect to another article with a better suitable language, if any
if ($item['nick_name']) {
Anchors::check_better_lang('article:' . $item['id'], $item['nick_name']);
}
// get owner profile, if any
$owner = array();
if (isset($item['owner_id'])) {
$owner = Users::get($item['owner_id']);
}
// get the related overlay, if any
$overlay = NULL;
if (isset($item['overlay'])) {
$overlay = Overlay::load($item, 'article:' . $item['id']);
}
// get the related anchor, if any
$anchor = NULL;
if (isset($item['anchor'])) {
$anchor = Anchors::get($item['anchor']);
示例2: elseif
} elseif (isset($context['arguments'][1]) && isset($context['arguments'][2])) {
$zoom_type = $context['arguments'][1];
$zoom_index = $context['arguments'][2];
}
// sanity check
if ($zoom_index < 1) {
$zoom_index = 1;
}
// get the item from the database
$item = Sections::get($id);
if (!$item) {
Safe::redirect($context['url_to_root'] . 'error.php');
}
// redirect to another section with a better suitable language, if any
if ($item['nick_name']) {
Anchors::check_better_lang('section:' . $item['id'], $item['nick_name']);
}
// get the related overlay, if any
$overlay = NULL;
if (isset($item['overlay'])) {
$overlay = Overlay::load($item, 'section:' . $item['id']);
}
// get the overlay for content of this section, if any
$content_overlay = NULL;
if (isset($item['content_overlay'])) {
$content_overlay = Overlay::bind($item['content_overlay']);
}
$section_overlay = NULL;
if (isset($item['section_overlay'])) {
$section_overlay = Overlay::bind($item['section_overlay']);
}