-
Notifications
You must be signed in to change notification settings - Fork 53
/
screenshots.php
147 lines (121 loc) · 2.99 KB
/
screenshots.php
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?php
/*
* Screenshots Page
*
*/
// set this for position of this file relative
$file_root = ".";
// load libraries
require($file_root."/include/"."incl.php");
require($file_root."/include/"."screenshots.php");
// start of html
html_header("ScummVM :: Screenshots");
sidebar_start();
//display welcome table
echo html_round_frame_start("Screenshots","");
?>
<h1>Screenshots</h1>
<?php
$view = isset($_GET['view']) ? $_GET['view'] : -1;
$offset = isset($_GET['offset']) ? $_GET['offset'] : -1;
// if in single view
if ($view != -1)
{
if (!is_numeric($view))
{
echo "<h1>Error: Unknown image ID</h1>";
}
else
{
echo
html_frame_start("Screenshot Viewer","540",2,0,"color0"),
html_frame_tr(
html_frame_td(
'<img src="'.screenshot_path($view).'" '.
'alt="Screenshot '.$view.'">',
'align=center class="color0" style="padding-top: 10px;"'
)
),
html_frame_tr(
html_frame_td(
screenshot_caption($view),
'align=center class="color0" style="padding-bottom: 10px; font-style: italic;"'
)
),
html_frame_tr(
html_frame_td(
html_ahref(" << Back",$PHP_SELF."?offset=".$offset,"style='color: white;'"),
'align=left class="color4"'
)
),
html_frame_end();
}
}
else
{
// counter vars
$num = 0;
$where = 0;
echo html_frame_start("Screenshot Gallery","540",2,0,"color0")."<tr>";
// loop and display images
while (list($c,$image) = each($screenshots))
{
// do not show images less than current pos
if ($offset > $c)
continue;
// display image
echo html_frame_td(
'<table cellpadding="0" cellspacing="0"><tr><td align="center">'.
'<a href="'.$_SERVER["PHP_SELF"]."?view=".$c.'&offset='.$offset.'">'.
'<img src="'.screenshot_thumb_path($c).'" '.
'width="'.$thumb_w.'" height="'.$thumb_h.'" alt="Screenshot '.$c.'"></a>'.
'</td></tr><tr><td align="center">'.
screenshot_caption($c).
'</td></tr></table>',
'align=center class="color0" style="padding-top: 10px; font-style: italic;"'
);
// count number of images displayed.
$num++;
// end at 4
if ($num == 4)
{
$where = $c;
break;
}
// end row at 2
if (($num % 2 == 0) && ($num != 1))
{
echo "</tr><tr>\n";
}
}
echo "</tr>";
$prevLink = " ";
$nextLink = " ";
// display prev link
if ($offset)
{
$prev = $offset - 4;
$prevLink = html_ahref("<< Prev 4 Images",$_SERVER["PHP_SELF"]."?offset=".$prev,"style='color: white;'");
}
// display next link
if (($offset + 4) < $screenshots_count)
{
$next = $where + 1;
$nextLink = html_ahref("Next 4 Images >>",$_SERVER["PHP_SELF"]."?offset=".$next,"style='color: white;'");
}
echo html_frame_tr(
html_frame_td(" ".$prevLink,"align=left").
html_frame_td($nextLink." ","align=right"),
"color4"
);
echo html_frame_end();
//end view
}
// close table
echo html_p();
echo html_round_frame_end(" ");
// end of html
sidebar_end();
html_footer();
// end
?>