/
folks.php
executable file
·119 lines (98 loc) · 3.02 KB
/
folks.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
require('includes/header.php');
update_activity('folks', 1);
$res=DB::Execute('SELECT a.action_name, a.action_id, a.uid, a.time, t.headline FROM {P}Activity as a LEFT OUTER JOIN {P}Topics as t ON a.action_id = t.id WHERE a.time > '.intval($_SERVER['REQUEST_TIME']).' - 960 ORDER BY time DESC');
$count = $res->RecordCount();
$page_title = 'Folks online (' . $count . ')';
$table = new table();
$columns = array
(
'Doing',
'Poster',
'Last sign of life ▼',
);
$table->define_columns($columns, 'Doing');
$table->add_td_class('Poster', 'minimal');
$table->add_td_class('Last sign of life ▼', 'minimal');
$i = 0;
// Array key based off
$actions = array(
'advertise' => 'Inquiring about advertising.',
'statistics' => 'Looking at board statistics.',
'hot_topics' => 'Looking at the hottest topics.',
'bulletins' => 'Reading latest bulletins.',
'bulletins_old' => 'Reading latest bulletins.',
'folks' => 'Looking at what other people are doing.',
'topics' => 'Looking at older topics.',
'dashboard' => 'Modifying their dashboard',
'latest_replies'
=> 'Looking at latest replies.',
'latest_bumps' => 'Checking out latest bumps.',
'latest_topics' => 'Checking out latest topics.',
'search' => 'Searching for a topic.',
'stuff' => 'Looking at stuff.',
'history' => 'Looking at post history.',
'failed_postings'
=> 'Looking at post failures.',
'watchlist' => 'Checking out their watchlist.',
'restore_id' => 'Logging in.',
'new_topic' => 'Creating a new topic.',
'nonexistent_topic'
=> 'Trying to look at a non-existant topic.',
'topic' => "Reading in topic: <strong><a href=\"/topic/$action_id\">$headline</a></strong>",
'replying' => "Replying to topic: <strong><a href=\"/topic/$action_id\">$headline</a></strong>",
'topic_trivia' => "Reading <a href=\"/trivia_for_topic/$action_id\">trivia for topic</a>: <strong><a href=\"/topic/$action_id\">$headline</a></strong>",
'banned' => 'Being banned.'
);
while(list($action, $action_id, $uid, $age, $headline)=$res->FetchRow())
{
// Maximum amount of actions to be shown (100 by default)
if(++$i == 100)
{
break;
}
if($uid == $_SESSION['UID'])
{
$uid = 'You!';
}
else
{
if(isPowerUser())
{
$uid = '<a href="/profile/' . $uid . '">' . $uid . '</a>';
}
else
{
$uid = '?';
}
}
$bump = calculate_age($age, $_SERVER['REQUEST_TIME']);
$headline = htmlspecialchars($headline);
$action = $actions[$action];
// Unknown or unrecorded actions are bypassed
if($action == null)
{
continue;
}
// Repeated actions are listed as (See above)
if($action == $old_action)
{
$temp = '<span class="unimportant">(See above)</span>';
}
else
{
$old_action = $action;
$temp = $action;
}
$values = array ($action,
$uid,
'<span class="help" title="' . format_date($age) . '">' . calculate_age($age) . '</span>');
$table->row($values);
}
echo $table->output();
if($count > 100)
{
echo '<p class="unimportant">(There are <b>a lot</b> of people active right now. Not all are shown here.)</p>';
}
require ('includes/footer.php');
?>