-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage_view.php
51 lines (40 loc) · 1.46 KB
/
page_view.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
<?php
define('INCLUDE_PATH', 'include/');
require(INCLUDE_PATH.'vitals.inc.php');
require(INCLUDE_PATH.'header.inc.php');
$page_id = intval($_GET['c']);
$sql = "SELECT * FROM pages WHERE page_id=".$page_id;
$result = mysql_query($sql, $db);
$row = mysql_fetch_assoc($result);
if ($row) {
echo '<h3>'.get_title('page', $row['page_id']).'</h3>';
echo get_content($row['page_id']);
} else {
echo "No such page";
}
echo '<br style="clear:both;" /><br />';
//get sub pages
$sql = "SELECT page_id FROM pages WHERE parent_id=".$page_id;
$result = mysql_query($sql, $db);
if (@mysql_num_rows($result)) {
echo '<br style="clear:both;" /><h2 style="margin-top:1em;"><img src="images/pictures.png" alt="Sub-pages" title="Sub-pages" style="padding:3px;" /></h2><div id="block-container" >';
while ($row = mysql_fetch_assoc($result)) {
$title = get_title('page', $row['page_id']);
?>
<div class="page">
<div class="title">
<div style="height:150px;">
<?php echo $title; ?>
</div>
<a href="page_view.php?c=<?php echo $row['page_id']; ?>" class="goto">
<img src="images/hand.png" style="border:0px;padding:0px;" />
</a>
</div>
</div>
<?php
}
echo '</div>';
}
echo '<div style="clear:both;" /><img src="images/arrow_left.png" alt="Back" title="Back" style="margin-top:20px" class="buttonimage" onclick="javascript:history.back(1);" /></div>';
require(INCLUDE_PATH.'footer.inc.php');
?>