• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

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

Commit MetaInfo

修訂48cdfe5451ec10415df469e51a75f9c72f4f6562 (tree)
時間2004-09-04 23:53:13
作者henoheno <henoheno>
Commiterhenoheno

Log Message

Just a cleanup. Remove unused / Added spaces and \n

Change Summary

差異

--- a/plugin/popular.inc.php
+++ b/plugin/popular.inc.php
@@ -2,7 +2,7 @@
22 /////////////////////////////////////////////////
33 // PukiWiki - Yet another WikiWikiWeb clone.
44 //
5-// $Id: popular.inc.php,v 1.9 2004/07/31 03:09:20 henoheno Exp $
5+// $Id: popular.inc.php,v 1.10 2004/09/04 14:53:13 henoheno Exp $
66 //
77
88 /*
@@ -27,69 +27,58 @@
2727
2828 function plugin_popular_convert()
2929 {
30+ global $whatsnew, $non_list;
3031 global $_popular_plugin_frame, $_popular_plugin_today_frame;
31- global $script,$whatsnew,$non_list;
3232
3333 $max = 10;
3434 $except = '';
3535
3636 $array = func_get_args();
3737 $today = FALSE;
38-
3938 switch (func_num_args()) {
40- case 3:
41- if ($array[2])
42- $today = get_date('Y/m/d');
43- case 2:
44- $except = $array[1];
45- case 1:
46- $max = $array[0];
39+ case 3: if ($array[2]) $today = get_date('Y/m/d');
40+ case 2: $except = $array[1];
41+ case 1: $max = $array[0];
4742 }
4843
4944 $counters = array();
50-
51- foreach (get_existpages(COUNTER_DIR,'.count') as $file=>$page) {
52- if ($except != '' and ereg($except,$page)) {
53- continue;
54- }
55- if ($page == $whatsnew or preg_match("/$non_list/",$page) or !is_page($page)) {
45+ foreach (get_existpages(COUNTER_DIR, '.count') as $file=>$page) {
46+ if (($except != '' && ereg($except, $page)) ||
47+ $page == $whatsnew || preg_match("/$non_list/", $page) ||
48+ ! is_page($page)) {
5649 continue;
5750 }
5851
59- $array = file(COUNTER_DIR.$file);
52+ $array = file(COUNTER_DIR . $file);
6053 $count = rtrim($array[0]);
61- $date = rtrim($array[1]);
54+ $date = rtrim($array[1]);
6255 $today_count = rtrim($array[2]);
63- $yesterday_count = rtrim($array[3]);
6456
6557 if ($today) {
66- if ($today == $date) {
67- // $pageが数値に見える(たとえばencode('BBS')=424253)とき、
68- // array_splice()によってキー値が変更されてしまうのを防ぐ
69- $counters["_$page"] = $today_count;
70- }
71- }
72- else {
58+ // $pageが数値に見える(たとえばencode('BBS')=424253)とき、
59+ // array_splice()によってキー値が変更されてしまうのを防ぐ
60+ if ($today == $date) $counters["_$page"] = $today_count;
61+ } else {
7362 $counters["_$page"] = $count;
7463 }
7564 }
7665
7766 asort($counters, SORT_NUMERIC);
78- $counters = array_splice(array_reverse($counters,TRUE),0,$max);
67+ $counters = array_splice(array_reverse($counters, TRUE), 0, $max);
7968
8069 $items = '';
81- if (count($counters)) {
82- $items = '<ul class="popular_list">';
70+ if (! empty($counters)) {
71+ $items = "<ul class=\"popular_list\">\n";
8372
8473 foreach ($counters as $page=>$count) {
85- $page = substr($page,1);
74+ $page = substr($page, 1);
8675
8776 $s_page = htmlspecialchars($page);
88- $items .= " <li>".make_pagelink($page,"$s_page<span class=\"counter\">($count)</span>")."</li>\n";
77+ $items .= ' <li>' . make_pagelink($page, "$s_page<span class=\"counter\">($count)</span>") . "</li>\n";
8978 }
90- $items .= '</ul>';
79+ $items .= "</ul>\n";
9180 }
92- return sprintf($today ? $_popular_plugin_today_frame : $_popular_plugin_frame,count($counters),$items);
93-}
9481
82+ return sprintf($today ? $_popular_plugin_today_frame : $_popular_plugin_frame, count($counters), $items);
83+}
9584 ?>