• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisão6c0563312311d3b114446e9c28dc434f09bab035 (tree)
Hora2004-09-04 23:16:30
Autorhenoheno <henoheno>
Commiterhenoheno

Mensagem de Log

Just a cleanup. Add two \n

Mudança Sumário

Diff

--- a/plugin/recent.inc.php
+++ b/plugin/recent.inc.php
@@ -12,46 +12,46 @@
1212 * 2002.06.17: plugin_recent_init()を設定
1313 * 2002.07.02: <ul>による出力に変更し構造化
1414 *
15- * $Id: recent.inc.php,v 1.11 2004/07/31 03:09:20 henoheno Exp $
15+ * $Id: recent.inc.php,v 1.12 2004/09/04 14:16:30 henoheno Exp $
1616 */
1717
18+// RecentChangesのキャッシュ
19+define('PLUGIN_RECENT_CACHE', CACHE_DIR . 'recent.dat');
20+
1821 function plugin_recent_convert()
1922 {
20- global $script,$BracketName,$date_format;
23+ global $script, $date_format;
2124 global $_recent_plugin_frame;
2225
26+ if (! file_exists(PLUGIN_RECENT_CACHE)) return '';
27+
2328 $recent_lines = 10;
2429 if (func_num_args()) {
2530 $args = func_get_args();
26- if (is_numeric($args[0])) {
31+ if (is_numeric($args[0]))
2732 $recent_lines = $args[0];
28- }
2933 }
3034
35+ // 先頭のN件(行)を取り出す
36+ $lines = array_splice(file(PLUGIN_RECENT_CACHE), 0, $recent_lines);
37+
3138 $date = $items = '';
32- if (!file_exists(CACHE_DIR.'recent.dat')) {
33- return '';
34- }
35- $recent = file(CACHE_DIR.'recent.dat');
36- $lines = array_splice($recent,0,$recent_lines);
3739 foreach ($lines as $line) {
38- list($time,$page) = explode("\t",rtrim($line));
39- $_date = get_date($date_format,$time);
40+ list($time, $page) = explode("\t", rtrim($line));
41+ $_date = get_date($date_format, $time);
4042 if ($date != $_date) {
41- if ($date != '') {
42- $items .= '</ul>';
43- }
43+ if ($date != '') $items .= '</ul>';
4444 $date = $_date;
45- $items .= "<strong>$date</strong>\n<ul class=\"recent_list\">";
45+ $items .= "<strong>$date</strong>\n" .
46+ "<ul class=\"recent_list\">\n";
4647 }
4748 $s_page = htmlspecialchars($page);
4849 $r_page = rawurlencode($page);
49- $pg_passage = get_pg_passage($page,FALSE);
50+ $pg_passage = get_pg_passage($page, FALSE);
5051 $items .=" <li><a href=\"$script?$r_page\" title=\"$s_page $pg_passage\">$s_page</a></li>\n";
5152 }
52- if (count($lines)) {
53- $items .='</ul>';
54- }
55- return sprintf($_recent_plugin_frame,count($lines),$items);
53+ if (! empty($lines)) $items .= "</ul>\n";
54+
55+ return sprintf($_recent_plugin_frame, count($lines), $items);
5656 }
5757 ?>