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


PHP get_pg_passage函数代码示例

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


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

示例1: plugin_tooltip_inline

function plugin_tooltip_inline()
{
    $args = func_get_args();
    $glossary = array_pop($args);
    $term = array_shift($args);
    //	$glossary_page = count($args) ? array_shift($args) : '';
    $glossary_page = '';
    if ($glossary == '') {
        $glossary = plugin_tooltip_get_glossary($term, $glossary_page, FALSE);
        // $debug .= "B=$glossary/";
        if ($glossary === FALSE) {
            $glossary = plugin_tooltip_get_page_title($term);
            if ($glossary === FALSE) {
                $glossary = '';
            }
        }
    }
    $s_glossary = htmlspecialchars($glossary);
    $page = strip_bracket($term);
    if (is_page($page)) {
        $url = get_page_uri($page);
        $passage = get_pg_passage($page, FALSE);
        return <<<EOD
<a href="{$url}" class="linktip" title="{$s_glossary}{$passage}">{$term}</a>
EOD;
    } else {
        return <<<EOD
<span class="tooltip" title="{$s_glossary}" onmouseover="javascript:this.style.backgroundColor='#ffe4e1';" onmouseout="javascript:this.style.backgroundColor='transparent';">{$term}</span>
EOD;
    }
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:31,代码来源:tooltip.inc.php

示例2: plugin_pg_passage_inline

function plugin_pg_passage_inline()
{
    $argv = func_get_args();
    $argc = func_num_args();
    $field = array('page', 'paren');
    for ($i = 0; $i < $argc; $i++) {
        ${$field}[$i] = htmlspecialchars($argv[$i], ENT_QUOTES);
    }
    if (empty($page)) {
        return '';
    }
    $paren = empty($paren) ? FALSE : TRUE;
    return get_pg_passage($page, $paren);
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:14,代码来源:pg_passage.inc.php

示例3: plugin_list_array

function plugin_list_array($pages)
{
    $qm = get_qm();
    $symbol = ' ';
    $other = 'zz';
    $list = array();
    $cnd = 0;
    //並び替える
    foreach ($pages as $file => $page) {
        $pgdata = array();
        $pgdata['urlencoded'] = rawurlencode($page);
        $pgdata['sanitized'] = htmlspecialchars($page, ENT_QUOTES);
        $pgdata['passage'] = get_pg_passage($page, FALSE);
        $pgdata['mtime'] = date('Y年m月d日 H時i分s秒', filemtime(get_filename($page)));
        $pgdata['title'] = get_page_title($page);
        $pgdata['title'] = $pgdata['title'] == $pgdata['sanitized'] ? '' : '(' . $pgdata['title'] . ')';
        $pgdata['filename'] = htmlspecialchars($file);
        $head = preg_match('/^([A-Za-z])/', $page, $matches) ? $matches[1] : (preg_match('/^([ -~])/', $page, $matches) ? $symbol : $other);
        $list[$head][$page] = $pgdata;
        $cnt++;
    }
    ksort($list);
    $tmparr = isset($list[$symbol]) ? $list[$symbol] : null;
    unset($list[$symbol]);
    $list[$symbol] = $tmparr;
    $retlist = array();
    foreach ($list as $head => $pages) {
        if (is_null($pages)) {
            continue;
        }
        ksort($pages);
        if ($head === $symbol) {
            $head = $qm->m['func']['list_symbol'];
        } else {
            if ($head === $other) {
                $head = $qm->m['func']['list_other'];
            }
        }
        $retlist[$head] = $pages;
    }
    return $retlist;
}
开发者ID:big2men,项目名称:qhm,代码行数:42,代码来源:list.inc.php

示例4: plugin_popular_convert

function plugin_popular_convert()
{
    global $vars, $whatsnew;
    global $_popular_plugin_frame, $_popular_plugin_today_frame;
    $max = PLUGIN_POPULAR_DEFAULT;
    $except = '';
    $array = func_get_args();
    $today = FALSE;
    switch (func_num_args()) {
        case 3:
            if ($array[2]) {
                $today = get_date('Y/m/d');
            }
        case 2:
            $except = $array[1];
        case 1:
            $max = $array[0];
    }
    $counters = array();
    foreach (get_existpages(COUNTER_DIR, '.count') as $file => $page) {
        if ($except != '' && ereg($except, $page) || $page == $whatsnew || check_non_list($page) || !is_page($page)) {
            continue;
        }
        $array = file(COUNTER_DIR . $file);
        $count = rtrim($array[0]);
        $date = rtrim($array[1]);
        $today_count = rtrim($array[2]);
        if ($today) {
            // $pageが数値に見える(たとえばencode('BBS')=424253)とき、
            // array_splice()によってキー値が変更されてしまうのを防ぐ
            // ため、キーに '_' を連結する
            if ($today == $date) {
                $counters['_' . $page] = $today_count;
            }
        } else {
            $counters['_' . $page] = $count;
        }
    }
    asort($counters, SORT_NUMERIC);
    // BugTrack2/106: Only variables can be passed by reference from PHP 5.0.5
    $counters = array_reverse($counters, TRUE);
    // with array_splice()
    $counters = array_splice($counters, 0, $max);
    $items = '';
    if (!empty($counters)) {
        $items = '<ul class="popular_list">' . "\n";
        foreach ($counters as $page => $count) {
            $page = substr($page, 1);
            $s_page = htmlsc($page);
            if ($page == $vars['page']) {
                // No need to link itself, notifies where you just read
                $pg_passage = get_pg_passage($page, FALSE);
                $items .= ' <li><span title="' . $s_page . ' ' . $pg_passage . '">' . $s_page . '<span class="counter">(' . $count . ')</span></span></li>' . "\n";
            } else {
                $items .= ' <li>' . make_pagelink($page, $s_page . '<span class="counter">(' . $count . ')</span>') . '</li>' . "\n";
            }
        }
        $items .= '</ul>' . "\n";
    }
    return sprintf($today ? $_popular_plugin_today_frame : $_popular_plugin_frame, count($counters), $items);
}
开发者ID:geoemon2k,项目名称:source_wiki,代码行数:61,代码来源:popular.inc.php

示例5: catbody


//.........这里部分代码省略.........
    $_LINK['rss20'] = get_cmd_absuri('rss', '', 'ver=2.0');
    $_LINK['mixirss'] = get_cmd_absuri('mixirss');
    // Same as 'rdf' for mixi
    // Compat: Skins for 1.4.4 and before
    $link_add =& $_LINK['add'];
    $link_backup =& $_LINK['backup'];
    $link_brokenlink =& $_LINK['brokenlink'];
    $link_template =& $_LINK['copy'];
    $link_diff =& $_LINK['diff'];
    $link_edit =& $_LINK['edit'];
    $link_guiedit =& $_LINK['guiedit'];
    $link_filelist =& $_LINK['filelist'];
    $link_freeze =& $_LINK['freeze'];
    $link_help =& $_LINK['help'];
    $link_linklist =& $_LINK['linklist'];
    $link_list =& $_LINK['list'];
    $link_log_login =& $_LINK['log_login'];
    $link_log_browse =& $_LINK['log_browse'];
    $link_log_update =& $_LINK['log_update'];
    $link_log_down =& $_LINK['log_down'];
    $link_log_check =& $_LINK['log_check'];
    $link_menu =& $_LINK['menu'];
    $link_new =& $_LINK['new'];
    $link_newsub =& $_LINK['newsub'];
    $link_print =& $_LINK['print'];
    $link_full =& $_LINK['full'];
    $link_read =& $_LINK['read'];
    $link_whatsnew =& $_LINK['recent'];
    $link_refer =& $_LINK['refer'];
    $link_reload =& $_LINK['reload'];
    $link_reload_rel =& $_LINK['reload_rel'];
    $link_rename =& $_LINK['rename'];
    $link_skeylist =& $_LINK['skeylist'];
    $link_search =& $_LINK['search'];
    $link_side =& $_LINK['side'];
    $link_source =& $_LINK['source'];
    $link_top =& $_LINK['top'];
    if ($trackback) {
        $link_trackback =& $_LINK['trackback'];
    }
    $link_unfreeze =& $_LINK['unfreeze'];
    $link_upload =& $_LINK['upload'];
    //
    $link_rdf =& $_LINK['rdf'];
    $link_rss =& $_LINK['rss'];
    $link_rss10 =& $_LINK['rss10'];
    $link_rss20 =& $_LINK['rss20'];
    $link_mixirss =& $_LINK['mixirss'];
    // Init flags
    $is_page = is_pagename($_page) && !arg_check('backup') && !is_cantedit($_page);
    $is_read = arg_check('read') && is_page($_page);
    $is_freeze = is_freeze($_page);
    // Last modification date (string) of the page
    $lastmodified = $is_read ? get_date('D, d M Y H:i:s T', get_filetime($_page)) . ' ' . get_pg_passage($_page, FALSE) : '';
    // List of attached files to the page
    $attaches = '';
    if ($attach_link && $is_read && exist_plugin_action('attach')) {
        if (do_plugin_init('attach') !== FALSE) {
            $attaches = 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" : '';
    $foot_tag = !empty($foot_tags) ? join("\n", $foot_tags) . "\n" : '';
    // 1.3.x compat
    // Last modification date (UNIX timestamp) of the page
    $fmt = $is_read ? get_filetime($_page) : 0;
    // Search words
    if ($search_word_color && isset($vars['word'])) {
        $body = '<div class="small">' . $_string['word'] . htmlspecialchars($vars['word']) . '</div>' . $hr . "\n" . $body;
        // BugTrack2/106: Only variables can be passed by reference from PHP 5.0.5
        $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];');
            $body = preg_replace_callback($pattern, $decorate_Nth_word, $body);
            $notes = preg_replace_callback($pattern, $decorate_Nth_word, $notes);
            ++$id;
        }
    }
    // Compat: 'HTML convert time' without time about MenuBar and skin
    $taketime = elapsedtime();
    require SKIN_FILE;
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:101,代码来源:html.php

示例6: plugin_print_action


//.........这里部分代码省略.........
    if ($newtitle != '') {
        $h1 = $newtitle . ' - ' . $page_title;
    } elseif ($page == $defaultpage) {
        $h1 = $page_title;
    } else {
        $h1 = $page . ' - ' . $page_title;
    }
    echo ' <title>' . $h1 . '</title>' . "\n";
    echo <<<EOD
 <link rel="stylesheet" href="{$SKIN_URI}default.css" type="text/css" media="screen" charset="{$css_charset}" />
 <link rel="stylesheet" href="{$SKIN_URI}print.css" type="text/css" media="print" charset="{$css_charset}" />
 <script type="text/javascript">
 <!--

EOD;
    if (exist_plugin_convert('js_init')) {
        echo do_plugin_convert('js_init');
    }
    echo <<<EOD
 // -->
 </script>
 <script type="text/javascript" src="{$SKIN_URI}lang/{$language}.js"></script>
 <script type="text/javascript" src="{$SKIN_URI}default.js"></script>

EOD;
    if (!$use_local_time) {
        echo <<<EOD
 <script type="text/javascript" src="{$SKIN_URI}tzCalculation_LocalTimeZone.js"></script>

EOD;
    }
    echo $head_tag;
    echo <<<EOD
</head>
<body>

EOD;
    /*
    	if ($head) {
    		echo <<<EOD
    <div id="header">
     <h1 class="title">$h1</h1>
    </div>
    
    EOD;
    	}
    */
    if ($head) {
        // Last modification date (string) of the page
        $lastmodified = get_date('D, d M Y H:i:s T', get_filetime($page)) . ' ' . get_pg_passage($page, FALSE);
        // <span style="font-size: large;line-height: 1;margin: 0px;padding: 0px;">$h1</span>
        $PRINT_HEAD_BGCOLOR = PRINT_HEAD_BGCOLOR;
        $PRINT_HEAD_BORDER = PRINT_HEAD_BORDER;
        echo <<<EOD
<div style="background-color: {$PRINT_HEAD_BGCOLOR};border: 1px {$PRINT_HEAD_BORDER} solid;padding: 6px 8px;margin: 6px 1%;">
\t<h1 class="title">{$h1}</h1>
\t<p style="font-size:10px;text-align:right;">Last-Modified: {$lastmodified}</p>
</div>

EOD;
    }
    echo <<<EOD
<div id="contents">
<table class="contents" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
  <td class="ctable" valign="top">
    <div id="body">

EOD;
    echo $body;
    echo <<<EOD
    </div>
  </td>
</tr>
</table>
</div>

EOD;
    if ($notes) {
        echo <<<EOD
<div id="note">
{$notes}
</div>

EOD;
    }
    if ($foot) {
        echo print_foot_area();
    }
    if (exist_plugin_convert('tz')) {
        echo do_plugin_convert('tz');
    }
    echo $foot_tag;
    echo <<<EOD
</body>
</html>

EOD;
    die;
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:101,代码来源:print.inc.php

示例7: page_list

function page_list($pages, $cmd = 'read', $withfilename=FALSE)
{
	global $script,$list_index,$top;
	global $_msg_symbol,$_msg_other;
	global $pagereading_enable;
	
	// ソートキーを決定する。 ' ' < '[a-zA-Z]' < 'zz'という前提。
	$symbol = ' ';
	$other = 'zz';
	
	$retval = '';
	
	if($pagereading_enable) {
		mb_regex_encoding(SOURCE_ENCODING);
		$readings = get_readings($pages);
	}
	
	$list = array();
	foreach($pages as $file=>$page)
	{
		$r_page = rawurlencode($page);
		$s_page = htmlspecialchars($page,ENT_QUOTES);
		$passage = get_pg_passage($page);
		
		$str = "   <li><a href=\"$script?cmd=$cmd&amp;page=$r_page\">$s_page</a>$passage";
		
		if ($withfilename)
		{
			$s_file = htmlspecialchars($file);
			$str .= "\n    <ul><li>$s_file</li></ul>\n   ";
		}
		$str .= "</li>";
		
		if($pagereading_enable) {
			if(mb_ereg('^([A-Za-zァ-ヶ])',$readings[$page],$matches)) {
				$head = $matches[1];
			}
			elseif (mb_ereg('^[ -~]|[^ぁ-ん亜-熙]',$page)) {
				$head = $symbol;
			}
			else {
				$head = $other;
			}
		}
		else {
			$head = (preg_match('/^([A-Za-z])/',$page,$matches)) ? $matches[1] :
				(preg_match('/^([ -~])/',$page,$matches) ? $symbol : $other);
		}
		
		$list[$head][$page] = $str;
	}
	ksort($list);
	
	$cnt = 0;
	$arr_index = array();
	$retval .= "<ul>\n";
	foreach ($list as $head=>$pages)
	{
		if ($head === $symbol)
		{
			$head = $_msg_symbol;
		}
		else if ($head === $other)
		{
			$head = $_msg_other;
		}
		
		if ($list_index)
		{
			$cnt++;
			$arr_index[] = "<a id=\"top_$cnt\" href=\"#head_$cnt\"><strong>$head</strong></a>";
			$retval .= " <li><a id=\"head_$cnt\" href=\"#top_$cnt\"><strong>$head</strong></a>\n  <ul>\n";
		}
		ksort($pages);
		$retval .= join("\n",$pages);
		if ($list_index)
		{
			$retval .= "\n  </ul>\n </li>\n";
		}
	}
	$retval .= "</ul>\n";
	if ($list_index and $cnt > 0)
	{
		$top = array();
		while (count($arr_index) > 0)
		{
			$top[] = join(" | \n",array_splice($arr_index,0,16))."\n";
		}
		$retval = "<div id=\"top\" style=\"text-align:center\">\n".
			join("<br />",$top)."</div>\n".$retval;
	}
	return $retval;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:93,代码来源:func.php

示例8: page_list

function page_list($pages, $cmd = 'read', $withfilename = FALSE)
{
    global $script, $list_index;
    global $_msg_symbol, $_msg_other;
    global $pagereading_enable;
    // ソートキーを決定する。 ' ' < '[a-zA-Z]' < 'zz'という前提。
    $symbol = ' ';
    $other = 'zz';
    $retval = '';
    if ($pagereading_enable) {
        mb_regex_encoding(SOURCE_ENCODING);
        $readings = get_readings($pages);
    }
    $list = $matches = array();
    // Shrink URI for read
    if ($cmd == 'read') {
        $href = $script . '?';
    } else {
        $href = $script . '?cmd=' . $cmd . '&amp;page=';
    }
    foreach ($pages as $file => $page) {
        $r_page = rawurlencode($page);
        $s_page = htmlspecialchars($page, ENT_QUOTES);
        $passage = get_pg_passage($page);
        $str = '   <li><a href="' . $href . $r_page . '">' . $s_page . '</a>' . $passage;
        if ($withfilename) {
            $s_file = htmlspecialchars($file);
            $str .= "\n" . '    <ul><li>' . $s_file . '</li></ul>' . "\n" . '   ';
        }
        $str .= '</li>';
        // WARNING: Japanese code hard-wired
        if ($pagereading_enable) {
            if (mb_ereg('^([A-Za-z])', mb_convert_kana($page, 'a'), $matches)) {
                $head = $matches[1];
            } elseif (isset($readings[$page]) && mb_ereg('^([ァ-ヶ])', $readings[$page], $matches)) {
                // here
                $head = $matches[1];
            } elseif (mb_ereg('^[ -~]|[^ぁ-ん亜-熙]', $page)) {
                // and here
                $head = $symbol;
            } else {
                $head = $other;
            }
        } else {
            $head = preg_match('/^([A-Za-z])/', $page, $matches) ? $matches[1] : (preg_match('/^([ -~])/', $page, $matches) ? $symbol : $other);
        }
        $list[$head][$page] = $str;
    }
    ksort($list);
    $cnt = 0;
    $arr_index = array();
    $retval .= '<ul>' . "\n";
    foreach ($list as $head => $pages) {
        if ($head === $symbol) {
            $head = $_msg_symbol;
        } else {
            if ($head === $other) {
                $head = $_msg_other;
            }
        }
        if ($list_index) {
            ++$cnt;
            $arr_index[] = '<a id="top_' . $cnt . '" href="#head_' . $cnt . '"><strong>' . $head . '</strong></a>';
            $retval .= ' <li><a id="head_' . $cnt . '" href="#top_' . $cnt . '"><strong>' . $head . '</strong></a>' . "\n" . '  <ul>' . "\n";
        }
        ksort($pages);
        $retval .= join("\n", $pages);
        if ($list_index) {
            $retval .= "\n  </ul>\n </li>\n";
        }
    }
    $retval .= '</ul>' . "\n";
    if ($list_index && $cnt > 0) {
        $top = array();
        while (!empty($arr_index)) {
            $top[] = join(' | ' . "\n", array_splice($arr_index, 0, 16)) . "\n";
        }
        $retval = '<div id="top" style="text-align:center">' . "\n" . join('<br />', $top) . '</div>' . "\n" . $retval;
    }
    return $retval;
}
开发者ID:KimuraYoichi,项目名称:PukiWiki,代码行数:81,代码来源:func.php

示例9: plugin_ls2_get_headings

function plugin_ls2_get_headings($page, &$params, $level, $include = FALSE)
{
    global $script;
    static $_ls2_anchor = 0;
    // ページが未表示のとき
    $is_done = isset($params["page_{$page}"]) && $params["page_{$page}"] > 0;
    if (!$is_done) {
        $params["page_{$page}"] = ++$_ls2_anchor;
    }
    $r_page = rawurlencode($page);
    $s_page = htmlsc($page);
    $title = $s_page . ' ' . get_pg_passage($page, FALSE);
    $href = $script . '?cmd=read&amp;page=' . $r_page;
    plugin_ls2_list_push($params, $level);
    $ret = $include ? '<li>include ' : '<li>';
    if ($params['title'] && $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>';
    array_push($params['result'], $ret);
    $anchor = PLUGIN_LS2_ANCHOR_ORIGIN;
    $matches = array();
    foreach (get_source($page) as $line) {
        if ($params['title'] && preg_match('/^(\\*{1,3})/', $line, $matches)) {
            $id = make_heading($line);
            $level = strlen($matches[1]);
            $id = PLUGIN_LS2_ANCHOR_PREFIX . $anchor++;
            plugin_ls2_list_push($params, $level + strlen($level));
            array_push($params['result'], '<li><a href="' . $href . $id . '">' . $line . '</a>');
        } else {
            if ($params['include'] && preg_match('/^#include\\((.+)\\)/', $line, $matches) && is_page($matches[1])) {
                plugin_ls2_get_headings($matches[1], $params, $level + 1, TRUE);
            }
        }
    }
}
开发者ID:geoemon2k,项目名称:source_wiki,代码行数:39,代码来源:ls2.inc.php

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

示例11: plugin_mixirecent_convert

function plugin_mixirecent_convert()
{
    global $vars, $date_format;
    // $_mixirecent_plugin_frame;
    static $done;
    $_mixirecent_plugin_frame_s = _('recent(%d)');
    $_mixirecent_plugin_frame = sprintf('<h5>%s</h5><div>%%s</div>', $_mixirecent_plugin_frame_s);
    $mixirecent_lines = PLUGIN_MIXIRECENT_DEFAULT_LINES;
    if (func_num_args()) {
        $args = func_get_args();
        if (!is_numeric($args[0]) || isset($args[1])) {
            return PLUGIN_MIXIRECENT_USAGE . '<br />';
        } else {
            $mixirecent_lines = $args[0];
        }
    }
    // Show only the first one
    if (isset($done)) {
        return '<!-- #mixirecent(): You already view changes -->';
    }
    // Get latest N changes
    if (file_exists(PLUGIN_MIXIRECENT_CACHE)) {
        $source = file(PLUGIN_MIXIRECENT_CACHE);
        $lines = array_splice($source, 0, $mixirecent_lines);
    } else {
        return '#mixirecent(): Cache file of RecentChanges not found' . '<br />';
    }
    $date = $items = '';
    foreach ($lines as $line) {
        list($time, $page) = explode("\t", rtrim($line));
        $_date = get_date($date_format, $time);
        if ($date != $_date) {
            // End of the day
            if ($date != '') {
                $items .= '</ul>' . "\n";
            }
            // New day
            $date = $_date;
            $items .= '<strong>' . $date . '</strong>' . "\n" . '<ul class="mixirecent_list">' . "\n";
        }
        $s_page = htmlspecialchars($page);
        $pg_passage = get_pg_passage($page, FALSE);
        if (plugin_mixirecent_isValidDate(substr($page, -10)) && check_readable($page, false, false)) {
            // for Calendar/MiniCalendar
            $savepage = $vars['page'];
            $title = $page;
            $source = get_source($page);
            $itemhx = '';
            $itemlx = '';
            while (!empty($source)) {
                $line = array_shift($source);
                if (preg_match('/^(\\*{1,3})(.*)\\[#([A-Za-z][\\w-]+)\\](.*)$/m', $line, $matches)) {
                    $anchortitle = strip_htmltag(convert_html($matches[2]));
                    $anchortitle = preg_replace("/[\r\n]/", ' ', $anchortitle);
                    $anchortitle = PLUGIN_MIXIRECENT_NOTITLE ? $anchortitle : $anchortitle . '(' . $title . ')';
                    $sharp = '#';
                    $itemhx .= "<li><a href=\"" . get_page_uri($page) . "{$sharp}{$matches[3]}\" title=\"{$s_page} {$pg_passage}\">{$anchortitle}</a></li>\n";
                }
            }
            if ($itemhx != '') {
                $items .= $itemhx;
            } else {
                if ($page == $vars['page']) {
                    // No need to link to the page now you read, notifies where you just read
                    $items .= ' <li>' . $s_page . '</li>' . "\n";
                } else {
                    $items .= ' <li><a href="' . get_page_uri($page) . '" title="' . $s_page . ' ' . $pg_passage . '">' . $s_page . '</a></li>' . "\n";
                }
            }
            $vars['page'] = $savepage;
        } else {
            if ($page == $vars['page']) {
                // No need to link to the page now you read, notifies where you just read
                $items .= ' <li>' . $s_page . '</li>' . "\n";
            } else {
                $items .= ' <li><a href="' . get_page_uri($page) . '" title="' . $s_page . ' ' . $pg_passage . '">' . $s_page . '</a></li>' . "\n";
            }
        }
    }
    // End of the day
    if ($date != '') {
        $items .= '</ul>' . "\n";
    }
    $done = TRUE;
    return sprintf($_mixirecent_plugin_frame, count($lines), $items);
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:86,代码来源:mixirecent.inc.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: weblog_viewer_show_headings

function weblog_viewer_show_headings($page, &$params, $prefix = "", $child_count = "")
{
    global $script, $auto_template_name;
    global $_weblog_list_anchor, $_weblog_msgs;
    static $_auto_template_name = "";
    if (!$_auto_template_name) {
        $_auto_template_name = preg_quote($auto_template_name, '/');
    }
    // テンプレートページは表示しない場合
    if (preg_match("/\\/" . $_auto_template_name . "(_m)?\$/", $page)) {
        return;
    }
    $ret = '';
    $rules = '/\\(\\(((?:(?!\\)\\)).)*)\\)\\)/';
    $is_done = (isset($params[$page]) and $params[$page] > 0);
    //ページが表示済みのときTrue
    if (!$is_done) {
        $params[$page] = ++$_weblog_list_anchor;
    }
    $name = strip_bracket($page);
    $title = $name . ' ' . get_pg_passage($page, FALSE);
    if ($params['weblog']) {
        if (!ereg("(.*/)?([0-9]{4})-([0-9]{2})-([0-9]{2})-([0-9]{6}).*\$", $name, $m)) {
            return;
        }
        if (!checkdate($m[3], $m[4], $m[2])) {
            return;
        }
    }
    if ($use_static_url = 1) {
        $pgid = get_pgid_by_name($page);
        $href = XOOPS_WIKI_URL . "/{$pgid}.html";
    } else {
        $href = $script . '?' . rawurlencode($name);
    }
    //ページ名が「数字と-」だけの場合は、*(**)行を取得してみる
    $_name = "";
    if (preg_match("/^(.*\\/)?[0-9\\-]+\$/", $name)) {
        $_name = get_heading($page);
    }
    //基準ページ名は省く nao-pon
    if ($name != $prefix) {
        $name = str_replace($prefix, "", $name);
        $_is_base = false;
    } else {
        $_is_base = true;
    }
    //階層でマージン設定
    $name = str_replace("/", "\t", $name);
    //マルチバイトを考慮してTABに変換
    $c_count = count_chars($name);
    if ($_is_base) {
        $c_margin = 0;
        //基準ページ
    } else {
        $c_margin = $c_count[9] * 15;
        //TABのコード=9
    }
    //[/(\tに変換済)]以前をカット
    $name = preg_replace("/.*\t/", "", $name);
    $ret .= '<li style="margin-left:' . $c_margin . 'px;">';
    if ($params['weblog']) {
        $_page = preg_replace("/(.*\\/)?([0-9\\-]+)\$/", "\\2", $page);
        $t_year = substr($_page, 0, 4);
        $t_month = substr($_page, 5, 2);
        $t_day = substr($_page, 8, 2);
        $t_hour = substr($_page, 11, 2);
        $t_min = substr($_page, 13, 2);
        $t_sec = substr($_page, 15, 2);
        $timestamp = mktime($t_hour, $t_min, $t_sec, $t_month, $t_day, $t_year);
        //		$info =  get_pg_info_db($page);
        //		$timestamp = $info['buildtime'];
        $make_date[1] = date("Y", $timestamp);
        $make_date[2] = date("m", $timestamp);
        $make_date[3] = date("d", $timestamp);
        $make_date[4] = date("H:i", $timestamp);
        if ($params['weblog'] === "time") {
            $page_attr = $make_date[4];
        } else {
            $page_attr = $make_date[2] . "/" . $make_date[3] . " " . $make_date[4];
        }
        $ret .= $page_attr . " - ";
    }
    if ($_name) {
        $name = $_name;
    }
    if ($params['relatedcount']) {
        $name .= " (" . links_get_related_count($page) . ")";
    }
    if ($child_count != "") {
        $name .= " ({$child_count})";
    }
    //Newマーク付加
    if (!$params['nonew'] && exist_plugin_inline("new")) {
        $new_mark = do_plugin_inline("new", "{$page}/,nolink", "");
    }
    $ret .= '<a id="list_' . $params[$page] . '" href="' . $href . '" title="' . $title . '">' . $name . '</a>' . $new_mark;
    $anchor = WEBLOG_LIST_ANCHOR_ORIGIN;
    $_ret = '';
    if ($_ret != '') {
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:101,代码来源:weblog_list.inc.php

示例14: plugin_popular_convert

function plugin_popular_convert()
{
    global $vars, $whatsnew;
    $qm = get_qm();
    $qt = get_qt();
    $max = PLUGIN_POPULAR_DEFAULT;
    $except = '';
    $array = func_get_args();
    //---- キャッシュのための処理を登録 -----
    if ($qt->create_cache) {
        $args = func_get_args();
        return $qt->get_dynamic_plugin_mark(__FUNCTION__, $args);
    }
    //------------------------------------
    $today = FALSE;
    switch (func_num_args()) {
        case 3:
            if ($array[2]) {
                $today = get_date('Y/m/d');
            }
        case 2:
            $except = $array[1];
        case 1:
            $max = $array[0];
    }
    $counters = array();
    foreach (get_existpages(COUNTER_DIR, '.count') as $file => $page) {
        if ($except != '' && ereg($except, $page) || $page == $whatsnew || check_non_list($page) || !is_page($page)) {
            continue;
        }
        $array = array_pad(file(COUNTER_DIR . $file), 3, 0);
        $count = rtrim($array[0]);
        $date = rtrim($array[1]);
        $today_count = rtrim($array[2]);
        if ($today) {
            // $pageが数値に見える(たとえばencode('BBS')=424253)とき、
            // array_splice()によってキー値が変更されてしまうのを防ぐ
            // ため、キーに '_' を連結する
            if ($today == $date) {
                $counters['_' . $page] = $today_count;
            }
        } else {
            $counters['_' . $page] = $count;
        }
    }
    asort($counters, SORT_NUMERIC);
    // BugTrack2/106: Only variables can be passed by reference from PHP 5.0.5
    $counters = array_reverse($counters, TRUE);
    // with array_splice()
    $counters = array_splice($counters, 0, $max);
    $items = '';
    if (!empty($counters)) {
        $items = '<ul class="popular_list">' . "\n";
        foreach ($counters as $page => $count) {
            $page = substr($page, 1);
            $s_page = htmlspecialchars($page);
            //customized by hokuken.com
            $s_page = get_page_title($page);
            if ($page == $vars['page']) {
                // No need to link itself, notifies where you just read
                $pg_passage = get_pg_passage($page, FALSE);
                $items .= ' <li><span title="' . $s_page . ' ' . $pg_passage . '">' . $s_page . '<span class="counter">(' . $count . ')</span></span></li>' . "\n";
            } else {
                $items .= ' <li>' . make_pagelink($page, $s_page . '<span class="counter">(' . $count . ')</span>') . '</li>' . "\n";
            }
        }
        $items .= '</ul>' . "\n";
    }
    $html = sprintf($today ? $qm->m['plg_popular']['today_frame'] : $qm->m['plg_popular']['frame'], count($counters), $items);
    return '<div class="qhm-plugin-popular">' . $html . '</div>';
}
开发者ID:big2men,项目名称:qhm,代码行数:71,代码来源:popular.inc.php

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


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