-
Notifications
You must be signed in to change notification settings - Fork 1
/
minidashboard.php
63 lines (48 loc) · 1.83 KB
/
minidashboard.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
<?php
try {
require_once('Sprinkles.php');
$sprink = new Sprinkles();
$username_canonical = request_param('username');
if ($username_canonical) {
$user = $sprink->get_person($sprink->api_url("people/$username_canonical"));
$user_possessive = $user['fn'] . "'s";
$is_self = false;
$all_topics = $sprink->topics(array('person' => $username_canonical));
} else if ($user_url = request_param('user_url')) {
$user = $sprink->get_person($user_url);
$user_possessive = $user['fn'] . "'s";
$username_canonical = $user['canonical_name'];
$is_self = false;
$all_topics = $sprink->topics(array('person' => $username_canonical));
} else {
$user = $sprink->current_user();
$user_possessive = 'your';
$username_canonical = $user['canonical_name'];
$is_self = true;
$all_topics = $sprink->topics(array('followed' => $username_canonical));
}
$all_topics = $all_topics['topics'];
assert($all_topics);
assert(count($all_topics) > 0);
list($company_topics, $noncompany_topics) =
$sprink->company_partition($all_topics);
$company_topics = take(5, $company_topics);
$noncompany_topics = take(4, $noncompany_topics);
// $sprink->resolve_authors($company_topics);
resolve_companies($noncompany_topics);
$smarty->assign('company_topics', $company_topics);
$smarty->assign('noncompany_topics', $noncompany_topics);
$smarty->assign('current_url', 'minidashboard.php');
$smarty->assign('entries', $entries['topics']);
$smarty->assign('user', $user);
$smarty->assign('username_canonical', $username_canonical);
$smarty->assign('user_possessive', $user_possessive);
$smarty->assign('user_is_self', $is_self);
$smarty->assign('sfn_root', $sfn_root);
$sprink->add_std_hash_elems($smarty);
$smarty->display('minidashboard.t');
} catch (Exception $e) {
error_log("Exception thrown while preparing page: " . $e->getMessage());
$smarty->display('error.t');
}
?>