-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.php
65 lines (62 loc) · 2.23 KB
/
error.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
<?php
$err_status=-1;
$err_message = "Sorry, but that ";
if ($_REQUEST["err"]=="answer-not-found") {
$err_status = getAnswerStatus($_REQUEST["a"]);
$err_message .= "answer ";
} else if ($_REQUEST["err"]=="topic-not-found") {
$err_status = getTopicStatus($_REQUEST["t"]);
$err_message .= "topic ";
} else {
$err_message .= "page ";
}
if (isDenied($err_status)) {
$err_message .= "is no longer available";
} else if (isPending($err_status)) {
$err_message .= "is pending approval";
} else if (isNotFound($err_status)) {
$err_message .= "cannot be found";
} else if (isApproved($err_status)) {
$err_message .= "has not yet been answered";
} else {
$err_message .= "does not exist";
}
?>
<div class="error-content">
<div class="title">
<h1><?php echo $err_message; ?></h1>
</div>
<div class="links-group first">
<h3>Recently Viewed</h3>
<?php
$a_recentlyViewedAnswers = getRecentlyViewedAnswers();
foreach ($a_recentlyViewedAnswers as $lcv => $a_answer) {
if ($lcv<3) {
print "<div class=\"link\"><a href=\"".getUrl("/what-it-feels-like-to-".$a_answer["url"]."/".$a_answer["id"]."/")."\">".$a_answer["topic"]."</a></div>";
}
}
?>
</div>
<div class="links-group">
<h3>New Stories</h3>
<?php
$a_recentlyApprovedAnswers = getRecentlyApprovedAnswers();
foreach ($a_recentlyApprovedAnswers as $lcv => $a_answer) {
if ($lcv<3) {
print "<div class=\"link\"><a href=\"".getUrl("/what-it-feels-like-to-".$a_answer["url"]."/".$a_answer["id"]."/")."\">".$a_answer["topic"]."</a></div>";
}
}
?>
</div>
<div class="links-group">
<h3>Most Viewed</h3>
<?php
$a_mostViewedAnswers = getMostViewedAnswers();
foreach ($a_mostViewedAnswers as $lcv => $a_answer) {
if ($lcv<3) {
print "<div class=\"link\"><a href=\"".getUrl("/what-it-feels-like-to-".$a_answer["url"]."/".$a_answer["id"]."/")."\">".$a_answer["topic"]."</a></div>";
}
}
?>
</div>
</div>