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


PHP get_existpages函数代码示例

本文整理汇总了PHP中get_existpages函数的典型用法代码示例。如果您正苦于以下问题:PHP get_existpages函数的具体用法?PHP get_existpages怎么用?PHP get_existpages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: 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

示例2: convert

 /**
  * Block Plugin Main Function
  */
 function convert()
 {
     sonots::init_myerror();
     do {
         // try
         $args = func_get_args();
         $argline = csv_implode(',', $args);
         $argoptions = PluginSonotsOption::parse_option_line($argline);
         list($options, $unknowns) = PluginSonotsOption::evaluate_options($argoptions, $this->conf_options);
         $options = $this->check_options($options, $unknowns, $this->conf_options);
         if (sonots::mycatch()) {
             break;
         }
         if (isset($options['tag'])) {
             $plugin_tag = new PluginSonotsTag();
             $pages = $plugin_tag->get_taggedpages($options['tag']);
         } elseif (isset($options['prefix'])) {
             $pages = sonots::get_existpages($options['prefix']);
         } else {
             $pages = get_existpages();
         }
         $pagelist = $this->pagelist($pages, $options, $argoptions);
         $navipages = $this->get_navipages($pagelist, $options);
         $html = $this->display_navi($navipages, $options['look'], $options['border'], $this->conf['printcss']);
         return $html;
     } while (false);
     if (sonots::mycatch()) {
         // catch
         return '<p>#' . $this->plugin . '(): ' . sonots::mycatch() . '</p>';
     }
 }
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:34,代码来源:navix.inc.php

示例3: plugin_deleted_action

