-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtimeline.php
56 lines (45 loc) · 1.88 KB
/
timeline.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
<?php
include_once('library_main.php');
print "{ \"dateTimeFormat\":\"iso8601\", \"events\": "
. str_replace("\"false\"","false", json_encode(GetTimelineEvents()))
. "}";
function GetTimelineEvents()
{
$dbh = SqlConnect();
$stmt = $dbh->prepare("SELECT from_unixtime(entrydate,
get_format(datetime, 'ISO')) AS start,
CONCAT(p.firstname, ': ', title) AS title,
description,
'false' AS durationEvent,
CONCAT('http://saalonmuyo.com/planetrefi/viewprofile.php?user=', u.username) AS link,
p.housephoto AS image
FROM timeline t
JOIN users u ON t.userid = u.userid
JOIN profiles p ON p.userid = u.userid");
$stmt->setFetchMode(PDO::FETCH_ASSOC);
if ($stmt->execute())
return $stmt->fetchAll();
else
return '';
}
function GetProfileTimelineEvents($username)
{
$dbh = SqlConnect();
$stmt = $dbh->prepare("SELECT from_unixtime(entrydate,
get_format(datetime, 'ISO')) AS start,
CONCAT(p.firstname, ': ', title) AS title,
description,
'false' AS durationEvent,
CONCAT('http://saalonmuyo.com/viewprofile.php?user=', u.username) AS link,
p.housephoto AS image
FROM timeline t
JOIN users u ON t.userid = u.userid WHERE u.username = :username
JOIN profiles p ON p.userid = u.userid");
$stmt->setFetchMode(PDO::FETCH_ASSOC);
$stmt->bindParam(':username', $username);
if ($stmt->execute())
return $stmt->fetchAll();
else
return '';
}
?>