forked from raphaelcm/Retwis-w-Predis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.php
25 lines (24 loc) · 812 Bytes
/
profile.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
<?
include("retwis.php");
include("header.php");
$r = redisLink();
if (!gt("u") || !($userid = $r->get("username:".gt("u").":id"))) {
echo("<h2 class=\"username\">No user by that name.</h2>");
//header("Location: index.php");
exit(1);
}
echo("<h2 class=\"username\">".utf8entities(gt("u"))."</h2>");
if (isLoggedIn() && $User['id'] != $userid) {
$isfollowing = $r->sismember("uid:".$User[id].":following",$userid);
if (!$isfollowing) {
echo("<a href=\"follow.php?uid=$userid&f=1\" class=\"button\">Follow this user</a>");
} else {
echo("<a href=\"follow.php?uid=$userid&f=0\" class=\"button\">Stop following</a>");
}
}
?>
<?
$start = gt("start") === false ? 0 : intval(gt("start"));
showUserPostsWithPagination(gt("u"),$userid,$start,10,false);
include("footer.php")
?>