function plugin_deleted_action()
{
    global $vars;
    global $_deleted_plugin_title, $_deleted_plugin_title_withfilename;
    $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(get_existpages($_DIR[$dir]['dir'], $_DIR[$dir]['ext']), 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:geoemon2k,项目名称:source_wiki,代码行数:26,代码来源:deleted.inc.php

示例4: 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 (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:geoemon2k,项目名称:source_wiki,代码行数:29,代码来源:ls.inc.php

示例5: plugin_tb_action

function plugin_tb_action()
{
    global $trackback, $vars;
    if ($trackback && 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'] : '';
        list($error, $message) = plugin_tb_save($url, $tb_id);
        // Output the response
        plugin_tb_output_response($error, $message);
        exit;
    } else {
        if ($trackback && isset($vars['__mode']) && isset($vars['tb_id'])) {
            // Show TrackBacks received (and exit)
            switch ($vars['__mode']) {
                case 'rss':
                    plugin_tb_output_rsslist($vars['tb_id']);
                    break;
                case 'view':
                    plugin_tb_output_htmllist($vars['tb_id']);
                    break;
            }
            exit;
        } else {
            // Show List of pages that TrackBacks reached
            $pages = 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:nsmr0604,项目名称:pukiwiki,代码行数:34,代码来源:tb.inc.php

示例6: plugin_ls2_show_lists

function plugin_ls2_show_lists($prefix, &$params)
{
    global $_ls2_err_nopages;
    $pages = array();
    if ($prefix != '') {
        foreach (get_existpages() as $_page) {
            if (strpos($_page, $prefix) === 0) {
                $pages[] = $_page;
            }
        }
    } else {
        $pages = 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', htmlsc($prefix), $_ls2_err_nopages);
    } 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:geoemon2k,项目名称:source_wiki,代码行数:30,代码来源:ls2.inc.php

示例7: build_directory_list

function build_directory_list($roots, $option)
{
    global $WikiName, $BracketName, $script;
    $existingPages = get_existpages();
    foreach ($roots as $root) {
        $matched = false;
        foreach ($existingPages as $page) {
            $page = strip_bracket($page);
            //			if (preg_match("/^$root.*$/", $page)){
            if (strpos($page, $root) === 0) {
                if ($option['directory only'] && strrpos($page, "/") >= strlen($root)) {
                    $page = substr($page, 0, strrpos($page, "/"));
                    $list["directory"][] = $page;
                } else {
                    $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\">#{$root} は該当するページがありません。</font>\n\t\t\t(<a href=\"{$script}?" . rawurlencode($root) . "\">作成</a>)<br>\n";
        }
    }
    $list["directory"] = array_unique($list["directory"]);
    natcasesort($list["directory"]);
    if (!$option["quiet"]) {
        $list["warning"] = $warnings;
    }
    return $list;
}
开发者ID:lolo3-sight,项目名称:wiki,代码行数:35,代码来源:newpage_subdir.inc.php

示例8: plugin_yetlist_action

function plugin_yetlist_action()
{
    global $non_list;
    global $whatsdeleted;
    $qm = get_qm();
    $retval = array('msg' => $qm->m['plg_yetlist']['title'], 'body' => '');
    // Diff
    $pages = array_diff(get_existpages(CACHE_DIR, '.ref'), get_existpages());
    if (empty($pages)) {
        $retval['body'] = $qm->m['plg_yetlist']['err_notexist'];
        return $retval;
    }
    $empty = TRUE;
    // Load .ref files and Output
    $script = get_script_uri();
    $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="' . $script . '?' . $r_refer . '">' . htmlspecialchars($_refer) . '</a>';
            }
            $link_ref = join(' ', $link_refs);
            unset($link_refs);
            $s_page = htmlspecialchars($page);
            if (PKWK_READONLY) {
                $href = $s_page;
            } else {
                // Dangling link
                $href = '<span class="noexists">' . $s_page . '<a href="' . $script . '?cmd=edit&amp;page=' . rawurlencode($page) . '&amp;refer=' . $r_refer . '">' . $qm->m['fmt_symbol_noexists'] . '</a></span>';
            }
            $retval['body'] .= '<li>' . $href . ' <em>(' . $link_ref . ')</em></li>' . "\n";
        }
    }
    if ($empty) {
        $retval['body'] = $qm->m['plg_yetlist']['err_notexist'];
        return $retval;
    }
    if ($retval['body'] != '') {
        $retval['body'] = '<ul>' . "\n" . $retval['body'] . '</ul>' . "\n";
    }
    return $retval;
}
开发者ID:big2men,项目名称:qhm,代码行数:56,代码来源:yetlist.inc.php

示例9: plugin_list_getlist

function plugin_list_getlist($withfilename = false)
{
    global $non_list, $whatsnew;
    $pages = array_diff(get_existpages(), array($whatsnew));
    if (!$withfilename) {
        $pages = array_diff($pages, preg_grep('/' . $non_list . '/S', $pages));
    }
    if (empty($pages)) {
        return '';
    }
    return page_list($pages, 'read', $withfilename);
}
开发者ID:nsmr0604,项目名称:pukiwiki,代码行数:12,代码来源:list.inc.php

示例10: get_filtered_pages

 /**
  * Get filtered pages
  *
  * @param string $filter regular expression
  * @param string $page 
  * @return array pages
  */
 function get_filtered_pages($filter, $page)
 {
     if ($page != '') {
         return array($page);
     }
     $pages = get_existpages();
     //auth::get_existpages();
     if ($filter != '') {
         $filter = '/' . str_replace('/', '\\/', $filter) . '/';
         foreach ($pages as $file => $apage) {
             if (!preg_match($filter, $apage)) {
                 unset($pages[$file]);
             }
         }
     }
     return $pages;
 }
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:24,代码来源:delete.inc.php

示例11: plugin_list_getlist

function plugin_list_getlist($withfilename = FALSE)
{
    global $non_list, $whatsnew, $style_name;
    $pages = array_diff(get_existpages(), array($whatsnew));
    if (!$withfilename) {
        $pages = array_diff($pages, preg_grep('/' . $non_list . '/S', $pages));
    }
    if (empty($pages)) {
        return '';
    }
    if (ss_admin_check()) {
        $style_name = '..';
        return plugin_list_create_html(plugin_list_array($pages), $withfilename);
    } else {
        return page_list($pages, 'read', $withfilename);
    }
}
开发者ID:big2men,项目名称:qhm,代码行数:17,代码来源:list.inc.php

示例12: plugin_random_action

function plugin_random_action()
{
    global $vars;
    $pattern = strip_bracket($vars['refer']) . '/';
    $pages = array();
    foreach (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:KimuraYoichi,项目名称:PukiWiki,代码行数:17,代码来源:random.inc.php

示例13: plugin_referer_action

function plugin_referer_action()
{
    global $vars, $referer;
    $qm = get_qm();
    // Setting: Off
    if (!$referer) {
        return array('msg' => '', 'body' => '');
    }
    if (isset($vars['page']) && is_page($vars['page'])) {
        $sort = empty($vars['sort']) ? '0d' : $vars['sort'];
        return array('msg' => $qm->m['plg_referer']['title'], 'body' => plugin_referer_body($vars['page'], $sort));
    }
    $pages = get_existpages(TRACKBACK_DIR, '.ref');
    if (empty($pages)) {
        return array('msg' => '', 'body' => '');
    } else {
        return array('msg' => $qm->m['plg_referer']['title_list'], 'body' => page_list($pages, 'referer', FALSE));
    }
}
开发者ID:big2men,项目名称:qhm,代码行数:19,代码来源:referer.inc.php

示例14: 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'])) {
        $sort = empty($vars['sort']) ? '0d' : $vars['sort'];
        return array('msg' => $_referer_msg['msg_H0_Refer'], 'body' => plugin_referer_body($vars['page'], $sort));
    }
    $pages = get_existpages(TRACKBACK_DIR, '.ref');
    if (empty($pages)) {
        return array('msg' => '', 'body' => '');
    } else {
        return array('msg' => 'referer list', 'body' => page_list($pages, 'referer', false));
    }
}
开发者ID:nsmr0604,项目名称:pukiwiki,代码行数:19,代码来源:referer.inc.php

示例15: gen_metas

 /**
  * Generate the specific meta infomration to pages
  *
  * @access public
  * @param string $metakey meta information name
  * @param array $args if arguments required to set meta information
  * @version $Id: v 1.0 2008-06-07 07:23:17Z sonots $
  */
 function gen_metas($metakey, $args = array())
 {
     switch ($metakey) {
         case 'leaf':
             // tree can't be constructed item by item
             $leafs = sonots::get_tree(get_existpages());
             foreach ($this->metapages as $i => $val) {
                 $page = $this->metapages[$i]->page;
                 $this->metapages[$i]->leaf = $leafs[$page];
             }
             break;
         default:
             // others can be
             $metapages =& $this->metapages;
             foreach ($metapages as $i => $val) {
                 call_user_func_array(array(&$metapages[$i], 'gen_' . $metakey), $args);
             }
             break;
     }
 }
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:28,代码来源:pagelist.class.php


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