Difference between revisions of "OmniMedia"

From Sega Retro

 
(6 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
tables=relationships,releases
 
tables=relationships,releases
 
|fields=relationships.name,releases.date
 
|fields=relationships.name,releases.date
|where=relationships.relatedto="{{{1|}}}" and relationships.relationshiptype="book"
+
|where=relationships.relatedto="{{FormatSQL|{{{1|}}}}}" and relationships.relationshiptype="book"
 
|join on=relationships.name=releases.name
 
|join on=relationships.name=releases.name
 
|group by=releases.name
 
|group by=releases.name
Line 12: Line 12:
 
tables=relationships,releases
 
tables=relationships,releases
 
|fields=relationships.name,releases.date
 
|fields=relationships.name,releases.date
|where=relationships.relatedto="{{{1|}}}" and relationships.relationshiptype="music"
+
|where=relationships.relatedto="{{FormatSQL|{{{1|}}}}}" and relationships.relationshiptype="music"
 
|join on=relationships.name=releases.name
 
|join on=relationships.name=releases.name
 
|group by=releases.name
 
|group by=releases.name
Line 22: Line 22:
 
tables=relationships,releases
 
tables=relationships,releases
 
|fields=relationships.name,releases.date
 
|fields=relationships.name,releases.date
|where=relationships.relatedto="{{{1|}}}" and relationships.relationshiptype="audiobook"
+
|where=relationships.relatedto="{{FormatSQL|{{{1|}}}}}" and relationships.relationshiptype="audiobook"
 
|join on=relationships.name=releases.name
 
|join on=relationships.name=releases.name
 
|group by=releases.name
 
|group by=releases.name
Line 32: Line 32:
 
tables=relationships,releases
 
tables=relationships,releases
 
|fields=relationships.name,releases.date
 
|fields=relationships.name,releases.date
|where=relationships.relatedto="{{{1|}}}" and relationships.relationshiptype="video"
+
|where=relationships.relatedto="{{FormatSQL|{{{1|}}}}}" and relationships.relationshiptype="video"
 
|join on=relationships.name=releases.name
 
|join on=relationships.name=releases.name
 
|group by=releases.name
 
|group by=releases.name
Line 39: Line 39:
 
|template=OmniMedia/Cargo
 
|template=OmniMedia/Cargo
 
|default=
 
|default=
}}}}{{#vardefine:prereleaseresult|{{#cargo_query:
+
}}}}{{#vardefine:eventresult|{{#cargo_query:
tables=relationships,releases
+
tables=relationships,events
|fields=relationships.name,releases.date
+
|fields=relationships.name=eventname,events.startdate
|where=relationships.relatedto="{{{1|}}}" and relationships.relationshiptype="prerelease"
+
|where=relationships.relatedto="{{FormatSQL|{{{1|}}}}}" and relationships.relationshiptype="event"
|join on=relationships.name=releases.name
+
|join on=relationships.name=events.name
|group by=releases.name
+
|group by=events.name
|order by=releases.date
+
|order by=events.startdate
 
|format=template
 
|format=template
 
|template=OmniMedia/Cargo
 
|template=OmniMedia/Cargo
 
|default=
 
|default=
 
}}}}
 
}}}}
{{#if:{{#var:bookresult}}|'''Books:''' {{#sub:{{#var:bookresult}}|0|-2}}<br/>|}}
+
{{#if:{{#var:bookresult}}|'''Books:''' {{#sub:{{UnformatSQL|{{#var:bookresult}}}}|0|-2}}<br/>|}}{{
{{#if:{{#var:musicresult}}|'''Music:''' {{#sub:{{#var:musicresult}}|0|-2}}<br/>|}}
+
#if:{{#var:musicresult}}|'''Music:''' {{#sub:{{UnformatSQL|{{#var:musicresult}}}}|0|-2}}<br/>|}}{{
{{#if:{{#var:audiobookresult}}|'''Audiobooks:''' {{#sub:{{#var:audiobookresult}}|0|-2}}<br/>|}}
+
#if:{{#var:audiobookresult}}|'''Audiobooks:''' {{#sub:{{UnformatSQL|{{#var:audiobookresult}}}}|0|-2}}<br/>|}}{{
{{#if:{{#var:videoresult}}|'''Videos:''' {{#sub:{{#var:videoresult}}|0|-2}}<br/>|}}
+
#if:{{#var:videoresult}}|'''Videos:''' {{#sub:{{UnformatSQL|{{#var:videoresult}}}}|0|-2}}<br/>|}}{{
{{#if:{{#var:prereleaseresult}}|'''Prereleases:''' {{#sub:{{#var:prereleaseresult}}|0|-2}}<br/>|}}
+
#if:{{#var:eventresult}}|'''Events:''' {{#sub:{{UnformatSQL|{{#var:eventresult}}}}|0|-2}}<br/>|}}{{clearvar|bookresult|musicresult|audiobookresult|videoresult|prereleaseresult|eventresult}}</includeonly><noinclude>[[Category:Templates]]
{{clearvar|bookresult|musicresult|audiobookresult|videoresult|prereleaseresult}}</includeonly><noinclude>[[Category:Sega Retro templates]]
 
 
Template that generates relevant media for Omni tables, so you don't have to.
 
Template that generates relevant media for Omni tables, so you don't have to.
  

Latest revision as of 10:15, 22 February 2023