本文整理汇总了PHP中isVisiblePage函数的典型用法代码示例。如果您正苦于以下问题:PHP isVisiblePage函数的具体用法?PHP isVisiblePage怎么用?PHP isVisiblePage使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isVisiblePage函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: media_filesinuse
/**
* Lists pages which currently use a media file selected for deletion
*
* References uses the same visual as search results and share
* their CSS tags except pagenames won't be links.
*
* @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
*/
function media_filesinuse($data, $id)
{
global $lang;
echo '<h1>' . $lang['reference'] . ' <code>' . hsc(noNS($id)) . '</code></h1>';
echo '<p>' . hsc($lang['ref_inuse']) . '</p>';
$hidden = 0;
//count of hits without read permission
foreach ($data as $row) {
if (auth_quickaclcheck($row) >= AUTH_READ && isVisiblePage($row)) {
echo '<div class="search_result">';
echo '<span class="mediaref_ref">' . hsc($row) . '</span>';
echo '</div>';
} else {
$hidden++;
}
}
if ($hidden) {
print '<div class="mediaref_hidden">' . $lang['ref_hidden'] . '</div>';
}
}
示例2: _ft_pageLookup
function _ft_pageLookup(&$data)
{
// split out original parameters
$id = $data['id'];
if (preg_match('/(?:^| )@(\\w+)/', $id, $matches)) {
$ns = cleanID($matches[1]) . ':';
$id = str_replace($matches[0], '', $id);
}
$in_ns = $data['in_ns'];
$in_title = $data['in_title'];
$cleaned = cleanID($id);
$Indexer = idx_get_indexer();
$page_idx = $Indexer->getPages();
$pages = array();
if ($id !== '' && $cleaned !== '') {
foreach ($page_idx as $p_id) {
if (strpos($in_ns ? $p_id : noNSorNS($p_id), $cleaned) !== false) {
if (!isset($pages[$p_id])) {
$pages[$p_id] = p_get_first_heading($p_id, METADATA_DONT_RENDER);
}
}
}
if ($in_title) {
foreach ($Indexer->lookupKey('title', $id, '_ft_pageLookupTitleCompare') as $p_id) {
if (!isset($pages[$p_id])) {
$pages[$p_id] = p_get_first_heading($p_id, METADATA_DONT_RENDER);
}
}
}
}
if (isset($ns)) {
foreach (array_keys($pages) as $p_id) {
if (strpos($p_id, $ns) !== 0) {
unset($pages[$p_id]);
}
}
}
// discard hidden pages
// discard nonexistent pages
// check ACL permissions
foreach (array_keys($pages) as $idx) {
if (!isVisiblePage($idx) || !page_exists($idx) || auth_quickaclcheck($idx) < AUTH_READ) {
unset($pages[$idx]);
}
}
uksort($pages, 'ft_pagesorter');
return $pages;
}
示例3: _ft_pageLookup
function _ft_pageLookup(&$data)
{
// split out original parameters
$id = $data['id'];
if (preg_match('/(?:^| )@(\\w+)/', $id, $matches)) {
$ns = cleanID($matches[1]) . ':';
$id = str_replace($matches[0], '', $id);
}
$in_ns = $data['in_ns'];
$in_title = $data['in_title'];
$pages = array_map('rtrim', idx_getIndex('page', ''));
$titles = array_map('rtrim', idx_getIndex('title', ''));
$pages = array_combine($pages, $titles);
if ($id !== '' && cleanID($id) !== '') {
$cleaned = cleanID($id);
$matched_pages = array();
foreach ($pages as $p_id => $p_title) {
if ((strpos($in_ns ? $p_id : noNSorNS($p_id), $cleaned) !== false || $in_title && stripos($p_title, $id) !== false) && (!isset($ns) || strpos($p_id, $ns) === 0)) {
$matched_pages[$p_id] = $p_title;
}
}
$pages = $matched_pages;
}
// discard hidden pages
// discard nonexistent pages
// check ACL permissions
foreach (array_keys($pages) as $idx) {
if (!isVisiblePage($idx) || !page_exists($idx) || auth_quickaclcheck($idx) < AUTH_READ) {
unset($pages[$idx]);
}
}
uasort($pages, 'ft_pagesorter');
return $pages;
}
示例4: _ft_pageLookup
function _ft_pageLookup(&$data)
{
global $conf;
// split out original parameters
$id = $data['id'];
if (preg_match('/(?:^| )@(\\w+)/', $id, $matches)) {
$ns = cleanID($matches[1]) . ':';
$id = str_replace($matches[0], '', $id);
}
$in_ns = $data['in_ns'];
$in_title = $data['in_title'];
$pages = array_map('rtrim', idx_getIndex('page', ''));
$titles = array_map('rtrim', idx_getIndex('title', ''));
// check for corrupt title index #FS2076
if (count($pages) != count($titles)) {
$titles = array_fill(0, count($pages), '');
@unlink($conf['indexdir'] . '/title.idx');
// will be rebuilt in inc/init.php
}
$pages = array_combine($pages, $titles);
$cleaned = cleanID($id);
if ($id !== '' && $cleaned !== '') {
foreach ($pages as $p_id => $p_title) {
if (strpos($in_ns ? $p_id : noNSorNS($p_id), $cleaned) === false && (!$in_title || stripos($p_title, $id) === false)) {
unset($pages[$p_id]);
}
}
}
if (isset($ns)) {
foreach (array_keys($pages) as $p_id) {
if (strpos($p_id, $ns) !== 0) {
unset($pages[$p_id]);
}
}
}
// discard hidden pages
// discard nonexistent pages
// check ACL permissions
foreach (array_keys($pages) as $idx) {
if (!isVisiblePage($idx) || !page_exists($idx) || auth_quickaclcheck($idx) < AUTH_READ) {
unset($pages[$idx]);
}
}
uksort($pages, 'ft_pagesorter');
return $pages;
}