跳转到内容

模組:IncrementParams

维基百科,自由的百科全书

这是本页的一个历史版本,由BlackShadowG留言 | 贡献2024年1月4日 (四) 10:47 (// Edit via Wikiplus)编辑。这可能和当前版本存在着巨大的差异。

-- 第一步:點擊頁面頂部「編輯」按鈕開始編輯本模組。
-- STEP 1: Click on the "edit" tab at the top of the page to edit this module.

-- 第二步:如果你想加上1以上的數目,請修改等號後的數字。
-- STEP 2: if you want to increment by a number other than 1, put that number below, after the equals sign. 
local increment = 1

-- 第三步:用你想增加數字的模板部分替換下方內容。
-- STEP 3: Replace the example template text with the template text that you wish to increment.
local templatetext = [==========[
| label55     = {{#if:{{{novel|}}}|小说|书籍}}
| data55      = {{{books|{{{novel|}}}}}}

| header56    = {{#if:{{{interests|}}}|興趣}}

| data57      = {{#if:{{{interests|}}}|<div style="text-align: left">
{{{interests|}}}
</div>}}

| header58    = {{#if:{{{website|}}}{{{blog|}}}{{{email|}}}{{{icq|}}}{{{aim|}}}{{{gtalk|}}}{{{jabber|}}}{{{skype|}}}{{{yahoo|}}}{{{mac|}}}{{{irc|}}}{{{facebook|}}}{{{google+|}}}{{{instagram|}}}{{{linkedin|}}}{{{myspace|}}}{{{pinterest|}}}{{{twitter|}}}{{{youtube|}}}{{{flickr|}}}|聯繫方式}}

| label59     = 網站
| data59      = {{{website|}}}

| label60     = 網誌
| data60      = {{{blog|}}}

| label61     = 電子郵件
| data61      = {{{email|}}}

| label62     = [[ICQ|{{color|{{{fontcolor|}}}|ICQ}}]]
| data62      = {{#if:{{{icq|}}}|[http://people.icq.com/people/about_me.php?uin={{urlencode:{{{icq}}}}} {{{icq}}}]}}

| label63     = [[腾讯QQ|{{color|{{{fontcolor|}}}|QQ}}]]
| data63      = {{#if:{{{QQ|}}}|[https://wpa.qq.com/msgrd?uin={{urlencode:{{{QQ}}}}} {{{QQ}}}]}}

| label64     = [[AIM (應用程式)|{{color|{{{fontcolor|}}}|AIM}}]]
| data64      = {{{aim|}}}

| label65     = [[GTalk|{{color|{{{fontcolor|}}}|GTalk}}]]
| data65      = {{{gtalk|}}}

| label66     = [[XMPP|{{color|{{{fontcolor|}}}|XMPP}}]]
| data66      = {{{jabber|}}}

| label67     = [[Skype|{{color|{{{fontcolor|}}}|Skype}}]]
| data67      = {{{skype|}}}

| label68     = [[雅虎]]
| data68      = {{#if:{{{yahoo|}}}|[http://profiles.yahoo.com/{{urlencode:{{{yahoo}}}}} {{{yahoo}}}]}}

| label69     = .Mac
| data69      = {{{mac|}}}

| label70     = [[WP:IRC|{{color|{{{fontcolor|}}}|IRC}}]]
| data70      = {{{irc|}}}

| label71     = [[Facebook|{{color|{{{fontcolor|}}}|Facebook}}]]
| data71      = {{#if:{{{facebook|}}}|[https://www.facebook.com/{{urlencode:{{{facebook}}}}} {{{facebook}}}]}}

| label72     = [[Flickr|{{color|{{{fontcolor|}}}|Flickr}}]]
| data72      = {{#if:{{{flickr|}}}|[https://www.flickr.com/photos/{{urlencode:{{{flickr}}}}} {{{flickr}}}]}}

| label73     = [[GitHub|{{color|{{{fontcolor|}}}|GitHub}}]]
| data73      = {{#if:{{{github|}}}|[https://github.com/{{urlencode:{{{github}}}}} {{{github}}}]}}

| label74     = [[Instagram|{{color|{{{fontcolor|}}}|Instagram}}]]
| data74      = {{#if:{{{instagram|}}}|[https://www.instagram.com/{{urlencode:{{{instagram}}}}} {{{instagram}}}]}}

| label75     = [[領英|{{color|{{{fontcolor|}}}|領英}}]]
| data75     = {{#if:{{{linkedin|}}}|[http://www.linkedin.com/profile/view?&name={{urlencode:{{{linkedin}}}}} {{{linkedin}}}]}}

| label76    = [[Myspace|{{color|{{{fontcolor|}}}|Myspace}}]]
| data76      = {{{myspace|}}}

| label77     = [[Pinterest|{{color|{{{fontcolor|}}}|Pinterest}}]]
| data77      = {{{pinterest|}}}

| label78     = [[Twitter|{{color|{{{fontcolor|}}}|Twitter}}]]
| data78      = {{#if:{{{twitter|}}}|[https://twitter.com/{{urlencode:{{{twitter}}}}} {{{twitter}}}]}}

| label79     = [[新浪微博|{{color|{{{fontcolor|}}}|新浪微博}}]]
| data79      = {{#if:{{{weibo|}}}|[http://weibo.com/{{urlencode:{{{weibo}}}}} {{{weibo}}}]}}

| label80     = [[腾讯微博|{{color|{{{fontcolor|}}}|腾讯微博}}]]
| data80      = {{#if:{{{T.QQ|}}}|[http://t.qq.com/{{urlencode:{{{T.QQ}}}}} {{{T.QQ}}}]}}

| label81     = [[YouTube|{{color|{{{fontcolor|}}}|YouTube}}]]
| data81      = {{#if:{{{youtube|}}}|[https://www.youtube.com/user/{{urlencode:{{{youtube}}}}} {{{youtube}}}]}}

| label82     = [[YouTube|{{color|{{{fontcolor|}}}|YouTube}}]]
| data82      = {{#if:{{{channel|}}}|[https://www.youtube.com/channel/{{urlencode:{{{channel}}}}} {{{channelname}}}]}}

| label83     = [[土豆网|{{color|{{{fontcolor|}}}|土豆网}}]]
| data83      = {{#if:{{{tudou|}}}|{{{tudou}}}}}

| header86    = {{#if:{{{subpages|}}}|[[Special:Prefixindex/User:{{BASEPAGENAMEE}}|{{BASEPAGENAME}}子页面]]}}

| data87      = {{#if:{{{subpages|}}}|<div style="text-align: left">
{{{subpages|}}}
</div>}}

| header88    = {{#if:{{{joined_date|}}}{{{first_edit|}}}{{{autoconfirmed|}}}{{{confirmed|}}}{{{rollbacker|}}}{{{autopatrolled|}}}{{{mass_message_sender|}}}{{{admin|}}}{{{bureaucrat|}}}{{{check_user|}}}{{{overseer|}}}{{{edit_count|}}}{{{permissions|}}}{{{signature|}}}|帳戶統計}}

| label89     = 加入
| data89      = {{{joined_date|}}}

| label90     = 首次編輯
| data90      = {{{first_edit|}}}

| label91     = {{Nowrap|[[WP:CONFIRM|{{color|{{{fontcolor|}}}|{{#if:{{{autoconfirmed|}}}|{{#if:{{{confirmed|}}}|確認用戶<br />}}自動確認用戶|{{#if:{{{confirmed|}}}|確認用戶}}}}}}]]}}
| data91      = {{#if:{{{autoconfirmed|}}}|{{#if:{{{confirmed|}}}|{{{confirmed}}}<br />}}{{{autoconfirmed}}}|{{#if:{{{confirmed|}}}|{{{confirmed}}}}}}}

| label92     = [[WP:EXTENDEDCONFIRMED|{{color|{{{fontcolor|}}}|延伸确认用户}}]]
| data92      = {{{extended_confirmed|}}}

| label93     = [[WP:巡查員|{{color|{{{fontcolor|}}}|巡查員}}]]
| data93      = {{{new_page_reviewer|}}}

| label94     = [[WP:RBK|{{color|{{{fontcolor|}}}|回退員}}]]
| data94      = {{{rollbacker|}}}

| label95     = [[WP:AUTOPAT|{{color|{{{fontcolor|}}}|巡查豁免者}}]]
| data95      = {{{autopatrolled|}}}

| label96     = [[WP:模板編輯員|{{color|{{{fontcolor|}}}|模板編輯員}}]]
| data96      = {{{template_editor|}}}

| label97     = [[Wikipedia:過濾器助理|{{color|{{{fontcolor|}}}|過濾器助理}}]]
| data98      = {{{edit_filter_helper|}}}

| label99     = [[WP:MMS|{{color|{{{fontcolor|}}}|大量訊息發送者}}]]
| data99      = {{{mass_message_sender|}}}

| label100     = [[WP:大量帳號建立者|{{color|{{{fontcolor|}}}|大量帳號建立者}}]]
| data100      = {{{account_creator|}}}

| label101     = [[WP:ADMIN|{{color|{{{fontcolor|}}}|管理員}}]]
| data101      = {{{admin|}}}

| label102     = [[WP:CRAT|{{color|{{{fontcolor|}}}|行政員}}]]
| data102      = {{{bureaucrat|}}}

| label103     = [[WP:CHK|{{color|{{{fontcolor|}}}|用戶查核員}}]]
| data103      = {{{check_user|}}}

| label104     = [[WP:OVERSIGHT|{{color|{{{fontcolor|}}}|監督員}}]]
| data104      = {{{overseer|}}}

| label105     = [[xtools:ec/zh.wikipedia.org/{{ROOTPAGENAME}}|{{color|{{{fontcolor|}}}|編輯統計}}]]
| data105      = {{{edit_count|}}}

| label106     = {{#if:{{{permissions|}}}|<span class="plainlinks">[{{fullurl:Special:ListUsers|limit=1&username={{ROOTPAGENAMEE}}}} {{color|{{{fontcolor|}}}|權限}}]</span>}}
| data106      = {{{permissions|}}}

| label107     = {{{custom_label_account_1|}}}
| data107      = {{{custom_data_account_1|}}}

| label108     = {{{custom_label_account_2|}}}
| data1108      = {{{custom_data_account_2|}}}

| label109     = {{{custom_label_account_3|}}}
| data109      = {{{custom_data_account_3|}}}

| label110     = 簽名
| data110      = {{{signature|}}}

| data111     = {{{module|}}}
| data112     = {{{module2|}}}
| data113     = {{{module3|}}}

| header114    = {{#if:{{{userboxes|}}}|用戶框}}

| data115      = {{#if:{{{userboxes|}}}|
<table style="background: transparent; vertical-align: middle !important; text-align: center; font-size: 95%; color: {{{fontcolor|#000000}}}; margin: auto; border-spacing: 0px; border-collapse: collapse;">
<tr><td>
{{{userboxes|}}}
</td></tr>
</table>
}}

| header116    = {{{custom_header|}}}

| data117      = {{#if:{{{custom_data|}}}|<div style="text-align: left">
{{{custom_data|}}}
</div>}}
| label118     = {{{custom_label1|}}}
| data118      = {{{custom_data1|}}}
| label119     = {{{custom_label2|}}}
| data119      = {{{custom_data2|}}}
| label120     = {{{custom_label3|}}}
| data120      = {{{custom_data3|}}}
| label121     = {{{custom_label4|}}}
| data121      = {{{custom_data4|}}}
| label122     = {{{custom_label5|}}}
| data122      = {{{custom_data5|}}}
| label123     = {{{custom_label6|}}}
| data123      = {{{custom_data6|}}}
| label124     = {{{custom_label7|}}}
| data124      = {{{custom_data7|}}}
| label125     = {{{custom_label8|}}}
| data125      = {{{custom_data8|}}}
| label126     = {{{custom_label9|}}}
| data126      = {{{custom_data9|}}}
}}{{Category handler
|page = {{{demopage|}}}
|nocat = {{{nocat|false}}}
|user = {{#switch:{{lc:{{{gender|{{Gender:{{#titleparts:{{BASEPAGENAME}}|1}}|m|f|NONE}}}}}}}
           |[[男]]|[[男性]]|male|m=[[Category:男性维基人]]
           |[[女]]|[[女性]]|female|f=[[Category:女性维基人]]}}
}}<noinclude>{{Documentation}}</noinclude>


]==========]

-- 第四步:保存本模組。
-- STEP 4: Save this module.

-- 第五步:你現在可以通過以下代碼輸出數字增加後的代碼:
--                {{subst:#invoke:IncrementParams|main}}
-- 又或者直接拷貝下方模組文檔中的修改後的代碼。
-- STEP 5: You can now output the incremented text with the following code:
--                {{subst:#invoke:IncrementParams|main}}
-- Or you can simply copy and paste the text from this module's documentation.

-- 第六步:檢查輸出內容!在某些情況下本模組可能會產生部分假陽性結果。
-- 比如它會將「[[Some link|foo3=bar]]」修改為「[[Some link|foo4=bar]]」。
-- 你可以通過模板編輯頁面中「顯示變更」按鈕檢查是否有假陽性結果存在。
-- STEP 6: Check the output! In rare cases this module might produce false positives.
-- For example, it will change the text "[[Some link|foo3=bar]]" to "[[Some link|foo4=bar]]".
-- You can use the "show changes" function in the edit window of the template you are editing
-- to find any false positives.

-- 第七步:當你完成後,撤回你於本模組的編輯,避免下一個使用本模組的人對使用方法感到混淆。
-- 謝謝使用本模組!
-- STEP 7: When you are finished, undo your changes to this page, so that the next person
-- won't be confused by seeing any non-default values. Thanks for using this module!

local p = {}
 
local function replace(prefix, num, suffix)
    return '|' .. prefix .. tostring(tonumber(num) + increment) .. suffix .. '='
end
 
function p.main(frame)
    -- Increment the template text.
    templatetext = mw.ustring.gsub(templatetext, '|(%s*%a?[%a_%-]-%s*)([1-9]%d*)(%s*[%a_%-]-%a?%s*)=', replace)
    -- Add pre tags and escape html etc. if the pre option is set.
    if frame and frame.args and frame.args.pre and frame.args.pre ~= '' then
        templatetext = mw.text.nowiki(templatetext)
        templatetext = '<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; '
            .. 'white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word;">' 
            .. templatetext .. '</pre>'
    end
    return templatetext
end
 
return p