当前位置: 首页>>代码示例>>PHP>>正文


PHP auth::get_existpages方法代码示例

本文整理汇总了PHP中auth::get_existpages方法的典型用法代码示例。如果您正苦于以下问题:PHP auth::get_existpages方法的具体用法?PHP auth::get_existpages怎么用?PHP auth::get_existpages使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在auth的用法示例。


在下文中一共展示了auth::get_existpages方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: plugin_ls2_show_lists

function plugin_ls2_show_lists($prefix, &$params)
{
    //	global $_ls2_err_nopages;
    $pages = array();
    if ($prefix != '') {
        foreach (auth::get_existpages() as $_page) {
            if (strpos($_page, $prefix) === 0) {
                $pages[] = $_page;
            }
        }
    } else {
        $pages = auth::get_existpages();
    }
    natcasesort($pages);
    if ($params['reverse']) {
        $pages = array_reverse($pages);
    }
    foreach ($pages as $page) {
        $params['page_ ' . $page] = 0;
    }
    if (empty($pages)) {
        return str_replace('$1', htmlspecialchars($prefix), '<p>' . _("There is no child page in ' \$1'") . '</p>');
    } else {
        $params['result'] = $params['saved'] = array();
        foreach ($pages as $page) {
            plugin_ls2_get_headings($page, $params, 1);
        }
        return join("\n", $params['result']) . join("\n", $params['saved']);
    }
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:30,代码来源:ls2.inc.php

示例2: build_directory_list

function build_directory_list($roots, $option = array())
{
    global $WikiName, $BracketName;
    $list = $warnings = array();
    $list['directory'] = $list['warning'] = array();
    $pages = auth::get_existpages();
    foreach ($roots as $root) {
        $matched = FALSE;
        foreach ($pages as $page) {
            // $page = strip_bracket($page);
            //			if (preg_match("/^$root.*$/", $page)){
            if (strpos($page, $root) === 0) {
                if (isset($option['directory only']) && $option['directory only'] && strrpos($page, '/') >= strlen($root)) {
                    $page = substr($page, 0, strrpos($page, '/'));
                }
                $list['directory'][] = $page;
                while (strrpos($page, '/') >= strlen($root)) {
                    $page = substr($page, 0, strrpos($page, '/'));
                    $list['directory'][] = $page;
                }
                $matched = TRUE;
            }
        }
        if (!$matched) {
            $list['directory'][] = $root;
            $warnings[] = '<font color="red">' . sprintf(_("#%s doesn't have the corresponding page. "), $root) . '</font>' . '(<a href="' . get_page_uri($root) . '">' . _('making') . "</a>)<br />\n";
        }
    }
    $list['directory'] = array_unique($list['directory']);
    natcasesort($list['directory']);
    if (isset($option['quiet']) && !$option['quiet']) {
        $list['warning'] = $warnings;
    }
    return $list;
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:35,代码来源:newpage_subdir.inc.php

示例3: plugin_tb_action

function plugin_tb_action()
{
    global $vars, $trackback;
    if (isset($vars['url'])) {
        // Receive and save a TrackBack Ping (both GET and POST)
        $url = $vars['url'];
        $tb_id = isset($vars['tb_id']) ? $vars['tb_id'] : '';
        plugin_tb_save($url, $tb_id);
        // Send a response (and exit)
    } else {
        if ($trackback && isset($vars['__mode']) && isset($vars['tb_id'])) {
            // Show TrackBacks received (and exit)
            switch ($vars['__mode']) {
                case 'rss':
                    plugin_tb_mode_rss($vars['tb_id']);
                    break;
                    // case 'view': plugin_tb_mode_view($vars['tb_id']); break;
                // case 'view': plugin_tb_mode_view($vars['tb_id']); break;
                case 'view':
                    return plugin_tb_mode_view($vars['tb_id']);
            }
        }
        // Show List of pages that TrackBacks reached
        $pages = auth::get_existpages(TRACKBACK_DIR, '.txt');
        if (!empty($pages)) {
            return array('msg' => 'Trackback list', 'body' => page_list($pages, 'read', FALSE));
        } else {
            return array('msg' => '', 'body' => '');
        }
    }
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:31,代码来源:tb.inc.php

示例4: count_files

function count_files($no = 0, $pref = '')
{
    // 0:DATA, 1:TB, 2:Referer, 3: DIFF, 4:BKUP, 5:CTR
    static $dir = array(DATA_DIR, TRACKBACK_DIR, REFERER_DIR, DIFF_DIR, BACKUP_DIR, COUNTER_DIR);
    static $ext = array('.txt', '.txt', '.ref', '.txt', BACKUP_EXT, '.count');
    // コンテンツ管理者以上は、全てのファイルを対象にする
    if (!auth::check_role('role_adm_contents')) {
        $pages = get_existpages($dir[$no], $ext[$no]);
    } else {
        // 自分が閲覧できるページ数のみ戻す
        $pages = auth::get_existpages($dir[$no], $ext[$no]);
    }
    // 条件なし
    if (empty($pref)) {
        return count($pages);
    }
    // 指定文書のカウント
    $i = 0;
    foreach ($pages as $page) {
        if (strpos($page, $pref) === 0) {
            $i++;
        }
    }
    return $i;
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:25,代码来源:count.inc.php

示例5: plugin_ls_convert

function plugin_ls_convert()
{
    global $vars;
    $with_title = FALSE;
    if (func_num_args()) {
        $args = func_get_args();
        $with_title = in_array('title', $args);
    }
    $prefix = $vars['page'] . '/';
    $pages = array();
    foreach (auth::get_existpages() as $page) {
        if (strpos($page, $prefix) === 0) {
            $pages[] = $page;
        }
    }
    natcasesort($pages);
    $ls = array();
    foreach ($pages as $page) {
        $comment = '';
        if ($with_title) {
            list($comment) = get_source($page);
            // 見出しの固有ID部を削除
            $comment = preg_replace('/^(\\*{1,3}.*)\\[#[A-Za-z][\\w-]+\\](.*)$/', '$1$2', $comment);
            $comment = '- ' . ereg_replace('^[-*]+', '', $comment);
        }
        $ls[] = "-[[{$page}]] {$comment}";
    }
    return convert_html($ls);
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:29,代码来源:ls.inc.php

示例6: plugin_deleted_action

function plugin_deleted_action()
{
    global $vars;
    $_deleted_plugin_title = _('The list of deleted pages');
    $_deleted_plugin_title_withfilename = _('The list of deleted pages (with filename)');
    $dir = isset($vars['dir']) ? $vars['dir'] : 'backup';
    $withfilename = isset($vars['file']);
    $_DIR['diff']['dir'] = DIFF_DIR;
    $_DIR['diff']['ext'] = '.txt';
    $_DIR['backup']['dir'] = BACKUP_DIR;
    $_DIR['backup']['ext'] = BACKUP_EXT;
    // .gz or .txt
    //$_DIR['cache' ]['dir'] = CACHE_DIR; // No way to delete them via web browser now
    //$_DIR['cache' ]['ext'] = '.ref';
    //$_DIR['cache' ]['ext'] = '.rel';
    if (!isset($_DIR[$dir])) {
        return array('msg' => 'Deleted plugin', 'body' => 'No such setting: Choose backup or diff');
    }
    $deleted_pages = array_diff(auth::get_existpages($_DIR[$dir]['dir'], $_DIR[$dir]['ext']), auth::get_existpages());
    if ($withfilename) {
        $retval['msg'] = $_deleted_plugin_title_withfilename;
    } else {
        $retval['msg'] = $_deleted_plugin_title;
    }
    $retval['body'] = page_list($deleted_pages, $dir, $withfilename);
    return $retval;
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:27,代码来源:deleted.inc.php

示例7: plugin_referer_action

function plugin_referer_action()
{
    global $vars, $referer;
    global $_referer_msg;
    // Setting: Off
    if (!$referer) {
        return array('msg' => '', 'body' => '');
    }
    if (isset($vars['page']) && $vars['page'] != '' && is_page($vars['page'])) {
        $sort = empty($vars['sort']) ? '0d' : $vars['sort'];
        return array('msg' => $_referer_msg['msg_H0_Refer'], 'body' => plugin_referer_body($vars['page'], $sort));
    }
    $pages = auth::get_existpages(TRACKBACK_DIR, '.ref');
    if (empty($pages)) {
        return array('msg' => '', 'body' => '');
    } else {
        $body = '';
        $sort = empty($vars['sort']) ? '0d' : $vars['sort'];
        foreach ($pages as $page) {
            $body .= '<h2>' . make_pagelink($page) . '</h2>';
            $body .= plugin_referer_body($page, $sort);
        }
        return array('msg' => 'referer list', 'body' => $body);
    }
}
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:25,代码来源:referer.inc.php

示例8: plugin_yetlist_action

function plugin_yetlist_action()
{
    //	global $_title_yetlist, $_err_notexist, $_symbol_noexists, $non_list;
    global $_symbol_noexists, $non_list, $whatsdeleted;
    $retval = array('msg' => _('List of pages which have not yet been created.'), 'body' => '');
    // Diff
    $pages = array_diff(auth::get_existpages(CACHE_DIR, '.ref'), auth::get_existpages());
    if (empty($pages)) {
        $retval['body'] = _('All pages have been created.');
        return $retval;
    }
    $empty = TRUE;
    // Load .ref files and Output
    $refer_regex = '/' . $non_list . '|^' . preg_quote($whatsdeleted, '/') . '$/S';
    asort($pages, SORT_STRING);
    foreach ($pages as $file => $page) {
        $refer = array();
        foreach (file(CACHE_DIR . $file) as $line) {
            list($_page) = explode("\t", rtrim($line));
            $refer[] = $_page;
        }
        // Diff
        $refer = array_diff($refer, preg_grep($refer_regex, $refer));
        if (!empty($refer)) {
            $empty = FALSE;
            $refer = array_unique($refer);
            sort($refer, SORT_STRING);
            $r_refer = '';
            $link_refs = array();
            foreach ($refer as $_refer) {
                $r_refer = rawurlencode($_refer);
                $link_refs[] = '<a href="' . get_page_uri($_refer) . '">' . htmlspecialchars($_refer) . '</a>';
            }
            $link_ref = join(' ', $link_refs);
            unset($link_refs);
            $s_page = htmlspecialchars($page);
            //			if (PKWK_READONLY) {
            if (auth::check_role('readonly')) {
                $href = $s_page;
            } else {
                // Dangling link
                $href = '<span class="noexists">' . $s_page . '<a href="' . get_cmd_uri('edit', $page, '', 'refer=' . $r_refer) . '">' . $_symbol_noexists . '</a></span>';
            }
            $retval['body'] .= '<li>' . $href . ' <em>(' . $link_ref . ')</em></li>' . "\n";
        }
    }
    if ($empty) {
        $retval['body'] = $_err_notexist;
        return $retval;
    }
    if ($retval['body'] != '') {
        $retval['body'] = '<ul>' . "\n" . $retval['body'] . '</ul>' . "\n";
    }
    return $retval;
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:55,代码来源:yetlist.inc.php

示例9: plugin_list_getlist

function plugin_list_getlist($withfilename = FALSE, $listcmd = 'read')
{
    global $non_list, $whatsnew;
    $pages = array_diff(auth::get_existpages(), array($whatsnew));
    if (!$withfilename) {
        $pages = array_diff($pages, preg_grep('/' . $non_list . '/S', $pages));
    }
    if (empty($pages)) {
        return '';
    }
    $cmd = $listcmd == 'read' || $listcmd == 'edit' ? $listcmd : 'read';
    return page_list($pages, $cmd, $withfilename);
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:13,代码来源:list.inc.php

示例10: plugin_loglist_convert

function plugin_loglist_convert()
{
    global $script, $log;
    global $vars;
    global $_loglist_messages;
    @(list($kind) = func_get_args());
    $kind = empty($kind) ? 'update' : htmlspecialchars($kind, ENT_QUOTES);
    if (!$log[$kind]['use']) {
        return $_loglist_messages['not_active'];
    }
    if (!empty($log[$kind]['file'])) {
        $vars['kind'] = $kind;
        $rc = do_plugin_action('logview');
        return $rc['body'];
    }
    $dir = log::get_filename($kind, '', '');
    $pages = auth::get_existpages($dir);
    if (count($pages) == 0) {
        return $_loglist_messages['msg_not_found'];
    }
    $data = array();
    foreach ($pages as $_real => $_page) {
        $data[] = array(filemtime($dir . '/' . $_real), $_page, log_count($kind, $_page));
    }
    usort($data, create_function('$a,$b', 'return $b[0] - $a[0];'));
    // D
    // usort($data,create_function('$a,$b','return $a[0] - $b[0];')); // A
    $str_view = $script . '?plugin=logview&kind=' . $kind . '&page=';
    $rc = '';
    $rc .= '|' . $_loglist_messages['fld_UTIME'] . '|' . $_loglist_messages['fld_PAGE'] . '|' . $_loglist_messages['fld_COUNT'] . "|h\n";
    foreach ($data as $_line) {
        $i = 0;
        foreach ($_line as $_field) {
            $rc .= '|';
            switch ($i) {
                case 0:
                    $rc .= get_date('Y-m-d H:i:s', $_field) . ' ' . get_passage($_field);
                    continue;
                case 1:
                    $rc .= '[' . $str_view . rawurlencode($_field) . ' ' . $_field . ']';
                    continue;
                default:
                    $rc .= $_field;
            }
            $i++;
        }
        $rc .= "|\n";
    }
    return convert_html($rc);
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:50,代码来源:loglist.inc.php

示例11: plugin_random_action

function plugin_random_action()
{
    global $vars;
    $pattern = strip_bracket($vars['refer']) . '/';
    $pages = array();
    foreach (auth::get_existpages() as $_page) {
        if (strpos($_page, $pattern) === 0) {
            $pages[$_page] = strip_bracket($_page);
        }
    }
    srand((double) microtime() * 1000000);
    $page = array_rand($pages);
    if ($page != '') {
        $vars['refer'] = $page;
    }
    return array('body' => '', 'msg' => '');
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:17,代码来源:random.inc.php

示例12: plugin_referer_action

function plugin_referer_action()
{
    global $vars, $referer;
    global $_referer_msg;
    // Setting: Off
    if (!$referer) {
        return array('msg' => '', 'body' => '');
    }
    if (isset($vars['page']) && is_page($vars['page'])) {
        check_readable($vars['page'], false);
        $sort = empty($vars['sort']) ? '0d' : $vars['sort'];
        return array('msg' => $_referer_msg['msg_H0_Refer'], 'body' => plugin_referer_body($vars['page'], $sort));
    }
    $pages = auth::get_existpages(REFERER_DIR, '.ref');
    if (empty($pages)) {
        return array('msg' => '', 'body' => '');
    } else {
        return array('msg' => 'referer list', 'body' => page_list($pages, 'referer', FALSE));
    }
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:20,代码来源:referer.inc.php

示例13: plugin_touchgraph_ref

function plugin_touchgraph_ref()
{
    foreach (auth::get_existpages() as $page) {
        if (check_non_list($page)) {
            continue;
        }
        $file = CACHE_DIR . encode($page) . '.ref';
        if (file_exists($file)) {
            echo $page;
            foreach (file($file) as $line) {
                list($name) = explode("\t", $line);
                if (check_non_list($name)) {
                    continue;
                }
                echo ' ', $name;
            }
            echo "\n";
        }
    }
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:20,代码来源:touchgraph.inc.php

示例14: plugin_nonlist_getlist

function plugin_nonlist_getlist($cmd = 0)
{
    global $non_list, $whatsnew;
    if ($cmd == 0) {
        $pages = array_diff(auth::get_existpages(), array($whatsnew));
        $pages = preg_grep('/' . $non_list . '/S', $pages);
        if (empty($pages)) {
            return '';
        }
        return page_list($pages, 'read', false);
    }
    $pages = array_diff(auth::get_existpages(), array($whatsnew));
    // : のみ抜粋
    $pages = preg_grep('/^\\:/S', $pages);
    if ($cmd == 2) {
        $pages = preg_grep('/^\\:config\\//S', $pages);
    }
    if (empty($pages)) {
        return '';
    }
    return page_list($pages, 'read', false);
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:22,代码来源:nonlist.inc.php

示例15: replace_do

function replace_do($search, $replace, $notimestamp)
{
    global $cycle, $cantedit;
    global $_replace_msg;
    // パスワードが合ってたらいよいよ置換
    $pages = auth::get_existpages();
    $replaced_pages = array();
    foreach ($pages as $page) {
        if (REPLACE_IGNORE_FREEZE) {
            $editable = !in_array($page, $cantedit);
        } else {
            $editable = (!is_freeze($page) and !in_array($page, $cantedit));
        }
        if ($editable) {
            // パスワード一致
            $postdata = '';
            $postdata_old = get_source($page);
            foreach ($postdata_old as $line) {
                // キーワードの置換
                $line = str_replace($search, $replace, $line);
                $postdata .= $line;
            }
            if ($postdata != join('', $postdata_old)) {
                $cycle = 0;
                set_time_limit(30);
                page_write($page, $postdata, $notimestamp);
                $replaced_pages[] = htmlspecialchars($page);
            }
        }
    }
    $vars['cmd'] = 'read';
    if (count($replaced_pages) == 0) {
        return array('msg' => $_replace_msg['msg_H0_no_data'], 'body' => '<p>' . $_replace_msg['msg_no_replaced'] . '</p>');
    }
    return array('msg' => $_replace_msg['msg_H0_replaced'], 'body' => '<p>' . $_replace_msg['msg_replaced'] . "</p>\n<p>" . join("<br />\n", $replaced_pages) . '</p>');
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:36,代码来源:replace.inc.php


注:本文中的auth::get_existpages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。