[go: up one dir, main page]

Menu

[838434]: / ss.php  Maximize  Restore  History

Download this file

134 lines (105 with data), 4.1 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php
// Our list of screenshots
$screenshots = array(
'2012-03-08' => array(
'caption' => 'Few weapons',
'shots' => array(
'ss16.png' => 'Burning trees',
'ss17.png' => 'More effective way of burning trees',
'ss18.png' => 'He won\'t shoot anymore',
),
),
'2011-06-27' => array(
'caption' => 'Things that were done, but not shown',
'shots' => array(
'ss10.png' => 'Configure Menu',
'ss11.png' => 'Load - Save Menu',
'ss12.png' => 'Brief Menu',
'ss13.png' => 'Research Menu',
'ss14.png' => 'Map Menu',
'ss15.png' => 'Small progress in gameplay view',
),
),
'2005-01-31' => array(
'caption' => 'Rendering a couple of FLI videos',
'shots' => array(
'ss4.png' => 'Intro video #1',
'ss5.png' => 'Intro video #2',
'ss6.png' => 'Intro video #3',
'ss7.png' => 'Lose game video',
'ss8.png' => 'Win game video',
'ss9.png' => 'Credits video',
),
),
'2004-06-21' => array(
'caption' => 'An early demo of the map rendering',
'shots' => array(
'ss1.png' => 'This should be familiar :-)',
'ss2.png' => 'Just some random map',
'ss3.png' => 'Rendered with a different palette',
),
),
);
// See if we need to show a screenshot
$ss_date = isset($_GET['ss_date']) ? $_GET['ss_date'] : '';
$ss_file = isset($_GET['ss_file']) ? $_GET['ss_file'] : '';
$invalid = (empty($ss_date) || empty($ss_file) || empty($screenshots[$ss_date]) ||
empty($screenshots[$ss_date]['shots']) || !isset($screenshots[$ss_date]['shots'][$ss_file]));
$title = ($invalid ? 'Screenshots' : "Screenshot ($ss_file)");
require_once 'include/common.php';
printHeader();
print "<div class=\"cent_algn\">\n";
if ($invalid) {
// Show the list of all screenshots
foreach ($screenshots as $date => $shotlist) {
if (empty($shotlist['shots'])) {
next;
}
$caption = !empty($shotlist['caption']) ? ' &raquo; ' . $shotlist['caption'] : '';
print "<div class=\"caption\">$date$caption</div>\n";
print "<table class=\"screenshots\"><tr>\n";
$rowcount = 0;
$endrow = false;
foreach ($shotlist['shots'] as $file => $caption) {
$thumb = "thumb.$file";
$thumb_img = "screenshots/$thumb";
$thumbnail = "images/$thumb_img";
$file_img = "screenshots/$file";
$filename = "images/$file_img";
if (!file_exists($filename) || !file_exists($thumbnail)) {
next;
}
if ($endrow) {
print "</tr><tr>\n";
$endrow = false;
}
// We need the GD extension installed for this to work
$thumb_size = getimagesize($thumbnail);
$file_size = getFileSize($filename);
$img = img($thumb_img, $thumb, $thumb_size[0], $thumb_size[1]);
print "<td><a href=\"ss.php?ss_date=$date&amp;ss_file=$file\">\n";
print "$img<br />\n";
print "$file ($file_size)</a><br />\n";
print "$caption</td>\n\n";
$rowcount++;
if ($rowcount == 3) {
$rowcount = 0;
$endrow = true;
}
}
print "</tr></table><br />\n";
}
} else {
// View a single screenshot
$shots = $screenshots[$ss_date]['shots'];
$caption = !empty($shots[$ss_file]) ? ' &raquo; ' . $shots[$ss_file] : '';
print "<div class=\"caption\">$ss_date$caption</div><br />\n";
$ss_url = "screenshots/$ss_file";
// We need the GD extension installed for this to work
$ss_size = getimagesize("images/$ss_url");
echo '<a href="ss.php">', img($ss_url, $ss_file, $ss_size[0], $ss_size[1]), "</a>\n<br /><br />\n";
print "<div class=\"caption\">Click on the screenshot to return</div>\n";
}
print "</div>\n";
printFooter();
?>