Difference between revisions of "Gitem"

From Sega Retro

(added error management)
Line 1: Line 1:
<includeonly><div style="display:inline-block; vertical-align:top; margin-left:9px; margin-bottom:9px;"><div style="min-width:152px; min-height:152px; border:solid #C8CCD1 1px; display:block; text-align:center; padding:15px; font-size:0px;">{{#vardefine:gpages|{{expandpages|{{{page|}}}}}}}{{#vardefine:gpagecount|{{#expr:{{charcount|{{#var:gpages}}|,}}+1}}}}{{#vardefine:gwidth|{{#expr:({{d2w|{{{1}}}|120|120}}*{{#var:gpagecount}})+32}}}}{{#ifexpr:{{#var:gwidth}}<152|{{#vardefine:gwidth|152}}}}
+
<includeonly>{{clearvar|fileerror}}{{#ifeq:{{#mediawidth:{{{1|}}}}}|0|{{#vardefine:fileerror|1}}}}{{#iferror:{{#mediawidth:{{{1|}}}}}|{{#vardefine:fileerror|2}}|}}{{#if:{{{1|}}}||{{#vardefine:fileerror|3}}}}<div style="display:inline-block; vertical-align:top; margin-left:9px; margin-bottom:9px;"><div style="min-width:152px; min-height:152px; border:solid #C8CCD1 1px; display:block; text-align:center; padding:15px;">{{#vardefine:gwidth|152}}{{#switch:{{#var:fileerror}}
 +
|1=[[:File:{{{1|}}}|Thumbnail error.]]
 +
|2=[[:File:{{{1|}}}|File missing.]]
 +
|3=File not defined.
 +
|=
 +
{{#vardefine:gpages|{{expandpages|{{{page|}}}}}}}{{#vardefine:gpagecount|{{#expr:{{charcount|{{#var:gpages}}|,}}+1}}}}{{#vardefine:gwidth|{{#expr:({{d2w|{{{1}}}|120|120}}*{{#var:gpagecount}})+32}}}}{{#ifexpr:{{#var:gwidth}}<152|{{#vardefine:gwidth|152}}}}
 
<div style="position:relative; display:inline-block;">
 
<div style="position:relative; display:inline-block;">
 
{{#loop: p
 
{{#loop: p
Line 7: Line 12:
 
}}
 
}}
 
{{#ifeq:{{fileext|{{{1|}}}}}|pdf|<div style="color:#FFF; position:absolute; font-size:14px; background:red; width:32px; height:23px; bottom:0; right:0; pointer-events:none;">'''PDF'''</div>}}
 
{{#ifeq:{{fileext|{{{1|}}}}}|pdf|<div style="color:#FFF; position:absolute; font-size:14px; background:red; width:32px; height:23px; bottom:0; right:0; pointer-events:none;">'''PDF'''</div>}}
</div></div>{{#if: {{{2|}}} | <div style="width:{{#var:gwidth}}px; padding-left:2px; padding-top:5px; padding-right:2px;">{{{2}}}</div> }}</div>
+
</div>}}</div>{{#if: {{{2|}}} | <div style="width:{{#var:gwidth}}px; padding-left:2px; padding-top:5px; padding-right:2px;">{{{2}}}{{#var:fileerror}}</div> }}</div>
 
</includeonly><noinclude>
 
</includeonly><noinclude>
 
{{gitem|Sonic1 title.png|this is the title screen for sonic the hedgehog on mega drive}}
 
{{gitem|Sonic1 title.png|this is the title screen for sonic the hedgehog on mega drive}}
Line 14: Line 19:
 
{{gitem|Rush titlescreen.png|sonic rush title screen}}
 
{{gitem|Rush titlescreen.png|sonic rush title screen}}
 
{{gitem|}}
 
{{gitem|}}
 +
{{gitem|SMB3DS -SELLSHEET - ENGLISH.pdf|Sell sheet press release}}
 +
{{gitem|fakefilename.png}}
 
<gallery>
 
<gallery>
 
Sonic1 title.png|this is the title screen for sonic the hedgehog on mega drive
 
Sonic1 title.png|this is the title screen for sonic the hedgehog on mega drive

Revision as of 15:32, 14 August 2019

Sonic1 title.png

this is the title screen for sonic the hedgehog on mega drive
Expression error: Unexpected < operator.
<div style="width:Expression error: Unexpected < operator.px; padding-left:2px; padding-top:5px; padding-right:2px;">Two pages from a UK magazine
<div style="width:Expression error: Unexpected < operator.px; padding-left:2px; padding-top:5px; padding-right:2px;">Five pages from a UK magazine

Rush titlescreen.png

sonic rush title screen
File not defined.

SMB3DS -SELLSHEET - ENGLISH.pdf

PDF
Sell sheet press release