Jump to content

Module:IncrementParams

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Amadalvarez (talk | contribs) at 15:06, 16 July 2019. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

-- STEP 1: Click on the "edit" tab at the top of the page to edit this module.

-- STEP 2: if you want to increment by a number other than 1, put that number below, after the equals sign. 
local increment = 200

-- STEP 3: Replace the example template text with the template text that you wish to increment.
local templatetext = [==========[
|header90 = {{#if:{{{esport|}}}{{{estadi|}}}{{{periode_actiu|}}}{{{regio|}}}{{{productes|}}}{{{produccio|}}}
                  {{{serveis|}}}{{{membrede|}}} {{{codi_fifa|}}}{{{ambit|}}}{{{exposicio|}}}{{{superficie|}}}
                  {{{coleccions|}}}{{{tipus_documents|}}}{{{volum_coleccio|}}} {{{visitants|}}}
                  {{{prestecs_anuals|}}}{{{nom_habitants|}}}{{{llits|}}}{{{activitats|}}} {{{public_objectiu|}}}
                  {{{cotitzen_borsa|}}}{{{nom_comercial|}}}{{{metodes|}}}{{{metode|}}}{{{membres|}}}{{{membres2|}}}
                  {{{membres3|}}}{{{membres_llista|}}}{{{alumnes|}}}{{{voluntaris|}}} {{{membres_anteriors|}}}
                  {{{discografica|}}} {{{artistes_relacionats|}}}{{{influencies_de|}}}
                  {{{art|}}}{{{genere|}}}{{{moviment|}}} {{{estil|}}}{{{conductor_cor|}}}
                  {{{instruments_destacats|}}}{{{obres_notables|}}}{{{director_musical|}}}{{{bloc_activitat_especial|}}}
                  {{{nom_activitat1|}}}{{{nom_activitat2|}}}{{{nom_activitat3|}}}{{{nom_activitat4|}}}{{{nom_activitat5|}}}
                  {{{ocupacio_membres|}}}
              | {{GetLabelFix|Q1914636|lang={{{lang|}}}}}<!-- Activitat --> }}
| label92  = {{GetLabelFix|P3989|lang={{{lang|}}}}} 
|  data92  = {{{ocupacio_membres|}}}
| label93  = {{GetLabelFix|P641|lang={{{lang|}}}}} 
|  data93  = {{{esport|}}}
| label94  = {{GetLabelFix|P115|lang={{{lang|}}}}} 
|  data94  = {{{estadi|}}}
| label95 = {{GetLabelFix|Q55579539|lang={{{lang|}}}}} 
|  data95 = {{{periode_actiu|}}}
| label96 = {{GetLabelFix|P2541|lang={{{lang|}}}}} 
|  data96 = {{{regio|}}}
| label97 = {{GetLabelFix|P2360|lang={{{lang|}}}}}
|  data97 = {{{public_objectiu|}}}
| label98 = {{GetLabelFix|P1056|lang={{{lang|}}}}}
|  data98 = {{{productes|}}} 
| label100 = {{GetLabelFix|P2197|lang={{{lang|}}}}}
|  data100 = {{{produccio|}}}
| label102 = {{GetLabelFix|Q7406919|lang={{{lang|}}}}} 
|  data102 = {{{serveis|}}}
| label103 = {{GetLabelFix|Q1914636|lang={{{lang|}}}}}
|  data103 = {{{activitats|}}}

<!-- Federacions de futbol -->
| label104 = {{GetLabelFix|P463|lang={{{lang|}}}}}
|  data104 = {{{membrede|}}} 
| label105 = {{GetLabelFix|P3441|lang={{{lang|}}}}}
|  data105 = {{{codi_fifa|}}}

<!-- paràmetres activitat Museus - Biblios -->
| label106 = {{GetLabelFix|T0049|lang={{{lang|}}}}} 
|  data106 = {{{ambit|}}}
| label107 = {{GetLabelFix|P2046|lang={{{lang|}}}}} 
|  data107 =  {{{superficie|}}}
| label108 = {{GetLabelFix|T0050|lang={{{lang|}}}}} 
|  data108 = {{{coleccions|}}}
| label110 = {{GetLabelFix|T0051|lang={{{lang|}}}}} 
|  data110 = {{{tipus_documents|}}}
| label112 = {{GetLabelFix|P1436|lang={{{lang|}}}}}
|  data112 = {{{volum_coleccio|}}}
| label116 = {{GetLabelFix|P1174|lang={{{lang|}}}}}
|  data116 = {{{visitants|}}}
| label118 = {{GetLabelFix|Q3777645|lang={{{lang|}}}}}
|  data118 = {{{prestecs_anuals|}}}
| label120 = {{GetLabelFix|T0053|lang={{{lang|}}}}} 
|  data120 = {{{nom_habitants|}}}
| label122 = {{GetLabelFix|P6801|lang={{{lang|}}}}}
|  data122 = {{{llits|}}}
| label124 = {{GetLabelFix|P414|lang={{{lang|}}}}}
| data124  = {{{cotitzen_borsa|}}}
| label126 = {{GetLabelFix|P6427|lang={{{lang|}}}}}
| data126  = {{{nom_comercial|}}} 
| label128 = {{GetLabelFix|Q1799072|lang={{{lang|}}}}}
|  data128 = {{if empty|{{{metodes|}}} |{{{metode|}}} }}
| label130 = {{GetLabelFix|P2196|lang={{{lang|}}}}} 
|  data130 = {{{alumnes|}}}
| label131 = {{if empty|{{{etiqueta_membres|}}}|{{GetLabelFix|T0054|lang={{{lang|}}}}} }} 
|  data131 = {{{membres|}}}
| label132 = {{if empty|{{{etiqueta_membres2|}}}|Altres membres}}<!-- +++++ -->
|  data132 = {{{membres2|}}}
| label133 = {{if empty|{{{etiqueta_membres3|}}}|&nbsp;}}<!--si no hi ha etiq., força espais per alinear amb membres2 -->
|  data133 = {{{membres3|}}}
|  data135 = {{{membres_llista|}}} <!-- Alternatiu a membres, membres2, membres3 -->
| label137 = {{GetLabelFix|P6125|lang={{{lang|}}}}}
|  data137 = {{{voluntaris|}}}

<!-- paràmetres activitat grups de música -->
| label140 = {{GetLabelFix|P6125|lang={{{lang|}}}}}  
|  data140 = {{{membres_anteriors|}}}
| label142 = {{GetLabelFix|P264|lang={{{lang|}}}}}
|  data142 = {{{discografica|}}}
| label144 = {{GetLabelFix|Q55567783|lang={{{lang|}}}}} 
|  data144 = {{{artistes_relacionats|}}}
| label145  = {{GetLabelFix|Q735|lang={{{lang|}}}}} 
| data145   = {{{art|}}}
| label146 = {{GetLabelFix|P136|lang={{{lang|}}}}}Gènere artístic
|  data146 = {{{genere|}}}
| label147  = {{GetLabelFix|P135|lang={{{lang|}}}}}
| data147   = {{{moviment|}}}
| label148  = {{GetLabelFix|Q1292119|lang={{{lang|}}}}}
| data148   = {{{estil|}}}
| label149  = {{nowrap|{{GetLabelFix|P737|lang={{{lang|}}}}}}}
|  data149  = {{Llista desplegable condicional |{{{influencies_de|}}} |{{if empty|{{{desplega_influencia|}}}|180}}}}
| label150 = {{GetLabelFix|T0056|lang={{{lang|}}}}}
|  data150 = {{{instruments_destacats|}}}
| label151 = {{GetLabelFix|P800|lang={{{lang|}}}}} 
|  data151 = {{{obres_notables|}}}
| label152 = {{GetLabelFix|P3300|lang={{{lang|}}}}}
|  data152 = {{{director_musical|}}}
| label153 = {{GetLabelFix|P5024|lang={{{lang|}}}}}
|  data153 = {{{conductor_cor|}}}

<!--  Paràmetres comodí bloc "activitat" -->
|  data155 = {{{bloc_activitat_especial|}}}
| label157 = {{{etiqueta_activitat1|}}}
|  data157 = {{{nom_activitat1|}}}
| label158 = {{{etiqueta_activitat2|}}}
|  data158 = {{{nom_activitat2|}}}
| label159 = {{{etiqueta_activitat3|}}}
|  data159 = {{{nom_activitat3|}}}
| label160 = {{{etiqueta_activitat4|}}}
|  data160 = {{{nom_activitat4|}}}
| label161 = {{{etiqueta_activitat5|}}}
|  data161 = {{{nom_activitat5|}}}

<!--
*********************************************
* ORGANITZACIÓ I GOVERN (seus + equip + relacions organitzatives )
********************************************-->
|header163 = {{#if:{{{president|}}}{{{executiu_cap|}}}{{{secretari|}}}{{{nom_lider1|}}}{{{nom_lider2|}}}{{{nom_lider3|}}}{{{nom_lider4|}}}{{{consell_administracio|}}}{{{persona_clau|}}}{{{membres_destacats|}}}{{{organ_premsa|}}}{{{empleats|}}}{{{voluntaris|}}}{{{nom_seu1|}}} {{{localitzacio_seu1|}}} {{{municipi_seu1|}}} {{{estat_seu1|}}}{{{nom_seu2|}}} {{{localitzacio_seu2|}}} {{{municipi_seu2|}}} {{{estat_seu2|}}}{{{societat_matriu|}}}{{{nom_estats1|}}}{{{nom_estats2|}}}{{{nom_estats3|}}}{{{nom_estats4|}}}{{{propietari|}}}{{{aliats|}}}{{{rivals|}}}{{{divisions|}}}{{{sucursals|}}}{{{subsidiaries|}}}{{{afiliacions|}}} {{{bloc_partit_politic|}}} {{{bloc_govern_especial|}}}{{{nom_govern1|}}}{{{nom_govern2|}}}{{{nom_govern3|}}} {{{nom_govern4|}}}{{{nom_govern5|}}}{{{partit_juvenil|}}} {{{etiqueta_branca1|}}}{{{nom_branca1|}}}{{{etiqueta_branca2|}}}{{{nom_branca2|}}}{{{etiqueta_branca3|}}}{{{nom_branca3|}}} {{{entrenador|}}}{{{capita|}}} {{{cap_colla|}}}{{{nom_tecnic1|}}}{{{nom_tecnic2|}}}{{{nom_tecnic3|}}}{{{nom_tecnic4|}}}
              |{{if empty| {{{etiqueta_organitzacio|}}}
                         |{{GetLabelFix|T0066|lang={{{lang|}}}}}<!-- Organització i govern -->}} }}
<!-- Espai per la(es) seu(s) -->
<!-- Capçalera eliminada
|header130 = {{#if: {{{nom_seu1|}}}{{{localitzacio_seu1|}}} {{{municipi_seu1|}}} {{{estat_seu1|}}}{{{coordenades|}}}
                   {{{nom_seu2|}}} {{{localitzacio_seu2|}}} {{{municipi_seu2|}}} {{{estat_seu2|}}} |Ubicació seu}}
-->
| label165 = {{if empty|{{{etiqueta_seu1|}}} |{{GetLabelFix|Q7540126|lang={{{lang|}}}}} }}&nbsp;<!--
                       -->{{#if: {{{edificiitem|}}}{{{imatge_mapa_seu1|}}}|[[fitxer:Vista-down.png<!-- Go-down Gion.svg-->|20px|link=#edif]] }}
|  data165 = {{#if: {{{nom_seu1|}}}{{{localitzacio_seu1|}}} {{{municipi_seu1|}}} {{{estat_seu1|}}} 
              | {{Unbulleted list
                 | 36 = {{{nom_seu1|}}} 
                 | 37 = {{{localitzacio_seu1|}}}
                 | 38 = {{Entrades separades per comes
                   | 36 = {{{municipi_seu1|}}}
                   | 37 = {{{estat_seu1|}}}
                       }}
                | 39 = {{#if: {{both|{{{lat_dec_seu1|}}}| {{{lon_dec_seu1|}}} }}
                          | {{coord|{{{lat_dec_seu1|}}}|{{{lon_dec_seu1|}}}|display={{{coord_display_seu1|inline,title}}}
                          | {{{coordenades|}}}  
 }} }} 
                }}
             }}
| label168 = {{if empty|{{{etiqueta_seu2|}}} | {{nowrap|Altra seu}} }}
|  data168 = {{#if: {{{nom_seu2|}}} {{{localitzacio_seu2|}}} {{{municipi_seu2|}}} {{{estat_seu2|}}} 
              | {{Unbulleted list
                | 36 = {{{nom_seu2|}}}
                | 37 = {{{localitzacio_seu2|}}}
                | 38 = {{comma separated entries
                   | 36 = {{{municipi_seu2|}}} 
                   | 37 = {{{estat_seu2|}}} 
                       }}
             }} }}
]==========]

-- STEP 4: Save this module.

-- 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.

-- 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