forked from jkk/eidogo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
problems.php
43 lines (32 loc) · 1.24 KB
/
problems.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
<?php
$title = "Source Code";
include("header.phtml");
$collections = array(
"qjzm" => "Qi Jing Zhong Miao / Gokyo Shumyo",
"xuanlan" => "Xuanlan / Genran",
"xxqj" => "Xuan Xuan Qi Jing / Gengen Gokyo");
echo '<div id="text-content">';
list($dir, $num) = explode('/', $_GET['path']);
$dir = preg_replace("/[^a-z]/", "", $dir);
$num = (int)$num;
if ($dir && $collections[$dir] && $num) {
echo "<h2><a href='/problems'>Go Problems</a>: " . $collections[$dir] . "</h2>";
$sgfs = glob("sgf/problems/$dir/*.sgf");
echo "<p>Problem " . $num . " of " . count($sgfs) . "</p>";
echo '<div class="eidogo-player-problem" sgf="/' . $sgfs[$num-1] . '"></div>';
if ($num < count($sgfs) - 1)
echo "<p><big><a href='/problems/$dir/" . ($num+1) . "'>Next »</a></big></p>";
} else {
echo "<h2>Go Problems</h2>";
echo "<p>Note: responses are provided for the problems, but they will not
tell you when you get it right. This area of the site is still
being developed.</p>";
echo "<ul>\n";
foreach ($collections as $dir => $title) {
echo "<li><p><a href='/problems/$dir/1'>$title</a></p></li>\n";
}
echo "</ul>\n";
}
//
echo '</div>';
include("footer.phtml"); ?>