|
本館粉絲專頁 |
|
|
使用者:台灣阿成/我的工作日誌:修訂版本之間的差異
台灣棒球維基館
< 使用者:台灣阿成
小 (→09/05) |
(→09/16) |
||
第45行: | 第45行: | ||
===09/16=== | ===09/16=== | ||
*初步完成「最近討論」程式:[[Special:Recenttalks]](還有一些小bugs要改) | *初步完成「最近討論」程式:[[Special:Recenttalks]](還有一些小bugs要改) | ||
+ | *SpecialPage.php | ||
+ | *SpecialRecenttalks.php:由SpecialRecentchanges.php加以修改而成 | ||
+ | <pre> | ||
+ | function wfSpecialRecenttalks( $par ) { | ||
+ | |||
+ | ... | ||
+ | |||
+ | $minorLink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recenttalks' ), | ||
+ | $showhide[1-$hideminor], wfArrayToCGI( array( 'hideminor' => 1-$hideminor ), $urlparams ) ); | ||
+ | $botLink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recenttalks' ), | ||
+ | $showhide[1-$hidebots], wfArrayToCGI( array( 'hidebots' => 1-$hidebots ), $urlparams ) ); | ||
+ | $liuLink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recenttalks' ), | ||
+ | $showhide[1-$hideliu], wfArrayToCGI( array( 'hideliu' => 1-$hideliu ), $urlparams ) ); | ||
+ | $patrLink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recenttalks' ), | ||
+ | $showhide[1-$hidepatrolled], wfArrayToCGI( array( 'hidepatrolled' => 1-$hidepatrolled ), $urlparams ) ); | ||
+ | |||
+ | ... | ||
+ | |||
+ | $note = rcDayLimitLinks( $days, $limit, 'Recenttalks', $hideparams, false, $minorLink, $botLink, $liuLink, $patrLink ); | ||
+ | |||
+ | ... | ||
+ | |||
+ | $sk->makeKnownLink( $wgContLang->specialPage( 'Recenttalks' ), | ||
+ | $wgLang->timeanddate( $now, true ), $hideparams.'&from='.$now ) ); | ||
+ | |||
+ | ... | ||
+ | |||
+ | $feedTitle = $wgSitename . ' - ' . wfMsgForContent( 'Recenttalks' ) . | ||
+ | |||
+ | ... | ||
+ | |||
+ | } | ||
+ | |||
+ | function rcCountLink( $lim, $d, $page='Recenttalks', $more='' ) { | ||
+ | |||
+ | ... | ||
+ | |||
+ | } | ||
+ | |||
+ | function rcDaysLink( $lim, $d, $page='Recenttalks', $more='' ) { | ||
+ | |||
+ | ... | ||
+ | |||
+ | } | ||
+ | |||
+ | function rcDayLimitLinks( $days, $limit, $page='Recenttalks', $more='', $doall = false, $minorLink = '', | ||
+ | $botLink = '', $liuLink = '', $patrLink = '' ) { | ||
+ | |||
+ | ... | ||
+ | |||
+ | } | ||
+ | |||
+ | </pre> |
2006年9月24日 (日) 17:49的修訂版本
目次 |
以往的工作日誌
- 2005/06 | 2005/07 | 2005/08 | 2005/09 | 2005/10 | 2005/11 | 2005/12
- 2006/01 | 2006/02 | 2006/03 | 2006/04 | 2006/05 | 2006/06 | 2006/07 | 2006/08
- 檢索Google
近期的工作日誌
2006/09
09/05
修改程式,加入一個內建變數TOTALVIEWS,就可以在任何頁面顯示全站總點閱次數了:模板:TOTALVIEWS。作法:
- Language.php:
$wgMagicWordsEn = array( ... MAG_TOTALVIEWS => array( 1, 'TOTALVIEWS'), <-- 加這一行 ...
- MagicWord.php:
define('MAG_TOTALVIEWS', 39); <-- 加這一行 ... $wgVariableIDs = array( ... MAG_TOTALVIEWS <-- 加這一行 ...
- Parser.php:
... case MAG_TOTALVIEWS: <-- 加這一行 return $varCache[$index] = $wgContLang->formatNum( wfTotalViews() ); <-- 加這一行 ... function wfTotalViews() { <-- 加以下這個function global $wgTotalViews; wfLoadSiteStats(); return $wgTotalViews; }
- 愛睏囉~~~ --台灣阿成(Talk) 01:00 2006年9月5日
- 嗯,好像還有一些問題:首頁和統計頁次數有小誤差。明天再看。 --台灣阿成(Talk) 01:08 2006年9月5日
- 喔,是因為cache的問題,首頁變數show出的是cache的資料,統計頁面算出的是即時資料。 --台灣阿成(Talk) 17:38 2006年9月24日
09/16
- 初步完成「最近討論」程式:Special:Recenttalks(還有一些小bugs要改)
- SpecialPage.php
- SpecialRecenttalks.php:由SpecialRecentchanges.php加以修改而成
function wfSpecialRecenttalks( $par ) { ... $minorLink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recenttalks' ), $showhide[1-$hideminor], wfArrayToCGI( array( 'hideminor' => 1-$hideminor ), $urlparams ) ); $botLink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recenttalks' ), $showhide[1-$hidebots], wfArrayToCGI( array( 'hidebots' => 1-$hidebots ), $urlparams ) ); $liuLink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recenttalks' ), $showhide[1-$hideliu], wfArrayToCGI( array( 'hideliu' => 1-$hideliu ), $urlparams ) ); $patrLink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recenttalks' ), $showhide[1-$hidepatrolled], wfArrayToCGI( array( 'hidepatrolled' => 1-$hidepatrolled ), $urlparams ) ); ... $note = rcDayLimitLinks( $days, $limit, 'Recenttalks', $hideparams, false, $minorLink, $botLink, $liuLink, $patrLink ); ... $sk->makeKnownLink( $wgContLang->specialPage( 'Recenttalks' ), $wgLang->timeanddate( $now, true ), $hideparams.'&from='.$now ) ); ... $feedTitle = $wgSitename . ' - ' . wfMsgForContent( 'Recenttalks' ) . ... } function rcCountLink( $lim, $d, $page='Recenttalks', $more='' ) { ... } function rcDaysLink( $lim, $d, $page='Recenttalks', $more='' ) { ... } function rcDayLimitLinks( $days, $limit, $page='Recenttalks', $more='', $doall = false, $minorLink = '', $botLink = '', $liuLink = '', $patrLink = '' ) { ... }