|
本館粉絲專頁 |
|
|
使用者:Fumetw/工作日誌:修訂版本之間的差異
台灣棒球維基館
小 |
小 |
||
(由1名用戶作出的6個中途修訂版本未被顯示) | |||
第4行: | 第4行: | ||
*傳福盃有好多不同的比賽,全國的、北區的、軟式還有硬式,有點搞不太清楚--[[使用者:Fumetw|Fumetw]] 2011年12月12日 (一) 10:24 (CST) | *傳福盃有好多不同的比賽,全國的、北區的、軟式還有硬式,有點搞不太清楚--[[使用者:Fumetw|Fumetw]] 2011年12月12日 (一) 10:24 (CST) | ||
==2013-06-19== | ==2013-06-19== | ||
− | *新增按鈕[[模板:Clickable button]],需修改MediaWiki:Common. | + | *新增按鈕[[模板:Clickable button]],需修改MediaWiki:Common.js,搭配Extension:Cite、Extension:ParserFunctions。 |
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
第17行: | 第17行: | ||
*上傳圖檔授權改成用選單選擇,修改MediaWiki:Licenses。 | *上傳圖檔授權改成用選單選擇,修改MediaWiki:Licenses。 | ||
==2013-06-29== | ==2013-06-29== | ||
+ | ===使用者自訂CSS與JS語法=== | ||
*研究出開放使用者自訂CSS與JS語法,需在LocalSettings.php裡面加入這樣兩行: | *研究出開放使用者自訂CSS與JS語法,需在LocalSettings.php裡面加入這樣兩行: | ||
+ | <syntaxhighlight lang="php"> | ||
$wgAllowUserJs = true; | $wgAllowUserJs = true; | ||
− | |||
$wgAllowUserCss = true; | $wgAllowUserCss = true; | ||
− | + | </syntaxhighlight> | |
資料來源:[http://zh.wikipedia.org/wiki/Help:%E8%87%AA%E5%AE%9A%E4%B9%89%E8%AE%BE%E7%BD%AE#.E8.87.AA.E5.AE.9A.E4.B9.89CSS.E5.92.8C.E6.B5.8F.E8.A7.88.E5.99.A8CSS.E7.9A.84.E5.AF.B9.E6.AF.94 使用說明:自定義設置] | 資料來源:[http://zh.wikipedia.org/wiki/Help:%E8%87%AA%E5%AE%9A%E4%B9%89%E8%AE%BE%E7%BD%AE#.E8.87.AA.E5.AE.9A.E4.B9.89CSS.E5.92.8C.E6.B5.8F.E8.A7.88.E5.99.A8CSS.E7.9A.84.E5.AF.B9.E6.AF.94 使用說明:自定義設置] | ||
==2013-07-10== | ==2013-07-10== | ||
第35行: | 第36行: | ||
參考資源: | 參考資源: | ||
[http://note.prudentman.idv.tw/2008/08/html.html 在HTML內使用編號或符號] | [http://note.prudentman.idv.tw/2008/08/html.html 在HTML內使用編號或符號] | ||
+ | ==2013-07-15== | ||
+ | ===刪除大量垃圾頁面外掛Extension:Nuke、Extension:DeleteBatch=== | ||
+ | |||
+ | *Extension:Nuke:適合用於每日巡察零星刪除,要刪除十幾萬垃圾頁面,每次先列出最近的頁面,怎麼設一次最多只能刪一千頁,如果要更多可能要調整程式,要刪十幾萬垃圾頁面就不適合。 | ||
+ | |||
+ | *Extension:DeleteBatch:大量刪除垃圾頁面推薦使用,可從所有頁面中的標題抓到excel挑選後,貼到裡面刪除。更好的方法是到資料庫撈出頁面標題。 | ||
+ | *例如 | ||
+ | <syntaxhighlight lang="php"> | ||
+ | SELECT `page_title` | ||
+ | FROM `page` | ||
+ | WHERE 1 | ||
+ | LIMIT 0 , 10000 | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | *撈出來會依照字母排列,垃圾頁面一般英文標題居多,即可大量刪除且避免誤刪的狀況。 | ||
+ | |||
==2013-07-16== | ==2013-07-16== | ||
+ | ===DISQUS留言管理系統=== | ||
*討論區功能測試完成,採DISQUS留言機制(算是主流的整合性留言管理系統,缺點是需帳號登入留言,如google、facebook等),需嵌入程式碼,或是安裝外掛Extension:AvbDisqus、Extension:MpDisqus。 | *討論區功能測試完成,採DISQUS留言機制(算是主流的整合性留言管理系統,缺點是需帳號登入留言,如google、facebook等),需嵌入程式碼,或是安裝外掛Extension:AvbDisqus、Extension:MpDisqus。 | ||
*Extension:AvbDisqus 安裝完需在頁面宣告<disqus></disqus>,如需一次在每個頁面出現可能要搭配Extension:Widgets或Extension:HeaderFooter,嘗試過後無法達成。 | *Extension:AvbDisqus 安裝完需在頁面宣告<disqus></disqus>,如需一次在每個頁面出現可能要搭配Extension:Widgets或Extension:HeaderFooter,嘗試過後無法達成。 | ||
− | *最後安裝Extension: | + | *最後安裝Extension:MpDisqus,即可出現於所有頁面(包含最近更改、註冊頁與特殊頁面),最後參考duoshuo程式來修改。 |
*在MpDisqus.php的基礎下,從 | *在MpDisqus.php的基礎下,從 | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
− | + | function onSkinAfterContent_AddMpDisqus1(&$data, $skin) | |
− | + | { | |
</syntaxhighlight> | </syntaxhighlight> | ||
*貼上 | *貼上 | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
− | global $ | + | |
+ | global $wgMpDisqusWebsiteName, $wgMpDisqusExclude, $wgTitle, $wgRequest, $wgOut; | ||
if($wgTitle->isSpecialPage() | if($wgTitle->isSpecialPage() | ||
第53行: | 第72行: | ||
|| !$wgTitle->canTalk() | || !$wgTitle->canTalk() | ||
|| $wgTitle->isTalkPage() | || $wgTitle->isTalkPage() | ||
− | + | || method_exists($wgTitle, 'isMainPage') && $wgTitle->isMainPage() //拿掉讓首頁顯示 | |
|| in_array($wgTitle->getNamespace(), array(NS_MEDIAWIKI, NS_TEMPLATE, NS_CATEGORY)) | || in_array($wgTitle->getNamespace(), array(NS_MEDIAWIKI, NS_TEMPLATE, NS_CATEGORY)) | ||
|| $wgOut->isPrintable() | || $wgOut->isPrintable() | ||
第59行: | 第78行: | ||
return true; | return true; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | + | ===按鈕顏色=== | |
*按鈕顏色從 resources/jquery/jquery.colorUtil.js 可查到 | *按鈕顏色從 resources/jquery/jquery.colorUtil.js 可查到 | ||
+ | <syntaxhighlight lang="php"> | ||
aqua: [0,255,255], | aqua: [0,255,255], | ||
azure: [240,255,255], | azure: [240,255,255], | ||
第107行: | 第126行: | ||
yellow: [255,255,0], | yellow: [255,255,0], | ||
transparent: [255,255,255] | transparent: [255,255,255] | ||
+ | </syntaxhighlight> | ||
+ | ===防機器人灌水外掛Extension:ConfirmEdit=== | ||
+ | *MathCaptcha:從頭到尾還不會安裝,一天還是有5~10個機器人灌水。 | ||
+ | *SimpleCaptcha:感覺沒什麼效果。 | ||
+ | *QuestyCaptcha:官方的設定好像阻擋效果有限,使用別人改過得來測試[http://thingelstad.com/stopping-mediawiki-spam-with-dynamic-questy-captchas/ Stopping MediaWiki Spam with Dynamic Questy Captcha],並修改成簡單一點的版本,先測試觀察看看。 | ||
+ | *其他複雜的好像也會被攻陷。 | ||
+ | ==2013-07-21== | ||
+ | ===標題樣式修改=== | ||
+ | *透過修改MediaWiki:Vector.css,例如: | ||
+ | <syntaxhighlight lang="php"> | ||
+ | h2{ | ||
+ | font-family:微软雅黑, 黑体, sans-serif; | ||
+ | padding: 5px 10px; | ||
+ | border-left:solid 0.7em #C00; | ||
+ | padding-left:3px | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | ==2013-07-23== | ||
+ | ===jquery-flipcounter=== | ||
+ | *https://github.com/bsnux/jquery-flipcounter | ||
+ | <syntaxhighlight lang="php"> | ||
+ | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> | ||
+ | <script type="text/javascript" src="http://163.13.175.46/beta/skins/jquery-flipcounter.js"></script> | ||
+ | <link rel="stylesheet" type="text/css" href="http://163.13.175.46/beta/skins/css/jquery-flipcounter.css" /> | ||
+ | |||
+ | |||
+ | <style type="text/css" media="screen"> | ||
+ | .blankspace { | ||
+ | clear: both; | ||
+ | } | ||
+ | </style> | ||
+ | |||
+ | <?php | ||
+ | ob_start(); | ||
+ | // $count = $this->html('viewcount'); // 若 $count等於 "本頁瀏覽次數:10,918,563" | ||
+ | $this->html('viewcount'); | ||
+ | $count = ob_get_contents(); | ||
+ | $count = preg_replace('/\D/', '', $count); //去掉非數字,$count變成 "10918563" | ||
+ | //echo "count=" . $count; | ||
+ | //die(); | ||
+ | |||
+ | ?> | ||
+ | |||
+ | <div id="counter"></div> | ||
+ | <div class="blankspace"/> | ||
+ | <div id="counter2"></div> | ||
+ | <script type="text/javascript"> | ||
+ | var counter = <?=$count?>; | ||
+ | var updateMsc = 2000; | ||
+ | var myCounter = new flipCounter('counter', {value:counter}); | ||
+ | |||
+ | function updateCounter() { | ||
+ | myCounter.setValue(counter++); | ||
+ | |||
+ | } | ||
+ | setInterval(updateCounter, updateMsc); | ||
+ | |||
+ | </script> | ||
+ | </syntaxhighlight> | ||
+ | ==2013-07-27== | ||
+ | ===透過AWB將CSV半(全)自動批次編輯=== | ||
+ | [http://zh.wikipedia.org/wiki/Wikipedia:CSV_Loader 維基百科:CSV Loader] | ||
+ | ==2013-07-28== | ||
+ | ===禁止同ip一天多次註冊=== | ||
+ | <syntaxhighlight lang="php"> | ||
+ | $wgAccountCreationThrottle = 1; | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ==2013-08-05== | ||
+ | ===頁籤功能=== | ||
+ | *安裝 Extension:Header_Tabs | ||
+ | ==2013-08-06== | ||
+ | ===刪除已刪除頁面的歷史版本=== | ||
+ | php maintenance/deleteArchivedRevisions.php --delete | ||
+ | *效果可能跟 Extension:DeleteHistory 差不多 |
2013年8月6日 (二) 16:36的最新修訂版本
目次 |
[編輯] 2011-12-1
- 看起來傳福盃的內容還沒有人打,找時間來寫一下。--Fumetw 2011年12月1日 (四) 21:22 (CST)
- 待辦事項:聚會紀錄進度為34:20秒--Fumetw 2011年12月7日 (三) 10:29 (CST)
- 傳福盃有好多不同的比賽,全國的、北區的、軟式還有硬式,有點搞不太清楚--Fumetw 2011年12月12日 (一) 10:24 (CST)
[編輯] 2013-06-19
- 新增按鈕模板:Clickable button,需修改MediaWiki:Common.js,搭配Extension:Cite、Extension:ParserFunctions。
mw.loader.load( 'jquery.ui.button' ); function my_accordion() { jQuery( "#button" ).accordion({ collapsible: true, active: false }); } jQuery( my_button);
[編輯] 2013-06-20
- 升級後將網站標題「Twbsball」改成「台灣棒球維基館」,若是新版可從從LocalSettings修改,但本館是從舊版更新過來直接修改LocalSettings會導致一些頁面連節不見,因此修改MediaWiki:Pagetitle-view-mainpage。
[編輯] 2013-06-26
- 上傳圖檔授權改成用選單選擇,修改MediaWiki:Licenses。
[編輯] 2013-06-29
[編輯] 使用者自訂CSS與JS語法
- 研究出開放使用者自訂CSS與JS語法,需在LocalSettings.php裡面加入這樣兩行:
$wgAllowUserJs = true; $wgAllowUserCss = true;
資料來源:使用說明:自定義設置
[編輯] 2013-07-10
- 將最近更改頁面每日編輯之項目符號改為自動編號,修改SpecialRecentchanges.php。
$s .= $list->endRecentChangesList(); $tmp = str_replace('<ul class="special">', '<ol class="special">', $s); // alex $s = str_replace('</ul>', '</ol>', $tmp); // alex $this->getOutput()->addHTML( $s );
參考資源: 在HTML內使用編號或符號
[編輯] 2013-07-15
[編輯] 刪除大量垃圾頁面外掛Extension:Nuke、Extension:DeleteBatch
- Extension:Nuke:適合用於每日巡察零星刪除,要刪除十幾萬垃圾頁面,每次先列出最近的頁面,怎麼設一次最多只能刪一千頁,如果要更多可能要調整程式,要刪十幾萬垃圾頁面就不適合。
- Extension:DeleteBatch:大量刪除垃圾頁面推薦使用,可從所有頁面中的標題抓到excel挑選後,貼到裡面刪除。更好的方法是到資料庫撈出頁面標題。
- 例如
SELECT `page_title` FROM `page` WHERE 1 LIMIT 0 , 10000
- 撈出來會依照字母排列,垃圾頁面一般英文標題居多,即可大量刪除且避免誤刪的狀況。
[編輯] 2013-07-16
[編輯] DISQUS留言管理系統
- 討論區功能測試完成,採DISQUS留言機制(算是主流的整合性留言管理系統,缺點是需帳號登入留言,如google、facebook等),需嵌入程式碼,或是安裝外掛Extension:AvbDisqus、Extension:MpDisqus。
- Extension:AvbDisqus 安裝完需在頁面宣告<disqus></disqus>,如需一次在每個頁面出現可能要搭配Extension:Widgets或Extension:HeaderFooter,嘗試過後無法達成。
- 最後安裝Extension:MpDisqus,即可出現於所有頁面(包含最近更改、註冊頁與特殊頁面),最後參考duoshuo程式來修改。
- 在MpDisqus.php的基礎下,從
function onSkinAfterContent_AddMpDisqus1(&$data, $skin) {
- 貼上
global $wgMpDisqusWebsiteName, $wgMpDisqusExclude, $wgTitle, $wgRequest, $wgOut; if($wgTitle->isSpecialPage() || $wgTitle->getArticleID() == 0 || !$wgTitle->canTalk() || $wgTitle->isTalkPage() || method_exists($wgTitle, 'isMainPage') && $wgTitle->isMainPage() //拿掉讓首頁顯示 || in_array($wgTitle->getNamespace(), array(NS_MEDIAWIKI, NS_TEMPLATE, NS_CATEGORY)) || $wgOut->isPrintable() || $wgRequest->getVal('action', 'view') != "view") return true;
[編輯] 按鈕顏色
- 按鈕顏色從 resources/jquery/jquery.colorUtil.js 可查到
aqua: [0,255,255], azure: [240,255,255], beige: [245,245,220], black: [0,0,0], blue: [0,0,255], brown: [165,42,42], cyan: [0,255,255], darkblue: [0,0,139], darkcyan: [0,139,139], darkgrey: [169,169,169], darkgreen: [0,100,0], darkkhaki: [189,183,107], darkmagenta: [139,0,139], darkolivegreen: [85,107,47], darkorange: [255,140,0], darkorchid: [153,50,204], darkred: [139,0,0], darksalmon: [233,150,122], darkviolet: [148,0,211], fuchsia: [255,0,255], gold: [255,215,0], green: [0,128,0], indigo: [75,0,130], khaki: [240,230,140], lightblue: [173,216,230], lightcyan: [224,255,255], lightgreen: [144,238,144], lightgrey: [211,211,211], lightpink: [255,182,193], lightyellow: [255,255,224], lime: [0,255,0], magenta: [255,0,255], maroon: [128,0,0], navy: [0,0,128], olive: [128,128,0], orange: [255,165,0], pink: [255,192,203], purple: [128,0,128], violet: [128,0,128], red: [255,0,0], silver: [192,192,192], white: [255,255,255], yellow: [255,255,0], transparent: [255,255,255]
[編輯] 防機器人灌水外掛Extension:ConfirmEdit
- MathCaptcha:從頭到尾還不會安裝,一天還是有5~10個機器人灌水。
- SimpleCaptcha:感覺沒什麼效果。
- QuestyCaptcha:官方的設定好像阻擋效果有限,使用別人改過得來測試Stopping MediaWiki Spam with Dynamic Questy Captcha,並修改成簡單一點的版本,先測試觀察看看。
- 其他複雜的好像也會被攻陷。
[編輯] 2013-07-21
[編輯] 標題樣式修改
- 透過修改MediaWiki:Vector.css,例如:
h2{ font-family:微软雅黑, 黑体, sans-serif; padding: 5px 10px; border-left:solid 0.7em #C00; padding-left:3px }
[編輯] 2013-07-23
[編輯] jquery-flipcounter
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <script type="text/javascript" src="http://163.13.175.46/beta/skins/jquery-flipcounter.js"></script> <link rel="stylesheet" type="text/css" href="http://163.13.175.46/beta/skins/css/jquery-flipcounter.css" /> <style type="text/css" media="screen"> .blankspace { clear: both; } </style> <?php ob_start(); // $count = $this->html('viewcount'); // 若 $count等於 "本頁瀏覽次數:10,918,563" $this->html('viewcount'); $count = ob_get_contents(); $count = preg_replace('/\D/', '', $count); //去掉非數字,$count變成 "10918563" //echo "count=" . $count; //die(); ?> <div id="counter"></div> <div class="blankspace"/> <div id="counter2"></div> <script type="text/javascript"> var counter = <?=$count?>; var updateMsc = 2000; var myCounter = new flipCounter('counter', {value:counter}); function updateCounter() { myCounter.setValue(counter++); } setInterval(updateCounter, updateMsc); </script>
[編輯] 2013-07-27
[編輯] 透過AWB將CSV半(全)自動批次編輯
[編輯] 2013-07-28
[編輯] 禁止同ip一天多次註冊
$wgAccountCreationThrottle = 1;
[編輯] 2013-08-05
[編輯] 頁籤功能
- 安裝 Extension:Header_Tabs
[編輯] 2013-08-06
[編輯] 刪除已刪除頁面的歷史版本
php maintenance/deleteArchivedRevisions.php --delete
- 效果可能跟 Extension:DeleteHistory 差不多