BugTrack/422
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*&new{ページ名};でそのページの鮮度がNEW!で表示されて...
-ページ: BugTrack
-投稿者: [[sha]]
-優先順位: 普通
-状態: 完了
-カテゴリー: プラグイン
-投稿日: 2003-07-12 (土) 02:59:31
-バージョン: 1.4rc3
**メッセージ [#n4afeba5]
MenuBarなどに張ったリンクに対して、内容が更新された場合に...
----
-AutoLinkが有効になっていると{}のページ名がPukiWiki側でリ...
&new{日付};
&new(ページ名);
現状でも日付のページ(yyyy-mm-dd)が存在するとnewの判定が失...
--日付のページが存在すると判定に失敗する…これは気がつきま...
--あう。ゴメンなさい。()の中でも駄目かもです。日付のフォ...
-どちらか最初に指定されたほう、という仕様にすればいいです...
&new{日付};
&new(日付1){日付2}; 日付1を採用 日付2を無視
&new(ページ名);
-
Index: new.inc.php
========================================================...
RCS file: /cvsroot/pukiwiki/pukiwiki/plugin/new.inc.php,v
retrieving revision 1.2
diff -u -r1.2 new.inc.php
--- new.inc.php 30 Apr 2003 08:17:15 -0000 1.2
+++ new.inc.php 14 Jul 2003 05:39:54 -0000
@@ -31,15 +31,26 @@
}
$args = func_get_args();
-
- $date = array_pop($args);
- if (($timestamp = strtotime($date)) === -1)
+ $date = array_pop($args); // {}部分の引数
+ if (count($args))
+ {
+ $date = join(',',$args); // ()部分の引数があればそち...
+ }
+ if (is_page($date))
+ {
+ $timestamp = get_filetime($date);
+ $retval = make_pagelink($date);
+ }
+ else if (($timestamp = strtotime($date)) !== -1)
+ {
+ $timestamp -= LOCALZONE;
+ $retval = htmlspecialchars($date);
+ }
+ else
{
return FALSE;
}
- $retval = htmlspecialchars($date);
-
- $erapse = UTIME - $timestamp + LOCALZONE;
+
+ $erapse = UTIME - $timestamp;
foreach ($_plugin_new_elapses as $limit=>$tag)
{
if ($erapse <= $limit)
-「[[official:欲しいプラグイン/45]]」にも記載してますが、...
&new(ページ名/*);
のような記述の方法で可能にできないものでしょうか?#tracke...
-こんなのはどうでしょうか?tracker.inc.phpの一部を流用。...
if (is_page($date))
{
$timestamp = get_filetime($date);
$retval = make_pagelink($date);
}
+ //else if ( preg_match("/\/\*$/", $date) ){
+ else if ( substr($date, -2) === "/*" ) {
+ $refer_len = strlen($date)-2;
+ $refer = substr($date, 0, $refer_len);
+ $timestamp = 0;
+ $retval = "";
+ foreach (get_existpages() as $_page)
+ {
+ if (strpos($_page,$refer) === 0)
+ {
+ $tm = get_filetime($_page);
+ if ( $timestamp < $tm ) {
+ $timestamp = $tm;
+ $retval = make_page...
+ }
+ }
+ }
+ }
else if (($timestamp = strtotime($date)) !== -1)
{
$timestamp -= LOCALZONE;
$retval = htmlspecialchars($date);
}
-これではまずいようです。初期値$timestamp=0だと、NEWを表...
function plugin_new_init()
{
+ global $_maxsec;
....
+ $_maxsec = 0;
+ foreach ( $_plugin_new_elapses as $key=>$val )
+ {
+ if ( $_maxsec < $key ) $_maxsec = $key;
+ }
}
-
function plugin_new_inline()
{
+ global $_maxsec;
....
+ //else if ( preg_match("/\/\*$/", $date) ){
+ else if ( substr($date, -2) === "/*" ) {
+ $refer_len = strlen($date)-1;
+ $refer = substr($date, 0, $refer_len);
+ $timestamp = UTIME - $_maxsec;
+ $retval = "";
+ foreach (get_existpages() as $_page)
+ {
+ if (strpos($_page,$refer) === 0)
+ {
+ $tm = get_filetime($_page);
+ if ( $timestamp < $tm ) {
+ $timestamp = $tm;
+ $retval = make_page...
+ }
+ }
+ }
+ if ( $retval === "" ) $timestamp = 0;
+ }
-というわけで、new.inc.phpのv1.2に上の変更を加えてみたも...
-別の機能になってしまいますが、&newを使う場所によって...
--作ってみました。&ref(new.inc.php-1.2+sha.2);では、引数...
&new(nostring,2003-07-28 (月) 13:38:41);
&new(nostring,BugTrack/*);
---PHP 5.1からの[[strtotimeの仕様変更対応>dev:BugTrack2/1...
new.inc.php-1.2+sha.2に対しての差分です。
- else if ( ( $timestamp = strtotime($date)) !== -1 )
- {
- $timestamp -= LOCALZONE;
- $retval = htmlspecialchars($date);
- }
- else {
- return FALSE;
- }
+ else {
+ // PHP 5.1からのstrtotime()の仕様変更対応
+ if(LANG == 'ja') {
+ $timestamp = strtotime(preg_replace('/\([^\x00-\x7f]...
+ } else {
+ $timestamp = strtotime($date);
+ }
+ if ($timestamp === -1 || $timestamp === FALSE) {
+ $timestamp = strtotime("now"); // 何も指定無し now ...
+ }
+ $timestamp -= LOCALZONE;
+ $retval = htmlspecialchars($date);
+ }
-ありゃ。被っちゃいました。以下のような指定方法を考えてい...
カレントページ
&new;
ページ指定
&new([page][,nolink]);
プレフィクス指定
&new(prefix/[,nolink]);
日付文字列
&new([nodate]){日付文字列};
--あ、ええと、お任せします。機能は同じですので、他のコマ...
-要望です。「ページ指定」の場合に、''new!''表示するときだ...
//#comment
終了行:
*&new{ページ名};でそのページの鮮度がNEW!で表示されて...
-ページ: BugTrack
-投稿者: [[sha]]
-優先順位: 普通
-状態: 完了
-カテゴリー: プラグイン
-投稿日: 2003-07-12 (土) 02:59:31
-バージョン: 1.4rc3
**メッセージ [#n4afeba5]
MenuBarなどに張ったリンクに対して、内容が更新された場合に...
----
-AutoLinkが有効になっていると{}のページ名がPukiWiki側でリ...
&new{日付};
&new(ページ名);
現状でも日付のページ(yyyy-mm-dd)が存在するとnewの判定が失...
--日付のページが存在すると判定に失敗する…これは気がつきま...
--あう。ゴメンなさい。()の中でも駄目かもです。日付のフォ...
-どちらか最初に指定されたほう、という仕様にすればいいです...
&new{日付};
&new(日付1){日付2}; 日付1を採用 日付2を無視
&new(ページ名);
-
Index: new.inc.php
========================================================...
RCS file: /cvsroot/pukiwiki/pukiwiki/plugin/new.inc.php,v
retrieving revision 1.2
diff -u -r1.2 new.inc.php
--- new.inc.php 30 Apr 2003 08:17:15 -0000 1.2
+++ new.inc.php 14 Jul 2003 05:39:54 -0000
@@ -31,15 +31,26 @@
}
$args = func_get_args();
-
- $date = array_pop($args);
- if (($timestamp = strtotime($date)) === -1)
+ $date = array_pop($args); // {}部分の引数
+ if (count($args))
+ {
+ $date = join(',',$args); // ()部分の引数があればそち...
+ }
+ if (is_page($date))
+ {
+ $timestamp = get_filetime($date);
+ $retval = make_pagelink($date);
+ }
+ else if (($timestamp = strtotime($date)) !== -1)
+ {
+ $timestamp -= LOCALZONE;
+ $retval = htmlspecialchars($date);
+ }
+ else
{
return FALSE;
}
- $retval = htmlspecialchars($date);
-
- $erapse = UTIME - $timestamp + LOCALZONE;
+
+ $erapse = UTIME - $timestamp;
foreach ($_plugin_new_elapses as $limit=>$tag)
{
if ($erapse <= $limit)
-「[[official:欲しいプラグイン/45]]」にも記載してますが、...
&new(ページ名/*);
のような記述の方法で可能にできないものでしょうか?#tracke...
-こんなのはどうでしょうか?tracker.inc.phpの一部を流用。...
if (is_page($date))
{
$timestamp = get_filetime($date);
$retval = make_pagelink($date);
}
+ //else if ( preg_match("/\/\*$/", $date) ){
+ else if ( substr($date, -2) === "/*" ) {
+ $refer_len = strlen($date)-2;
+ $refer = substr($date, 0, $refer_len);
+ $timestamp = 0;
+ $retval = "";
+ foreach (get_existpages() as $_page)
+ {
+ if (strpos($_page,$refer) === 0)
+ {
+ $tm = get_filetime($_page);
+ if ( $timestamp < $tm ) {
+ $timestamp = $tm;
+ $retval = make_page...
+ }
+ }
+ }
+ }
else if (($timestamp = strtotime($date)) !== -1)
{
$timestamp -= LOCALZONE;
$retval = htmlspecialchars($date);
}
-これではまずいようです。初期値$timestamp=0だと、NEWを表...
function plugin_new_init()
{
+ global $_maxsec;
....
+ $_maxsec = 0;
+ foreach ( $_plugin_new_elapses as $key=>$val )
+ {
+ if ( $_maxsec < $key ) $_maxsec = $key;
+ }
}
-
function plugin_new_inline()
{
+ global $_maxsec;
....
+ //else if ( preg_match("/\/\*$/", $date) ){
+ else if ( substr($date, -2) === "/*" ) {
+ $refer_len = strlen($date)-1;
+ $refer = substr($date, 0, $refer_len);
+ $timestamp = UTIME - $_maxsec;
+ $retval = "";
+ foreach (get_existpages() as $_page)
+ {
+ if (strpos($_page,$refer) === 0)
+ {
+ $tm = get_filetime($_page);
+ if ( $timestamp < $tm ) {
+ $timestamp = $tm;
+ $retval = make_page...
+ }
+ }
+ }
+ if ( $retval === "" ) $timestamp = 0;
+ }
-というわけで、new.inc.phpのv1.2に上の変更を加えてみたも...
-別の機能になってしまいますが、&newを使う場所によって...
--作ってみました。&ref(new.inc.php-1.2+sha.2);では、引数...
&new(nostring,2003-07-28 (月) 13:38:41);
&new(nostring,BugTrack/*);
---PHP 5.1からの[[strtotimeの仕様変更対応>dev:BugTrack2/1...
new.inc.php-1.2+sha.2に対しての差分です。
- else if ( ( $timestamp = strtotime($date)) !== -1 )
- {
- $timestamp -= LOCALZONE;
- $retval = htmlspecialchars($date);
- }
- else {
- return FALSE;
- }
+ else {
+ // PHP 5.1からのstrtotime()の仕様変更対応
+ if(LANG == 'ja') {
+ $timestamp = strtotime(preg_replace('/\([^\x00-\x7f]...
+ } else {
+ $timestamp = strtotime($date);
+ }
+ if ($timestamp === -1 || $timestamp === FALSE) {
+ $timestamp = strtotime("now"); // 何も指定無し now ...
+ }
+ $timestamp -= LOCALZONE;
+ $retval = htmlspecialchars($date);
+ }
-ありゃ。被っちゃいました。以下のような指定方法を考えてい...
カレントページ
&new;
ページ指定
&new([page][,nolink]);
プレフィクス指定
&new(prefix/[,nolink]);
日付文字列
&new([nodate]){日付文字列};
--あ、ええと、お任せします。機能は同じですので、他のコマ...
-要望です。「ページ指定」の場合に、''new!''表示するときだ...
//#comment
ページ名: