-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathuser.php
More file actions
59 lines (50 loc) · 1.33 KB
/
user.php
File metadata and controls
59 lines (50 loc) · 1.33 KB
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
<?php
session_start();
$_SESSION[id] = intval($_SESSION[id]);
if(!isset($_SESSION[id])) { $_SESSION[id] = 0; }
require("config.php");
require("functions/db.php");
require("functions/links.php");
require("functions/common.php");
require("functions/comments.php");
require("functions/user.php");
require("functions/forms.php");
if(isset($_GET[name])) { $_GET[id] = getUserId($_GET[name]); }
if(intval($_GET[id]) == 0) { header("Location:".PREFIX); }
$linkid = intval($_GET[linkid]);
checkLogin($_SESSION[id]);
printHeader();
$user = getUser($_GET[id]);
printUser($user);
print "<div class=linklist>";
if($_GET[type] == "comments") {
$comments = getComments(0,$_GET[id],$_GET[page],LINKS_PER_PAGE);
$pagination = pagination($comments[page],$comments[totalpages],"links");
print($pagination);
print "<ul class=comments>";
if(!empty($comments[0])) {
foreach($comments[0] as $comment) {
print(printComment($comment,0));
}
}
}
else {
$links = getLinks($_GET[page],LINKS_PER_PAGE,"",$_GET[id]);
$pagination = pagination($links[page],$links[totalpages],"links");
print($pagination);
print "<ul>";
if(!empty($links[0])) {
foreach($links[0] as $link) {
print(printLink($link));
}
}
}
print "</ul>";
print($pagination);
print "</div>";
/*
print("<pre>");
print_r($_SERVER);
print_r(parse_url($_SERVER[REQUEST_URI]));
print("</pre>");
*/