-
Notifications
You must be signed in to change notification settings - Fork 40
/
browse.php
executable file
·81 lines (76 loc) · 1.77 KB
/
browse.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
<html>
<head>
<style>
.label {font-weight:bold;}
</style>
</head>
<body>
<?php
include('config.php');
include('includes/functions.php');
include('includes/mysql_functions.php');
if (isset($_GET['pageID'])) $pageID = $_GET['pageID'];
else $pageID = 1;
$page = get_page($pageID);
?>
<h2><?php echo $page['title']; ?></h2>
<ul>
<li><span class='label'>URL: </span>
<?php echo $page['url']; ?></li>
<li>
<span class='label'># Incomming Links: </span>
<?php echo count_links($pageID,"to") ?>
</li>
<li>
<span class='label'># Outgoing Links: </span>
<?php echo count_links($pageID,"from") ?>
</li>
<?php unset($page['title']); unset($page['ID']); unset($page['URL']); unset($page['crawled']); ?>
<?php foreach ($page as $field=>$value) { ?>
<li><span class='label'><?php echo $field; ?>:</span><?php
switch($field) {
case 'size':
echo file_size($value);
break;
case 'modified':
if ($value != '') echo date('Y-m-d H:i:s',$value);
break;
default:
echo $value;
break;
}
}
?>
</ul>
<hr>
<?php
$links = get_links($pageID);
if (sizeof($links) > 0) { ?>
<ul>
<?php foreach ($links as $linkID => $link) { ?>
<li>
<a href='?pageID=<?php echo $linkID; ?>'><?php echo $link['title']; ?></a>
<?php unset($link['title']); unset($link['ID']); unset($link['URL']); unset($link['crawled']); ?>
<ul>
<?php foreach ($link as $field=>$value) { ?>
<li><span class='label'><?php echo $field; ?>:</span><?php
switch($field) {
case 'size':
echo file_size($value);
break;
case 'modified':
if (strlen($value)>0) echo date('Y-m-d H:i:s',$value);
break;
default:
echo $value;
break;
}
?></li>
<?php } ?>
</ul>
</li>
<?php } ?>
</ul>
<?php } else { ?>
<p>No Links on this page</p>
<?php } ?>