Difference between revisions of "Ratings"
From Sega Retro
(46 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | < | + | <div style="display:none;">{{#vardefine:totalReviews|0}}{{#vardefine:cumulativeScore|0}} |
{|cellpadding="0" cellspacing="0" class="breakout mw-collapsible mw-collapsed" style="width:auto !important; max-width: 320px; float: right; margin-left: 0px; display: inline; position: relative;" | {|cellpadding="0" cellspacing="0" class="breakout mw-collapsible mw-collapsed" style="width:auto !important; max-width: 320px; float: right; margin-left: 0px; display: inline; position: relative;" | ||
!style="height:39px;" |Sega Retro Average | !style="height:39px;" |Sega Retro Average | ||
Line 8: | Line 8: | ||
!class="sortable"|Score | !class="sortable"|Score | ||
!Source | !Source | ||
− | |||
|- | |- | ||
{{#vardefine:argpubname|null}}{{#vardefine:argpubscore|null}}{{#vardefine:argpubsource|}}{{#vardefine: newrow|false}}{{#vardefine: lastargtype|null}}{{#vardefine:thisIsARating|true}} | {{#vardefine:argpubname|null}}{{#vardefine:argpubscore|null}}{{#vardefine:argpubsource|}}{{#vardefine: newrow|false}}{{#vardefine: lastargtype|null}}{{#vardefine:thisIsARating|true}} | ||
Line 21: | Line 20: | ||
{{#vardefine: key|{{#replace:{{#var:key}}|_4|}}}} | {{#vardefine: key|{{#replace:{{#var:key}}|_4|}}}} | ||
+ | <!-- Determine which argument we're dealing with (icon, pubname, pubscore etc.) --> | ||
{{#vardefine:argtype|score}} | {{#vardefine:argtype|score}} | ||
{{#ifeq: {{#var: key}}|icon|{{#vardefine:argtype|icon}}| | {{#ifeq: {{#var: key}}|icon|{{#vardefine:argtype|icon}}| | ||
Line 30: | Line 30: | ||
<!-- --> | <!-- --> | ||
{{#ifeq: {{#var: argtype}}|score|{{#ifeq: {{#var: lastargtype}}|score| | {{#ifeq: {{#var: argtype}}|score|{{#ifeq: {{#var: lastargtype}}|score| | ||
− | {{#vardefine:magnamelong|{{MagazineName|{{#var: argpubname}} | + | {{#vardefine:magnamelong|{{MagazineName|{{#var: argpubname}}|noissuename=yes|nopubdate=yes}}}} |
{{RatingsRowSum|{{#var: magnamelong}}|{{#var: argpubscore}}|{{#var: argpubsource}}}}[[Category:Rating without source]] | {{RatingsRowSum|{{#var: magnamelong}}|{{#var: argpubscore}}|{{#var: argpubsource}}}}[[Category:Rating without source]] | ||
− | |}}|}} | + | |}}|}} |
− | + | {{#ifeq: {{#var: argtype}}|score|{{#vardefine:argpubname|{{#var: key}}}}{{#vardefine:argpubscore|{{#var: value}}}}{{#ifeq:{{#var:key}}|1||[[Category:Old-style rating ({{#var:argpubname}})]]}}|}} | |
− | {{#ifeq: {{#var: argtype}}|score|{{#vardefine:argpubname|{{#var: key}}}}{{#vardefine:argpubscore|{{#var: value}}}}|}} | ||
{{#ifeq: {{#var: argtype}}|source|{{#vardefine:argpubsource|{{#var: value}}}} | {{#ifeq: {{#var: argtype}}|source|{{#vardefine:argpubsource|{{#var: value}}}} | ||
− | {{#vardefine: newrow|true}} | + | {{#vardefine: newrow|true}}{{#if:{{#pos:{{#var: argpubsource}}|http|}}|[[Category:External rating reference]]|}} |
|}} | |}} | ||
{{#vardefine: lastargtype|{{#var: argtype}}}} | {{#vardefine: lastargtype|{{#var: argtype}}}} | ||
Line 44: | Line 43: | ||
{{#ifeq: {{#var: argpubname}}|null|| | {{#ifeq: {{#var: argpubname}}|null|| | ||
{{#ifeq: {{#var: argpubscore}}|null|| | {{#ifeq: {{#var: argpubscore}}|null|| | ||
− | + | ||
− | {{#vardefine:magnamelong|{{MagazineName|{{#var: argpubname}} | + | {{#vardefine:magnamelong|{{MagazineName|{{#var: argpubname}}|noissuename=yes|nopubdate=yes}}}} |
{{RatingsRowSum|{{#var: magnamelong}}|{{#var: argpubscore}}|{{#var: argpubsource}}}} | {{RatingsRowSum|{{#var: magnamelong}}|{{#var: argpubscore}}|{{#var: argpubsource}}}} | ||
{{#vardefine:argpubname|null}}{{#vardefine:argpubscore|null}}{{#vardefine:argpubsource|}}{{#vardefine: newrow|false}} | {{#vardefine:argpubname|null}}{{#vardefine:argpubscore|null}}{{#vardefine:argpubsource|}}{{#vardefine: newrow|false}} | ||
Line 52: | Line 51: | ||
}} | }} | ||
}} | }} | ||
− | |||
<!-- Calculate average --> | <!-- Calculate average --> | ||
Line 60: | Line 58: | ||
}} | }} | ||
|} | |} | ||
− | |} | + | |} |
{|cellpadding="0" cellspacing="0" class="breakout" style="width:auto !important; float: right; margin-left: 15px; display: inline; position: relative;" | {|cellpadding="0" cellspacing="0" class="breakout" style="width:auto !important; float: right; margin-left: 15px; display: inline; position: relative;" | ||
− | ! style="max-width:40px; height:40px"| {{{{{icon}}}|L | + | ! style="max-width:40px; height:40px"| {{{{{icon}}}|L}} |
! style="max-width:40px;" style="font-size:16pt; {{scoreColour|{{#var: average}}}}"|{{#var: average}} | ! style="max-width:40px;" style="font-size:16pt; {{scoreColour|{{#var: average}}}}"|{{#var: average}} | ||
|- | |- | ||
− | |colspan="2" style="padding:2px; text-align:center; line-height:initial" | <small>Based on<br>'''{{#var: totalReviews}}''' review{{#ifexpr: {{#var: totalReviews}} > 1|s| }}</small> | + | |colspan="2" style="padding:2px; text-align:center; line-height:initial" | <small>{{#vardefine:totalText|Based on<br>'''{{#var: totalReviews}}''' review{{#ifexpr: {{#var: totalReviews}} > 1|s| }}}}{{#var:totalText}}</small> |
|} | |} | ||
− | + | {{#vardefine:thisIsARating|false}}{{#if:{{{icon|}}}|[[Category:Update ratings template]][[Category:{{#var: totalReviews}} old ratings]]}}</div>{{Ratings2|{{{icon|}}}{{{1|}}}|{{{2|{{FormatSQL|{{#titleparts:{{PAGENAME}}}}}}}}}}}<noinclude> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | </div>{{# | ||
==Usage== | ==Usage== | ||
− | This template is | + | Template showing ratings given to a video game by the press. This template is fully automated, with data coming from [[:Category:Magazine articles]] and [[:Category:Video coverage]]. The game in question is inferred by the the page name. |
Usage: | Usage: | ||
<pre> | <pre> | ||
− | {{Ratings | + | {{Ratings|<SYSTEM>}} |
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | < | ||
− | |||
− | |||
</pre> | </pre> | ||
− | |||
[[Category:Breakout box templates]]</noinclude> | [[Category:Breakout box templates]]</noinclude> |
Latest revision as of 13:31, 24 May 2022
Sega Retro Average | ||||
---|---|---|---|---|
|
{{|L}} | N/A |
---|---|
Based on 0 reviews |
Usage
Template showing ratings given to a video game by the press. This template is fully automated, with data coming from Category:Magazine articles and Category:Video coverage. The game in question is inferred by the the page name.
Usage:
{{Ratings|<SYSTEM>}}