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


PHP get_filetime函数代码示例

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


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

示例1: make_backup

/**
 * make_backup
 * バックアップを作成する
 *
 * @access    public
 * @param     String    $page        ページ名
 * @param     Boolean   $delete      TRUE:バックアップを削除する
 *
 * @return    Void
 */
function make_backup($page, $delete = FALSE)
{
    global $cycle, $maxage;
    global $do_backup, $del_backup;
    // if (PKWK_READONLY || ! $do_backup) return;
    if (auth::check_role('readonly') || !$do_backup) {
        return;
    }
    if ($del_backup && $delete) {
        _backup_delete($page);
        return;
    }
    if (!is_page($page)) {
        return;
    }
    $lastmod = _backup_get_filetime($page);
    if ($lastmod == 0 || UTIME - $lastmod > 60 * 60 * $cycle) {
        $backups = get_backup($page);
        $count = count($backups) + 1;
        // 直後に1件追加するので、(最大件数 - 1)を超える要素を捨てる
        if ($count > $maxage) {
            array_splice($backups, 0, $count - $maxage);
        }
        $strout = '';
        foreach ($backups as $age => $data) {
            // BugTrack/685 by UPK
            //$strout .= PKWK_SPLITTER . ' ' . $data['time'] . "\n"; // Splitter format
            $strout .= PKWK_SPLITTER . ' ' . $data['time'] . ' ' . $data['real'] . "\n";
            // Splitter format
            $strout .= join('', $data['data']);
            unset($backups[$age]);
        }
        $strout = preg_replace("/([^\n])\n*\$/", "\$1\n", $strout);
        // Escape 'lines equal to PKWK_SPLITTER', by inserting a space
        $body = preg_replace('/^(' . preg_quote(PKWK_SPLITTER) . "\\s\\d+(\\s(\\d+)|))\$/", '$1 ', get_source($page));
        // BugTrack/685 by UPK
        // $body = PKWK_SPLITTER . ' ' . get_filetime($page) . "\n" . join('', $body);
        $body = PKWK_SPLITTER . ' ' . get_filetime($page) . ' ' . UTIME . "\n" . join('', $body);
        $body = preg_replace("/\n*\$/", "\n", $body);
        $fp = _backup_fopen($page, 'wb') or die_message('Cannot open ' . htmlspecialchars(_backup_get_filename($page)) . '<br />Maybe permission is not writable or filename is too long');
        _backup_fputs($fp, $strout);
        _backup_fputs($fp, $body);
        _backup_fclose($fp);
    }
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:55,代码来源:backup.php

示例2: plugin_lastmod_inline

function plugin_lastmod_inline()
{
    global $vars;
    global $WikiName, $BracketName;
    $args = func_get_args();
    if ($args[0]) {
        if (preg_match("/^({$WikiName}|\\[\\[{$BracketName}\\]\\])\$/", $args[0])) {
            $_page = get_fullname(strip_bracket($args[0]), $vars["page"]);
        } else {
            return FALSE;
        }
    } else {
        $_page = $vars["page"];
    }
    if (!is_page($_page)) {
        return FALSE;
    }
    return format_date(get_filetime($_page));
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:19,代码来源:lastmod.inc.php

示例3: plugin_lastmod_inline

function plugin_lastmod_inline()
{
    global $vars, $WikiName, $BracketName;
    $args = func_get_args();
    $page = $args[0];
    if ($page == '') {
        $page = $vars['page'];
        // Default: page itself
    } else {
        if (preg_match("/^({$WikiName}|{$BracketName})\$/", strip_bracket($page))) {
            $page = get_fullname(strip_bracket($page), $vars['page']);
        } else {
            return false;
        }
    }
    if (!is_page($page)) {
        return false;
    }
    return format_date(get_filetime($page));
}
开发者ID:nsmr0604,项目名称:pukiwiki,代码行数:20,代码来源:lastmod.inc.php

示例4: timestamp

 /**
  * Get timestamp of a page
  *
  * @access public
  * @static
  * @param string $page
  * @return string
  */
 function timestamp($page)
 {
     return get_filetime($page);
 }
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:12,代码来源:metapage.class.php

示例5: addRow

 function addRow($pagename, $rescan = FALSE)
 {
     // Generate/Regenerate regex if needed
     if ($this->_generate_regex() === FALSE) {
         return FALSE;
     }
     if (isset($this->_added[$pagename])) {
         return TRUE;
     }
     $this->_added[$pagename] = TRUE;
     $source = plugin_tracker_get_source($pagename, TRUE);
     if ($source === FALSE) {
         $source = '';
     }
     // Compat: 'move to [[page]]' (like bugtrack plugin)
     $matches = array();
     if (!$rescan && !empty($source) && preg_match('/move\\sto\\s(.+)/', $source, $matches)) {
         $to_page = strip_bracket(trim($matches[1]));
         if (is_page($to_page)) {
             unset($source, $matches);
             // Release
             return $this->addRow($to_page, TRUE);
             // Recurse(Rescan) once
         }
     }
     // Default column
     $filetime = get_filetime($pagename);
     $row = array('_page' => $pagename, '_real' => $pagename, '_update' => $filetime, '_past' => $filetime);
     // Load / Redefine cell
     $matches = array();
     if (preg_match($this->pattern, $source, $matches)) {
         array_shift($matches);
         // $matches[0] = all of the captured string
         foreach ($this->pattern_fields as $key => $fieldname) {
             $row[$fieldname] = trim($matches[$key]);
             unset($matches[$key]);
         }
         $this->rows[] = $row;
     } else {
         if (PLUGIN_TRACKER_LIST_SHOW_ERROR_PAGE) {
             $this->rows[] = $row;
             // Error
         }
     }
     return TRUE;
 }
开发者ID:TakeAsh,项目名称:php-TakeAsh-PKWK-Mod,代码行数:46,代码来源:tracker.inc.php

示例6: plugin_new_inline

function plugin_new_inline()
{
    global $vars, $_plugin_new_elapses;
    $retval = '';
    $args = func_get_args();
    $date = strip_autolink(array_pop($args));
    // {date} always exists
    if ($date !== '') {
        // Show 'New!' message by the time of the $date string
        if (func_num_args() > 2) {
            return '&new([nodate]){date};';
        }
        $timestamp = strtotime($date);
        if ($timestamp === -1) {
            return '&new([nodate]){date}: Invalid date string;';
        }
        $timestamp -= ZONETIME;
        $retval = in_array('nodate', $args) ? '' : htmlsc($date);
    } else {
        // Show 'New!' message by the timestamp of the page
        if (func_num_args() > 3) {
            return '&new(pagename[,nolink]);';
        }
        $name = strip_bracket(!empty($args) ? array_shift($args) : $vars['page']);
        $page = get_fullname($name, $vars['page']);
        $nolink = in_array('nolink', $args);
        if (substr($page, -1) == '/') {
            // Check multiple pages started with "$page"
            $timestamp = 0;
            $regex = '/^' . preg_quote($page, '/') . '/';
            foreach (preg_grep($regex, get_existpages()) as $page) {
                // Get the latest pagename and its timestamp
                $_timestamp = get_filetime($page);
                if ($timestamp < $_timestamp) {
                    $timestamp = $_timestamp;
                    $retval = $nolink ? '' : make_pagelink($page);
                }
            }
            if ($timestamp == 0) {
                return '&new(pagename/[,nolink]): No such pages;';
            }
        } else {
            // Check a page
            if (is_page($page)) {
                $timestamp = get_filetime($page);
                $retval = $nolink ? '' : make_pagelink($page, $name);
            } else {
                return '&new(pagename[,nolink]): No such page;';
            }
        }
    }
    // Add 'New!' string by the elapsed time
    $erapse = UTIME - $timestamp;
    foreach ($_plugin_new_elapses as $limit => $tag) {
        if ($erapse <= $limit) {
            $retval .= sprintf($tag, get_passage($timestamp));
            break;
        }
    }
    if ($date !== '') {
        // Show a date string
        return sprintf(PLUGIN_NEW_DATE_FORMAT, $retval);
    } else {
        // Show a page name
        return $retval;
    }
}
开发者ID:nsmr0604,项目名称:pukiwiki,代码行数:67,代码来源:new.inc.php

示例7: get_filetime

<?php

if ($lastmodified) {
    $filetime = get_filetime($title);
    // refer lib/func.php#get_passage
    static $units = array('分' => 60, '時間' => 24, '日' => 1);
    $time = max(0, (UTIME - $filetime) / 60);
    // minutes
    foreach ($units as $unit => $card) {
        if ($time < $card) {
            break;
        }
        $time /= $card;
    }
    $time = floor($time);
    $pg_passage = $filetime != 0 ? $time . $unit . '前' : '';
    echo '<p id="last-modified">';
    if ($card == "60" && $time <= $fresh_time) {
        echo '今さっき更新 ';
    } elseif ($card == "1" && $time <= "2") {
        if ($time == "1") {
            echo '昨日更新';
        } elseif ($time == "2") {
            echo '一昨日更新';
        }
    } else {
        if ($pg_passage) {
            echo 'だいたい' . $pg_passage . 'に更新';
        } else {
            echo '今さっき更新';
        }
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:31,代码来源:module.lastmodified.inc.php

示例8: plugin_ls2_1_get_headings

function plugin_ls2_1_get_headings($page, &$params, $level = 1, $include = false, $prefix, $top_level = 1, &$pages)
{
    global $script;
    static $_ls2_anchor = 0;
    // すでにこのページの見出しを表示したかどうかのフラグ
    $is_done = isset($params["page_{$page}"]) && $params["page_{$page}"] > 0;
    if (!$is_done) {
        $params["page_{$page}"] = ++$_ls2_anchor;
    }
    $s_page = htmlspecialchars($page);
    $title = $s_page . ' ' . get_pg_passage($page, false);
    $r_page = rawurlencode($page);
    $href = $script . '?' . $r_page;
    // relative オプション。リンク名制御。
    if ($params['relative']) {
        // パターンの最後の / 以下を取り除く。例) sample/test/d -> sample/test
        // $prefix_dir = preg_replace('/[^\/]+$/','',$prefix);
        if (($pos = strrpos($prefix, '/')) !== false) {
            $prefix_dir = substr($prefix, 0, $pos + 1);
        }
        // ページ名からそのパターンをとり除く。
        // $s_page = ereg_replace("^$prefix_dir",'',$s_page);
        $s_page = substr($s_page, strlen($prefix_dir));
        // relative オプションと hierarchy オプションが同時に指定された場合は
        // パターンを取り除くだけでなく、上位の存在しているページ名も取り除く。
        if ($params['display'] == 'hierarchy') {
            $tmp = $s_page;
            // depth オプションが指定されていた場合 $top_level が変わります。
            while (substr_count($tmp, "/") > $top_level - 1) {
                // 一階層ずつとりのぞく
                if (($pos = strrpos($tmp, '/')) !== false) {
                    $tmp = substr($tmp, 0, $pos);
                }
                // 上位のページが存在していれば、その文字列を取り除き、相対名にする。
                if (in_array($prefix_dir . $tmp, $pages)) {
                    // $s_page = ereg_replace("^$tmp/",'',$s_page);
                    $s_page = substr($s_page, strlen("{$tmp}/"));
                    break;
                }
            }
        }
    }
    // date オプション。更新日時の追加。
    $date = '';
    if ($params['date']) {
        $date = format_date(get_filetime($page));
    }
    // new オプション。New! 表示の追加。
    $new = '';
    if ($params['new']) {
        global $_plugin_new_elapses;
        $timestamp = get_filetime($page) - LOCALZONE;
        $erapse = UTIME - $timestamp;
        foreach ($_plugin_new_elapses as $limit => $tag) {
            if ($erapse <= $limit) {
                $new .= sprintf($tag, get_passage($timestamp));
                break;
            }
        }
    }
    plugin_ls2_1_list_push($params, $level);
    // LI TAG. display オプションに依る。plugin_ls2_1_list_push にも。
    if ($params['display'] == 'inline') {
        $litag = '';
    } else {
        $litag = '<li>';
    }
    array_push($params['result'], $litag);
    // include されたページの場合
    if ($include) {
        $ret = 'include ';
    } else {
        $ret = '';
    }
    // すでに表示済みなら必ずファイル内探索処理はせずに抜ける
    if ($is_done) {
        $ret .= '<a href="' . $href . '" title="' . $title . '">' . $s_page . '</a> ';
        $ret .= '<a href="#list_' . $params["page_{$page}"] . '"><sup>&uarr;</sup></a>';
        array_push($params['result'], $ret);
        return;
    }
    $ret .= '<a id="list_' . $params["page_{$page}"] . '" href="' . $href . '" title="' . $title . '">' . $s_page . '</a>';
    if ($date != '') {
        $ret .= " {$date}";
    }
    if ($new != '') {
        $ret .= " {$new}";
    }
    array_push($params['result'], $ret);
    // title オプション、include オプション時はファイル内探索もする
    if ($params['title'] || $params['include']) {
        $anchor = PLUGIN_LS2_1_ANCHOR_ORIGIN;
        $matches = array();
        // 全体で title_number 個ではなく各ファイル単位で title_number 個
        $title_counter = 0;
        foreach (get_source($page) as $line) {
            if ($params['title'] && preg_match('/^(\\*{1,3})/', $line, $matches)) {
                if ($params['title_number']) {
                    // ただの件数制限なので途中で抜けても $anchor には不整合はでないはず
                    if ($title_counter >= $params['title_number']) {
//.........这里部分代码省略.........
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:101,代码来源:ls2_1.inc.php

示例9: plugin_backup_convert

function plugin_backup_convert()
{
    global $vars, $script;
    //	global $_msg_backuplist, $_msg_diff, $_msg_nowdiff, $_msg_source, $_msg_nobackup;
    //	global $_title_backup_delete;
    $page = isset($vars['page']) ? $vars['page'] : '';
    check_readable($page, false);
    $_msg_backuplist = _('List of Backups');
    $_msg_diff = _('diff');
    $_msg_nowdiff = _('diff current');
    $_msg_source = _('source');
    $_msg_nobackup = _('There are no backup(s) of $1.');
    $_title_backup_delete = _('Deleting backup of $1');
    // Get arguments
    $with_label = TRUE;
    $args = func_get_args();
    while (isset($args[0])) {
        switch (array_shift($args)) {
            case 'default':
                $diff_mode = 0;
                break;
            case 'nowdiff':
                $diff_mode = 1;
                break;
            case 'visualdiff':
                $diff_mode = 2;
                break;
            case 'label':
                $with_label = TRUE;
                break;
            case 'nolabel':
                $with_label = FALSE;
                break;
        }
    }
    $r_page = rawurlencode($page);
    $s_page = htmlspecialchars($page);
    $retval = array();
    $date = get_date("m/d", get_filetime($page));
    if ($with_label) {
        $retval[0] = <<<EOD
<form class="center_form" action=""><div><label>Versions:
<select onchange="javascript:location.href=this[this.selectedIndex].value">

EOD;
        $retval[1] = "\n";
        $retval[2] = <<<EOD
</select></label></div>
</form>

EOD;
    } else {
        $retval[0] = <<<EOD
<form class="center_form" action=""><div>
<select onchange="javascript:location.href=this[this.selectedIndex].value">

EOD;
        $retval[1] = "\n";
        $retval[2] = <<<EOD
</select>
</div></form>

EOD;
    }
    $backups = _backup_file_exists($page) ? get_backup($page) : array();
    if (count($backups) == 0) {
        $retval[1] .= '<option value="' . get_page_uri($page) . '" selected="selected">' . _('->') . " {$date}(No.1)</option>\n";
        return join('', $retval);
    }
    $maxcnt = count($backups) + 1;
    $retval[1] .= '<option value="' . get_page_uri($page) . '" selected="selected">' . _('->') . " {$date}(No.{$maxcnt})</option>\n";
    $backups = array_reverse($backups, True);
    foreach ($backups as $age => $data) {
        $time = isset($data['real']) ? $data['real'] : $data['time'];
        $date = get_date('m/d', $time);
        $href = $script . '?cmd=backup&amp;page=' . $r_page . '&amp;age=' . $age;
        $retval[1] .= '<option value="' . $href;
        switch ($diff_mode) {
            case 2:
                $retval[1] .= '&amp;action=visualdiff';
                break;
            case 1:
                $retval[1] .= '&amp;action=nowdiff';
                break;
        }
        $retval[1] .= '">' . $date . ' (No.' . $age . ')</option>' . "\n";
    }
    return join('', $retval);
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:89,代码来源:backup.inc.php

示例10: do_search


//.........这里部分代码省略.........
 * @global array _string. messages
 */
function do_search($word, $type = 'AND', $non_format = FALSE, $base = '')
{
    global $script, $whatsnew, $non_list, $search_non_list, $search_auth, $show_passage, $search_word_color, $ajax, $_string;
    //	       $_msg_andresult, $_msg_orresult, $_msg_notfoundresult;
    $retval = array();
    $b_type = $type == 'AND';
    // AND:TRUE OR:FALSE
    $keys = get_search_words(preg_split('/\\s+/', $word, -1, PREG_SPLIT_NO_EMPTY));
    foreach ($keys as $key => $value) {
        $keys[$key] = '/' . $value . '/S';
    }
    $pages = get_existpages();
    // Avoid
    if ($base != '') {
        $pages = preg_grep('/^' . preg_quote($base, '/') . '/S', $pages);
    }
    if (!$search_non_list) {
        $pages = array_diff($pages, preg_grep('/' . $non_list . '/S', $pages));
    }
    $pages = array_flip($pages);
    unset($pages[$whatsnew]);
    // SAFE_MODE の場合は、コンテンツ管理者以上のみ、カテゴリページ(:)も検索可能
    $role_adm_contents = auth::check_role('safemode') ? auth::check_role('role_adm_contents') : FALSE;
    $count = count($pages);
    foreach (array_keys($pages) as $page) {
        $b_match = FALSE;
        // Search hidden for page name
        if (substr($page, 0, 1) == ':' && $role_adm_contents) {
            unset($pages[$page]);
            --$count;
            continue;
        }
        // Search for page name
        if (!$non_format) {
            foreach ($keys as $key) {
                $b_match = preg_match($key, $page);
                if ($b_type xor $b_match) {
                    break;
                }
                // OR
            }
            if ($b_match) {
                continue;
            }
        }
        // Search auth for page contents
        if ($search_auth && !check_readable($page, false, false)) {
            unset($pages[$page]);
            --$count;
            continue;
        }
        // Search for page contents
        foreach ($keys as $key) {
            $b_match = preg_match($key, get_source($page, TRUE, TRUE));
            if ($b_match xor $b_type) {
                break;
            }
            // OR
        }
        if ($b_match) {
            continue;
        }
        unset($pages[$page]);
        // Miss
    }
    unset($role_adm_contents);
    if ($non_format) {
        return array_keys($pages);
    }
    $r_word = rawurlencode($word);
    $s_word = htmlspecialchars($word);
    if (empty($pages)) {
        return str_replace('$1', $s_word, $_string['notfoundresult']);
    }
    ksort($pages);
    $retval = '<ul>' . "\n";
    foreach (array_keys($pages) as $page) {
        $r_page = rawurlencode($page);
        $s_page = htmlspecialchars($page);
        $passage = $show_passage ? ' ' . get_passage(get_filetime($page)) : '';
        if ($search_word_color) {
            $uri = $script . '?' . 'cmd=read&amp;page=' . $r_page . '&amp;word=' . $r_word;
            if ($ajax && UA_PROFILE == 'default') {
                $pre = $script . '?' . 'cmd=preview&amp;page=' . $r_page . '&amp;word=' . $r_word;
                $pre = ' onmouseover="showGlossaryPopup(' . "'" . $pre . "'" . ',event,0.2);" onmouseout="hideGlossaryPopup();"';
            } else {
                $pre = '';
            }
        } else {
            $uri = $script . '?' . $r_page;
            $pre = '';
        }
        $retval .= ' <li><a href="' . $uri . '"' . $pre . '>' . $s_page . '</a>' . $passage . '</li>' . "\n";
    }
    $retval .= '</ul>' . "\n";
    $retval .= str_replace('$1', $s_word, str_replace('$2', count($pages), str_replace('$3', $count, $b_type ? $_string['andresult'] : $_string['orresult'])));
    return $retval;
}
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:101,代码来源:func.php

示例11: catbody


//.........这里部分代码省略.........
    $link_freeze =& $_LINK['freeze'];
    $link_unfreeze =& $_LINK['unfreeze'];
    $link_upload =& $_LINK['upload'];
    $link_template =& $_LINK['copy'];
    $link_refer =& $_LINK['refer'];
    // New!
    $link_rename =& $_LINK['rename'];
    $link_delete =& $_LINK['delete'];
    $link_menuadmin =& $_LINK['menuadmin'];
    //Hokuken.com original
    $link_copy =& $_LINK['copy'];
    $link_qhm_adminmenu =& $_LINK['qhm_adminmenu'];
    //Hokuken.com original
    $link_qhm_logout =& $_LINK['qhm_logout'];
    //Hokuken.com original
    $link_qhm_setting =& $_LINK['qhm_setting'];
    //Hokuken.com original
    $link_edit_menu =& $_LINK['edit_menu'];
    //Hokuken.com original
    $link_edit_menu2 =& $_LINK['edit_menu2'];
    $link_edit_navi =& $_LINK['edit_navi'];
    //Hokuken.com original
    $link_edit_navi2 =& $_LINK['edit_navi2'];
    //Hokuken.com original
    $link_edit_header =& $_LINK['edit_header'];
    //Hokuken.com original
    $link_yetlist =& $_LINK['yetlist'];
    //Hokuken.com original
    // Init flags
    $is_page = is_pagename($_page) && $_page != $whatsnew;
    $is_read = arg_check('read') && is_page($_page);
    $is_freeze = is_freeze($_page);
    // Last modification date (string) of the page
    $lastmodified = $is_read ? format_date(get_filetime($_page)) . ' ' . get_pg_passage($_page, FALSE) : '';
    // List of attached files to the page
    $attaches = $attach_link && $is_read && exist_plugin_action('attach') ? attach_filelist() : '';
    // List of related pages
    $related = $related_link && $is_read ? make_related($_page) : '';
    // List of footnotes
    ksort($foot_explain, SORT_NUMERIC);
    $notes = !empty($foot_explain) ? $note_hr . join("\n", $foot_explain) : '';
    // Tags will be inserted into <head></head>
    $head_tag = !empty($head_tags) ? join("\n", $head_tags) . "\n" : '';
    // 1.3.x compat
    // Last modification date (UNIX timestamp) of the page
    $fmt = $is_read ? get_filetime($_page) + LOCALZONE : 0;
    // Search words
    if ($search_word_color && isset($vars['word'])) {
        $body = '<div class="small">' . $_msg_word . htmlspecialchars($vars['word']) . '</div>' . $hr . "\n" . $body;
        // BugTrack2/106: Only variables can be passed by reference from PHP 5.0.5
        // with array_splice(), array_flip()
        $words = preg_split('/\\s+/', $vars['word'], -1, PREG_SPLIT_NO_EMPTY);
        $words = array_splice($words, 0, 10);
        // Max: 10 words
        $words = array_flip($words);
        $keys = array();
        foreach ($words as $word => $id) {
            $keys[$word] = strlen($word);
        }
        arsort($keys, SORT_NUMERIC);
        $keys = get_search_words(array_keys($keys), TRUE);
        $id = 0;
        foreach ($keys as $key => $pattern) {
            $s_key = htmlspecialchars($key);
            $pattern = '/' . '<textarea[^>]*>.*?<\\/textarea>' . '|' . '<[^>]*>' . '|' . '&[^;]+;' . '|' . '(' . $pattern . ')' . '/sS';
            $decorate_Nth_word = create_function('$matches', 'return (isset($matches[1])) ? ' . '\'<strong class="word' . $id . '">\' . $matches[1] . \'</strong>\' : ' . '$matches[0];');
开发者ID:big2men,项目名称:qhm,代码行数:67,代码来源:html.php

示例12: catbody

function catbody($title,$page,$body)
{
	global $script,$vars,$arg,$defaultpage,$whatsnew,$help_page,$hr;
	global $related_link,$cantedit,$function_freeze,$search_word_color,$_msg_word;
	global $foot_explain,$note_hr,$head_tags;
	
	global $html_transitional; // FALSE:XHTML1.1 TRUE:XHTML1.0 Transitional
	global $page_title;        // ホームページのタイトル
	global $do_backup;         // バックアップを行うかどうか
	global $modifier;          // 編集者のホームページ
	global $modifierlink;      // 編集者の名前

	$_page = $vars['page'];
	$r_page = rawurlencode($_page);
	
	$link_add      = "$script?cmd=add&amp;page=$r_page";
	$link_edit     = "$script?cmd=edit&amp;page=$r_page";
	$link_diff     = "$script?cmd=diff&amp;page=$r_page";
	$link_top      = "$script?".rawurlencode($defaultpage);
	$link_list     = "$script?cmd=list";
	$link_filelist = "$script?cmd=filelist";
	$link_search   = "$script?cmd=search";
	$link_whatsnew = "$script?".rawurlencode($whatsnew);
	$link_backup   = "$script?cmd=backup&amp;page=$r_page";
	$link_help     = "$script?".rawurlencode($help_page);
	$link_rss      = "$script?cmd=rss10";
	$link_freeze   = "$script?cmd=freeze&amp;page=$r_page";
	$link_unfreeze = "$script?cmd=unfreeze&amp;page=$r_page";
	$link_upload   = "$script?plugin=attach&amp;pcmd=upload&amp;page=$r_page";
	$link_template = "$script?plugin=template&amp;refer=$r_page";
	$link_rename   = "$script?plugin=rename&amp;refer=$r_page";
	
	// ページの表示時TRUE(バックアップの表示、RecentChangesの表示を除く)
	$is_page = (is_pagename($_page) and !arg_check('backup') and $_page != $whatsnew);
	
	// ページの読み出し時TRUE
	$is_read = (arg_check('read') and is_page($_page));
	
	// ページが凍結されているときTRUE
	$is_freeze = is_freeze($_page);
	
	// ページの最終更新時刻(文字列)
	$lastmodified = $is_read ?
		get_date('D, d M Y H:i:s T',get_filetime($_page)).' '.get_pg_passage($_page,FALSE) : '';
	
	// 関連するページのリスト
	$related = ($is_read and $related_link) ? make_related($_page) : '';
	
	// 添付ファイルのリスト
	$attaches = ($is_read and exist_plugin_action('attach')) ? attach_filelist() : '';
	
	// 注釈のリスト
	ksort($foot_explain,SORT_NUMERIC);
	$notes = count($foot_explain) ? $note_hr.join("\n",$foot_explain) : '';
	
	// <head>内に追加するタグ
	$head_tag = count($head_tags) ? join("\n",$head_tags)."\n" : '';
	
	// 1.3.x compat
	// ページの最終更新時刻(UNIX timestamp)
	$fmt = $is_read ? get_filetime($_page) + LOCALZONE : 0;

	//単語検索
	if ($search_word_color and array_key_exists('word',$vars))
	{
		$body = '<div class="small">'.$_msg_word.htmlspecialchars($vars['word'])."</div>$hr\n$body";
		$words = array_flip(array_splice(preg_split('/\s+/',$vars['word'],-1,PREG_SPLIT_NO_EMPTY),0,10));
		$keys = array();
		foreach ($words as $word=>$id)
		{
			$keys[$word] = strlen($word);
		}
		arsort($keys,SORT_NUMERIC);
		$keys = get_search_words(array_keys($keys),TRUE);
		$id = 0;
		foreach ($keys as $key=>$pattern)
		{
			$s_key = htmlspecialchars($key);
			$pattern = "/(<[^>]*>)|($pattern)/";
			$callback = create_function(
				'$arr',
				'return $arr[1] ? $arr[1] : "<strong class=\"word'.$id++.'\">{$arr[2]}</strong>";'
			);
			$body = preg_replace_callback($pattern,$callback,$body);
			$notes = preg_replace_callback($pattern,$callback,$notes);
		}
	}
	
	$longtaketime = getmicrotime() - MUTIME;
	$taketime = sprintf('%01.03f',$longtaketime);
	
	if (!file_exists(SKIN_FILE)||!is_readable(SKIN_FILE))
	{
		die_message(SKIN_FILE.'(skin file) is not found.');
	}
	require(SKIN_FILE);
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:97,代码来源:html.php

示例13: plugin_sitemap_action

function plugin_sitemap_action()
{
    global $whatsnew, $non_list;
    global $vars;
    $prefix = isset($vars['page']) ? strip_bracket($vars['page']) : '';
    $script = get_script_uri();
    $recent = CACHE_DIR . 'recent.dat';
    $sitemapcache = CACHE_DIR . 'sitemap.' . ($prefix != '' ? encode($prefix) . '.' : '') . 'xml';
    if (!file_exists($recent) or !file_exists($sitemapcache) or filemtime($recent) >= filemtime($sitemapcache)) {
        // Get all pages
        $pages = array();
        foreach (get_existpages() as $page) {
            if ($page != $whatsnew and !preg_match("/{$non_list}/", $page) and ($prefix == '' or strpos($page, $prefix . '/') === 0) and (PLUGIN_SITEMAP_PAGE_ALLOW == '' or preg_match('/' . PLUGIN_SITEMAP_PAGE_ALLOW . '/', $page)) and (PLUGIN_SITEMAP_PAGE_DISALLOW == '' or !preg_match('/' . PLUGIN_SITEMAP_PAGE_DISALLOW . '/', $page))) {
                if (check_readable($page, false, false)) {
                    $pages[$page] = get_filetime($page);
                }
            }
        }
        // Sort by time
        arsort($pages, SORT_NUMERIC);
        // <url>
        $urls = '';
        $count = PLUGIN_SITEMAP_MAXSHOW;
        foreach ($pages as $page => $time) {
            if ($count > 0) {
                $r_page = rawurlencode($page);
                $link = $script . '?' . $r_page;
                $date = gmdate('Y-m-d\\TH:i:s', $time + ZONETIME) . '+00:00';
                $priority = '';
                $changefreq = '';
                $show = true;
                $_priority = 0.5;
                if (PLUGIN_SITEMAP_READ_PAGES) {
                    foreach (get_source($page) as $line) {
                        if (substr($line, 0, 1) == ' ') {
                            continue;
                        }
                        if (substr($line, 0, 2) == '//') {
                            continue;
                        }
                        if (preg_match('/^#([^\\(]+)(?:\\((.*)\\))?/', $line, $matches)) {
                            if (PLUGIN_SITEMAP_PLUGIN_PRIORITY_UP != '' and preg_match('/^' . PLUGIN_SITEMAP_PLUGIN_PRIORITY_UP . '$/', $matches[1], $matches2)) {
                                $_priority += 0.2;
                            }
                            if (PLUGIN_SITEMAP_PLUGIN_PRIORITY_DOWN != '' and preg_match('/^' . PLUGIN_SITEMAP_PLUGIN_PRIORITY_DOWN . '$/', $matches[1], $matches2)) {
                                $_priority -= 0.1;
                            }
                            if ($matches[1] == 'sitemap') {
                                $_priority = 0.5;
                                if (preg_match('/\\b(\\d\\.\\d)\\b/', $matches[2], $matches2)) {
                                    $_priority = floatval($matches2[1]);
                                }
                                if (preg_match('/\\b(always|hourly|daily|weekly|monthly|yearly|never)\\b/', $matches[2], $matches2)) {
                                    $changefreq = $matches2[1];
                                }
                                if (preg_match('/\\bnone\\b/', $matches[2], $matches2)) {
                                    $show = false;
                                }
                                break;
                            } elseif (preg_match('/^' . PLUGIN_SITEMAP_PLUGIN_NO_FOLLOW . '$/', $matches[1], $matches2)) {
                                $show = false;
                            }
                        } elseif (preg_match('/&([^\\(]+)(?:\\((.*)\\))?;/', $line, $matches)) {
                            if (PLUGIN_SITEMAP_PLUGIN_PRIORITY_UP != '' and preg_match('/^' . PLUGIN_SITEMAP_PLUGIN_PRIORITY_UP . '$/', $matches[1], $matches2)) {
                                $_priority += 0.2;
                            }
                            if (PLUGIN_SITEMAP_PLUGIN_PRIORITY_DOWN != '' and preg_match('/^' . PLUGIN_SITEMAP_PLUGIN_PRIORITY_DOWN . '$/', $matches[1], $matches2)) {
                                $_priority -= 0.1;
                            }
                        }
                    }
                }
                if ($_priority > 1) {
                    $_priority = 1;
                }
                if ($_priority < 0) {
                    $_priority = 0;
                }
                $priority = sprintf('%1.1f', $_priority);
                if ($show) {
                    $urls .= "  <url>\n";
                    if ($link != '') {
                        $urls .= "    <loc>{$link}</loc>\n";
                    }
                    if ($date != '') {
                        $urls .= "    <lastmod>{$date}</lastmod>\n";
                    }
                    if ($changefreq != '') {
                        $urls .= "    <changefreq>{$changefreq}</changefreq>\n";
                    }
                    if ($priority != '') {
                        $urls .= "    <priority>{$priority}</priority>\n";
                    }
                    $urls .= "  </url>\n";
                    $count--;
                }
            } else {
                break;
            }
        }
//.........这里部分代码省略.........
开发者ID:big2men,项目名称:qhm,代码行数:101,代码来源:sitemap.inc.php

示例14: plugin_adm_auth_wkgrp_convert

function plugin_adm_auth_wkgrp_convert()
{
    global $_adm_auth_wkgrp_msg, $_LANG;
    if (Auth::check_role('role_adm')) {
        return '';
    }
    if (!PLUGIN_ADM_AUTH_WKGRP_USE_WRITE_FUNC) {
        return '';
    }
    $config_page_name = ':config/' . CONFIG_AUTH_WKGRP;
    $msg = '';
    $script = Router::get_script_uri();
    $cmd_view = Router::get_page_uri($config_page_name);
    $cmd_edit = Router::get_cmd_uri('edit', $config_page_name);
    $cmd_guiedit = Router::get_cmd_uri('guiedit', $config_page_name);
    $cmd_check = Router::get_cmd_uri('adm_auth_wkgrp', '', '', array('pcmd' => 'check'));
    $cmd_import = Router::get_cmd_uri('adm_auth_wkgrp', '', '', array('pcmd' => 'import'));
    $filetime_auth_wkgrp = filemtime(PKWK_AUTH_WKGRP_FILE);
    $date_auth_wkgrp = format_date($filetime_auth_wkgrp);
    if (is_page($config_page_name)) {
        $filetime_config_page = get_filetime($config_page_name);
        $date_config_page = format_date($filetime_config_page);
        $guide_msg = $filetime_config_page > $filetime_auth_wkgrp ? '<strong>' . $_adm_auth_wkgrp_msg['msg_gen'] . '</strong>' : '';
        $link_page = <<<EOD
[<a href="{$cmd_edit}">{$_LANG['skin']['edit']}</a>]
[<a href="{$cmd_guiedit}">{$_LANG['skin']['guiedit']}</a>]

EOD;
        $link_file = <<<EOD
<form action="{$script}" method="post" class="adm_auth_wkgrp_form">
\t<input type="hidden" name="cmd" value="adm_auth_wkgrp" />
\t<input type="hidden" name="pcmd" value="gen" />
\t<input type="submit" class="btn btn-secondary" value="{$_adm_auth_wkgrp_msg['btn_gen']}" />
\t{$guide_msg}
</form>

EOD;
    } else {
        $date_config_page = 'N/A';
        $link_page = '[<a href="' . $cmd_import . '">' . $_adm_auth_wkgrp_msg['msg_import'] . '</a>]';
        $link_file = '';
    }
    $rc = <<<EOD
<div class="adm_auth_wkgrp">
\t<fieldset>
\t\t<legend>{$_adm_auth_wkgrp_msg['head_title']}</legend>
\t\t<table class="table">
\t\t\t<thead>
\t\t\t\t<tr>
\t\t\t\t\t<th>
\t\t\t\t\t\t{$_adm_auth_wkgrp_msg['msg_head_page']}
\t\t\t\t\t\t(<a href="{$cmd_view}">{$_adm_auth_wkgrp_msg['msg_view']}</a>)
\t\t\t\t\t</td>
\t\t\t\t\t<th>
\t\t\t\t\t\t{$_adm_auth_wkgrp_msg['msg_head_file']}
\t\t\t\t\t\t(<a href="{$cmd_check}">{$_adm_auth_wkgrp_msg['msg_check']}</a>)
\t\t\t\t\t</td>
\t\t\t\t</tr>
\t\t\t</thead>
\t\t\t<tbody>
\t\t\t\t<tr>
\t\t\t\t\t<td>{$_adm_auth_wkgrp_msg['msg_head_update']}: {$date_config_page}</td>
\t\t\t\t\t<td>{$_adm_auth_wkgrp_msg['msg_head_gen']}: {$date_auth_wkgrp}</td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t\t<td>{$link_page}</td>
\t\t\t\t\t<td>{$link_file}</td>
\t\t\t\t</tr>
\t\t\t</tbody>
\t\t</table>
\t</fieldset>
</div>
EOD;
    return $rc;
}
开发者ID:logue,项目名称:pukiwiki_adv,代码行数:75,代码来源:adm_auth_wkgrp.inc.php

示例15: header_lastmod

function header_lastmod($page=NULL)
{
	global $lastmod;
	
	if ($lastmod and is_page($page))
	{
		header('Last-Modified: '.date('D, d M Y H:i:s',get_filetime($page)).' GMT');
	}
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:9,代码来源:file.php


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