Difference between revisions of "Ratings"

From Sega Retro

 
(503 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{|cellpadding="0" cellspacing="0" class="breakout" style="max-width: 340px; padding: 0px; float: right; margin-left: 15px; display: inline; position: relative"
+
<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;"
 +
!style="height:39px;" |Sega Retro Average&nbsp;
 
|-
 
|-
! '''Reception'''
+
| style="padding: 0px;"|
 +
{| class="breakout" width="100%" style="margin: 0px; border:0px;"
 +
!class="sortable"|Publication
 +
!class="sortable"|Score
 +
!Source
 
|-
 
|-
|style="padding: 0.3em; line-height: 1.5em; padding-left: 5px;" |
+
{{#vardefine:argpubname|null}}{{#vardefine:argpubscore|null}}{{#vardefine:argpubsource|}}{{#vardefine: newrow|false}}{{#vardefine: lastargtype|null}}{{#vardefine:thisIsARating|true}}
{{ #if: {{{cvg|}}} | Computer & Video Games:    {{{cvg}}}<br> | }}{{
+
{{#forargs:
#if: {{{dcuk|}}} | [[DC-UK]]:     {{{dcuk}}}<br> | }}{{
+
| key
#if: {{{dmuk|}}} | [[Dreamcast Magazine (UK)]]:     {{{dmuk}}}<br> | }}{{
+
| value
#if: {{{edge|}}} | EDGE:    {{{edge}}}<br> | }}{{
+
|
#if: {{{mdag|}}} | [[Mega Drive Advanced Gaming]]:     {{{mdag}}}<br> | }}{{
+
<span style="display:none;">
#if: {{{mega|}}} | [[Mega]]:    {{{mega}}}<br> | }}{{
+
{{#vardefine: key|{{#replace:{{#var:key}}|_1|}}}}
#if: {{{mm|}}} | '''Mean Machines''':     {{{mm}}}<br> | }}{{
+
{{#vardefine: key|{{#replace:{{#var:key}}|_2|}}}}
#if: {{{mms|}}} | '''[[Mean Machines Sega]]''':    {{{mms}}}<br> | }}{{
+
{{#vardefine: key|{{#replace:{{#var:key}}|_3|}}}}
#if: {{{mrdc|}}} | '''[[Mr. Dreamcast]]''':    {{{mrdc}}}<br> | }}{{
+
{{#vardefine: key|{{#replace:{{#var:key}}|_4|}}}}
#if: {{{mt|}}} | '''[[MegaTech]]''':    {{{mt}}}<br> | }}{{
+
 
#if: {{{odmuk|}}} | '''[[Official Dreamcast Magazine (UK)]]''':    {{{odmuk}}}<br> | }}{{
+
<!-- Determine which argument we're dealing with (icon, pubname, pubscore etc.) -->
#if: {{{odmus|}}} | '''[[Official Dreamcast Magazine (US)]]''':     {{{odmus}}}<br> | }}{{
+
{{#vardefine:argtype|score}}
#if: {{{s|}}} | '''[[S: The Sega Magazine]]''':     {{{s}}}<br> | }}{{
+
{{#ifeq: {{#var: key}}|icon|{{#vardefine:argtype|icon}}|
#if: {{{saturnplus|}}} | '''[[Saturn+]]''':     {{{saturnplus}}}<br> | }}{{
+
{{#ifexpr: {{#len: {{#var: key}}}} > 7 |
#if: {{{saturnpower|}}} | '''[[Saturn Power]]''':     {{{saturnpower}}}<br> | }}{{
+
{{#ifeq: {{#sub:{{#var: key}}|-7}}|_source|{{#vardefine:argtype|source}}|}}
#if: {{{segamagjp|}}} | '''[[Sega Magazine (JP)]]''':    {{{segamagjp}}}<br> | }}{{
+
|}}
#if: {{{segamaguk|}}} | '''[[Sega Magazine (UK)]]''':    {{{segamaguk}}}<br> | }}{{
+
}}
#if: {{{segapower|}}} | '''[[Sega Power]]''':     {{{segapower}}}<br> | }}{{
+
 
#if: {{{smf|}}} | '''[[Sega Master Force]]''':    {{{smf}}}<br> | }}{{
+
<!-- -->
#if: {{{smz|}}} | '''[[Sega MegaZone]]''':    {{{smz}}}<br> | }}{{
+
{{#ifeq: {{#var: argtype}}|score|{{#ifeq: {{#var: lastargtype}}|score|
#if: {{{ssm|}}} | '''[[Sega Saturn Magazine]]''':     {{{ssm}}}<br> | }}{{
+
{{#vardefine:magnamelong|{{MagazineName|{{#var: argpubname}}|noissuename=yes|nopubdate=yes}}}}
#if: {{{sv|}}} | '''[[Sega Visions]]''':    {{{sv}}}<br> | }}{{
+
{{RatingsRowSum|{{#var: magnamelong}}|{{#var: argpubscore}}|{{#var: argpubsource}}}}[[Category:Rating without source]]
#if: {{{ts|}}} | '''[[Total Saturn]]''':    {{{ts}}}<br> | }}
+
|}}|}}  
|}<noinclude>
+
 
 +
{{#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}}|source|{{#vardefine:argpubsource|{{#var: value}}}}
 +
{{#vardefine: newrow|true}}{{#if:{{#pos:{{#var: argpubsource}}|http|}}|[[Category:External rating reference]]|}}
 +
|}}
 +
{{#vardefine: lastargtype|{{#var: argtype}}}}
 +
</span>
 +
{{#ifeq: {{#var: newrow}}|true|
 +
{{#ifeq: {{#var: argpubname}}|null||
 +
{{#ifeq: {{#var: argpubscore}}|null||
 +
 
 +
{{#vardefine:magnamelong|{{MagazineName|{{#var: argpubname}}|noissuename=yes|nopubdate=yes}}}}
 +
{{RatingsRowSum|{{#var: magnamelong}}|{{#var: argpubscore}}|{{#var: argpubsource}}}}
 +
{{#vardefine:argpubname|null}}{{#vardefine:argpubscore|null}}{{#vardefine:argpubsource|}}{{#vardefine: newrow|false}}
 +
|}}
 +
}}
 +
}}
 +
}}
 +
 
 +
<!-- Calculate average -->
 +
{{#vardefine: average|
 +
{{#expr: {{#var: cumulativeScore}} / {{#var: totalReviews}} round 0
 +
}}
 +
}}
 +
|}
 +
|}
 +
{|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;" style="font-size:16pt; {{scoreColour|{{#var: average}}}}"|{{#var: average}}
 +
|-
 +
|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>
 
==Usage==
 
==Usage==
This template is to be used on articles about video games and will display scores awarded to said games by video game magazines/websites.
+
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.
 
 
At the time of writing this is missing loads of magazines/websites.
 
  
 
Usage:
 
Usage:
 
<pre>
 
<pre>
{{Ratings
+
{{Ratings|<SYSTEM>}}
| cvg=
 
| dcuk=
 
| dmuk=
 
| edge=
 
| mdag=
 
| mega=
 
| mm=
 
| mms=
 
| mrdc=
 
| mt=
 
| odmuk=
 
| odmus=
 
| s=
 
| saturnplus=
 
| saturnpower=
 
| segamagjp=
 
| segamaguk=
 
| segapower=
 
| smf=
 
| smz=
 
| ssm=
 
| sv=
 
| ts=
 
}}
 
 
</pre>
 
</pre>
  
All fields are optional.
+
[[Category:Breakout box templates]]</noinclude>
 
 
 
 
[[Category:Breakout Box Templates|Ratings]]</noinclude>
 

Latest revision as of 14:31, 24 May 2022

Sega Retro Average 
Publication Score Source
{{{{{icon}}}|L}} Division by zero.
Based on
0 review
Sega Retro Average 
Publication Version Score
{{|L}} N/A
Based on
0 reviews

Ratings

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