Template:Infobox VG: Difference between revisions

Bit more cleanup/simplification
(Further trim excess regex use,)
(Bit more cleanup/simplification)
Line 18: Line 18:
<!--Regional List-->{{#regex:{{{publisher|}}}|/({{#regex:{{{publisher|}}}|/.*?(?:NA{{!}}JP{{!}}EU{{!}}AUS{{!}}KO{{!}}RUS{{!}}SA{{!}}CA).*?>.*?>\s*([^\[{{!}}<]*).*?>/rs|$1{{!}}}}#NOMATCH#)/rs|[[:Category:Published by $1|$1]][[Category:Published by $1]]}}}}
<!--Regional List-->{{#regex:{{{publisher|}}}|/({{#regex:{{{publisher|}}}|/.*?(?:NA{{!}}JP{{!}}EU{{!}}AUS{{!}}KO{{!}}RUS{{!}}SA{{!}}CA).*?>.*?>\s*([^\[{{!}}<]*).*?>/rs|$1{{!}}}}#NOMATCH#)/rs|[[:Category:Published by $1|$1]][[Category:Published by $1]]}}}}
}}
}}
|{{#if:{{{series|}}}|{{!}} '''[[:Category:Series|Series]]''' {{!!}}{{#regex: {{#regex: {{{series|}}}|/''/|}}|/([^,]+)(,? ?)/rs|[[:Category:$1 series|$1]][[Category:$1 series]]$2}}}}
|{{#if:{{{series|}}}|{{!}} '''[[:Category:Series|Series]]''' {{!!}}{{#regex: {{#regex: {{{series|}}}|/''/|}}|/([^,]+)(,? ?)/rs|[[:Category:$1 series|$1]][[Category:$1 series]]$2}}{{#if:{{#regex: {{{series|}}}|/(''[^,]*?''(, {{!}}$))*/rs|}}|[[Category:Game pages with misformatted series]]}}}}
|{{#if:{{{platform|{{{platforms|}}}}}}| {{!}} '''[[:Category:Platforms|Platform(s)]]''' {{!!}} {{{platform|{{{platforms|}}}}}}}}
|{{#if:{{{platform|{{{platforms|}}}}}}| {{!}} '''[[:Category:Platforms|Platform(s)]]''' {{!!}} {{{platform|{{{platforms|}}}}}}}}
|{{#if:{{{released|{{{release|}}}}}}| {{!}} {{nowrap|'''[[:Category:Initial release year|Release date(s)]]'''}} {{!!}} {{{released|{{{release}}}}}} {{#regex: {{{released|}}}|/.*?(\d\d\d\d).*/rs|[[Category:Initial release $1]]|1}}|[[Category:Game pages without release date(s)]]}}
|{{#if:{{{released|{{{release|}}}}}}| {{!}} {{nowrap|'''[[:Category:Initial release year|Release date(s)]]'''}} {{!!}} {{{released|{{{release}}}}}} {{#regex: {{{released|}}}|/.*?(\d\d\d\d).*/rs|[[Category:Initial release $1]]|1}}|[[Category:Game pages without release date(s)]]}}
|{{#if:{{{genre|}}}|{{!}}'''[[:Category:Genres|Genre(s)]]'''{{!!}}{{#regex: {{#regex: {{{genre|}}}|/''/|}}|/([^,]+)(,? ?)/rs|[[:Category:$1 games|$1]][[Category:$1 games]]$2}}|[[Category:Game pages without genre]]}}
|{{#if:{{{genre|}}}|{{!}}'''[[:Category:Genres|Genre(s)]]'''{{!!}}{{#regex: {{#regex: {{{genre|}}}|/''/|}}|/([^,]+)(,? ?)/rs|[[:Category:$1 games|$1]][[Category:$1 games]]$2}}|[[Category:Game pages without genre]]}}
|{{#if:{{{mode|{{{modes|}}}}}}|{{!}}'''[[:Category:Game modes|Mode(s)]]'''{{!!}}{{#regex:{{#regex: {{{modes|}}}|/(Single-player{{!}}Multi(-)?player{{!}}Co-op{{!}}Online)/rsi|[[:Category:$1 games|$1]][[Category:$1 games]]$2}}|/\((\d{1,2}{{!}}\*)\)/|([[:Category: $1 Players Supported|$1]][[Category: $1 Players Supported]])}}{{#ifeq:{{{modes|}}}|Single-player|[[Category:Single-player only games]]|}}|{{#if:{{#regex:{{{genre|}}}|/Utility/}}||[[Category:Game pages without modes of play]]}}}}
|{{#if:{{{mode|{{{modes|}}}}}}|{{!}}'''[[:Category:Game modes|Mode(s)]]'''{{!!}}{{#regex:{{#regex: {{{modes|}}}|/(Single-player{{!}}Multi(-)?player{{!}}Co-op{{!}}Online)/rsi|[[:Category:$1 games|$1]][[Category:$1 games]]$2}}|/\((\d{1,2}{{!}}\*)\)/|([[:Category: $1 Players Supported|$1]][[Category: $1 Players Supported]])}}{{#ifeq:{{{modes|}}}|Single-player|[[Category:Single-player only games]]|}}|{{#if:{{#regex:{{{genre|}}}|/Utility/}}||[[Category:Game pages without modes of play]]}}}}
|{{#if:{{{input|}}}|{{!}}'''[[:Category:Input supported|Input methods]]'''{{!!}}{{#regex: {{{input|}}}|/(Wii Remote{{!}}Nunchu(c)?k{{!}}Dance Pad{{!}}Wii Balance Board{{!}}USB Keyboard{{!}}Skylander Portal{{!}}Active Heart Rate Monitor{{!}}Cyberbike{{!}}Your Shape Camera{{!}}Nintendo DS{{!}}Game( )?Boy Advance{{!}}uDraw GameTablet{{!}}Wii MotionPlus{{!}}DK Bongos{{!}}(GameCube{{!}}Classic{{!}}Shinkansen{{!}}Drum{{!}}Guitar{{!}}Keyboard{{!}}Turntable{{!}}Ride{{!}}Arcade) Controller{{!}}Microphone)/rsi|[[:Category:$1 input supported|$1]][[Category:$1 input supported]]$2}}|[[Category:Game pages without possible inputs]]}}
|{{#if:{{{input|}}}|{{!}}'''[[:Category:Input supported|Input methods]]'''{{!!}}{{#regex: {{{input|}}}|/(Wii Remote{{!}}Nunchu(c)?k{{!}}Dance Pad{{!}}Wii Balance Board{{!}}USB Keyboard{{!}}Skylander Portal{{!}}Active Heart Rate Monitor{{!}}Cyberbike{{!}}Your Shape Camera{{!}}Nintendo DS{{!}}Game( )?Boy Advance{{!}}uDraw GameTablet{{!}}Wii MotionPlus{{!}}DK Bongos{{!}}(GameCube{{!}}Classic{{!}}Shinkansen{{!}}Drum{{!}}Guitar{{!}}Keyboard{{!}}Turntable{{!}}Ride{{!}}Arcade) Controller{{!}}Microphone)/rsi|[[:Category:$1 input supported|$1]][[Category:$1 input supported]]$2}}{{#if:{{#regex: {{{modes|}}}|/((Single-player{{!}}(Multiplayer{{!}}Co-op{{!}}Online) \((\d{1,2}{{!!}}\*)\))(, {{!}}$))*/rs}}|[[Category:Pages with misformatted modes of play]]}}{{#if:{{#regex: {{{input|}}}|/(((Wii Remote( \+ Nunchuk)?{{!}}Wii MotionPlus( \+ Nunchuk)?){{!}}Nunchuk{{!}}Nintendo DS{{!}}Active Heart Rate Monitor{{!}}Cyberbike{{!}}Your Shape Camera{{!}}USB Keyboard{{!}}Skylander Portal{{!}}Game Boy Advance{{!}}Game Boy Advance{{!}}Dance Pad{{!}}DK Bongos{{!}}Microphone{{!}}uDraw GameTablet{{!}}Wii Balance Board{{!}}(Classic{{!}}GameCube{{!}}Drum{{!}}Guitar{{!}}Keyboard{{!}}Shinkansen{{!}}Turntable{{!}}Ride{{!}}Arcade) Controller)(, {{!}}$))*/rs}}|[[Category:Pages with misformatted inputs]]}}|[[Category:Game pages without possible inputs]]}}
|{{!}} '''[[Template:Compatibility|Compatibility]]''' {{!!}} {{ratings|{{#if:{{{nonerror|}}}|nonerror=true{{!}}|}}{{PAGENAME}}}}{{#regex:{{ratings|{{#if:{{{nonerror|}}}|nonerror=true{{!}}|}}{{PAGENAME}}}}|/.*?Stars(\d)\.png.*/|[[Category:Games with $1 star rating]]}}|{{!}} '''See also...''' {{!!}}
|{{!}} '''[[Template:Compatibility|Compatibility]]''' {{!!}} {{ratings|{{#if:{{{nonerror|}}}|nonerror=true{{!}}|}}{{PAGENAME}}}}{{#regex:{{ratings|{{#if:{{{nonerror|}}}|nonerror=true{{!}}|}}{{PAGENAME}}}}|/.*?Stars(\d)\.png.*/|[[Category:Games with $1 star rating]]}}|{{!}} '''See also...''' {{!!}}
{{#if:{{#regex:{{PAGENAME}}|/.*(\)).*/|}}||{{#ifexist:{{#regex:{{PAGENAME}}|/(.+)\((?!Arcade).+\)/|$1}} (Arcade)|[[{{#regex:{{PAGENAME}}|/(.+)\(.+\)/|$1}} (Arcade)|Arcade Version]]<br />
{{#if:{{#regex:{{PAGENAME}}|/.*(\)).*/|}}||{{#ifexist:{{#regex:{{PAGENAME}}|/(.+)\((?!Arcade).+\)/|$1}} (Arcade)|[[{{#regex:{{PAGENAME}}|/(.+)\(.+\)/|$1}} (Arcade)|Arcade Version]]<br />
Line 39: Line 39:
{{#if:{{{forumlink|}}}|[{{{forumlink|}}} Dolphin Forum thread]|[[google:{{#regex:{{PAGENAME}}|/\s/|+}}+site:forums.dolphin-emu.org|Search Dolphin Forums]]<br />|[[Category:Game pages without Dolphin forum link]]}}
{{#if:{{{forumlink|}}}|[{{{forumlink|}}} Dolphin Forum thread]|[[google:{{#regex:{{PAGENAME}}|/\s/|+}}+site:forums.dolphin-emu.org|Search Dolphin Forums]]<br />|[[Category:Game pages without Dolphin forum link]]}}
[[google:{{#regex:{{PAGENAME}}|/\s/|+}}|Search Google]]<br />
[[google:{{#regex:{{PAGENAME}}|/\s/|+}}|Search Google]]<br />
{{#if:{{{wikipedia|}}}|[[wikipedia:{{{wikipedia|}}}|Wikipedia page]]|[[wikipedia:{{PAGENAME}}|Search Wikipedia]]}}}}|}<!--Data Quality Categories-->{{#if:{{{compatibility|}}}|[[Category:Pages with an un-needed compatibility param in InfoBox]]|}}{{#if:{{{series|}}}|{{#if:{{#regex: {{{series|}}}|/(''[^,]*?''(, {{!}}$))*/rs|}}|[[Category:Game pages with misformatted series]]}}}}{{#ifeq:{{#regex:{{{input|}}}|/(((Wii Remote( \+ Nunchuk)?{{!}}Wii MotionPlus( \+ Nunchuk)?){{!}}Nunchuk{{!}}Nintendo DS{{!}}Active Heart Rate Monitor{{!}}Cyberbike{{!}}Your Shape Camera{{!}}USB Keyboard{{!}}Skylander Portal{{!}}Game Boy Advance{{!}}Game Boy Advance{{!}}Dance Pad{{!}}DK Bongos{{!}}Microphone{{!}}uDraw GameTablet{{!}}Wii Balance Board{{!}}(Classic{{!}}GameCube{{!}}Drum{{!}}Guitar{{!}}Keyboard{{!}}Shinkansen{{!}}Turntable{{!}}Ride{{!}}Arcade) Controller)(, {{!}}$))*/rs}}|{{{input|}}}||[[Category:Pages with misformatted inputs]]|}}{{#ifeq:{{#regex:{{{modes|}}}|/((Single-player{{!}}(Multiplayer{{!}}Co-op{{!}}Online) \((\d{1,2}{{!!}}\*)\))(, {{!}}$))*/rs}}|{{{modes|}}}||[[Category:Pages with misformatted modes of play]]|}}</includeonly><noinclude>
{{#if:{{{wikipedia|}}}|[[wikipedia:{{{wikipedia|}}}|Wikipedia page]]|[[wikipedia:{{PAGENAME}}|Search Wikipedia]]}}}}|}<!--Data Quality Categories-->{{#if:{{{compatibility|}}}|[[Category:Pages with an un-needed compatibility param in InfoBox]]|}}
</includeonly><noinclude>
{{documentation}}
{{documentation}}
</noinclude>
</noinclude>