Difference between revisions of "Ratings"

From Sega Retro

 
(28 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#vardefine:totalReviews|0}}{{#vardefine:cumulativeScore|0}}
+
<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&nbsp;
 
!style="height:39px;" |Sega Retro Average&nbsp;
Line 34: Line 34:
 
|}}|}}  
 
|}}|}}  
  
{{#ifeq: {{#var: argtype}}|score|{{#vardefine:argpubname|{{#var: key}}}}{{#vardefine:argpubscore|{{#if:{{#var:starscore}}|{{#var:starscore}}|{{#var: value}}}}}}{{#vadefine:starscore|}}|}}
+
{{#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}}}}
 
{{#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 60: Line 60:
 
|}
 
|}
 
{|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}}{{#if: {{{icon|}}} |  | [[Category:Old Ratings Template]]}}
+
! 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>{{#vardefine:totalText|Based on<br>'''{{#var: totalReviews}}''' review{{#ifexpr: {{#var: totalReviews}} > 1|s| }}}}{{#var:totalText}}</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>
 
|}
 
|}
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
+
{{#vardefine:thisIsARating|false}}{{#if:{{{icon|}}}|[[Category:Update ratings template]][[Category:{{#var: totalReviews}} old ratings]]}}</div>{{Ratings2|{{{icon|}}}{{{1|}}}|{{{2|{{FormatSQL|{{#titleparts:{{PAGENAME}}}}}}}}}}}<noinclude>
<meta itemprop="itemReviewed" content="{{PAGENAME}}">
 
<meta itemprop="additionalType" content="http://schema.org/VideoGame">
 
<meta itemprop="ratingValue" content="{{#var: average}}">
 
<meta itemprop="ratingCount" content="{{#var: totalReviews}}">
 
<meta itemprop="bestRating" content="100">
 
<meta itemprop="worstRating" content="0">
 
</div>{{#vardefine:thisIsARating|false}}<includeonly>{{#cargo_store:
 
_table = ratings_table
 
|name = {{#titleparts:{{PAGENAME}}}}
 
|console={{{icon}}}
 
|average = {{#var: average}}
 
|totalReviews = {{#var: totalReviews}}
 
}}</includeonly><noinclude>{{#cargo_declare:
 
_table = ratings_table
 
|name=Page
 
|console=Text
 
|average=Integer
 
|totalReviews=Integer
 
}}
 
 
==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.
  
 
Usage:
 
Usage:
 
<pre>
 
<pre>
{{Ratings
+
{{Ratings|<SYSTEM>}}
| icon=
 
| publication=
 
}}
 
</pre>
 
 
 
Substitute "publication" with a [[Sega Retro:Publication codes|publication code]] to get the desired result.
 
 
 
for sources, add "_source", e.g.
 
<pre>
 
| smf_source=[http://www.google.com]
 
| vgce_source={{num|32|page=10/11}}
 
 
</pre>
 
</pre>
All fields are optional.
 
  
 
[[Category:Breakout box templates]]</noinclude>
 
[[Category:Breakout box templates]]</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>}}