3 require('includes/header.php');
5 update_activity('statistics');
6 $page_title = 'Statistics';
10 $query = 'SELECT count(*) FROM topics;';
11 $query .= 'SELECT count(*) FROM replies;';
12 $query .= 'SELECT count(*) FROM uid_bans;';
13 $query .= "SELECT count(*) FROM topics WHERE author = '" . $link->real_escape_string($_SESSION['UID']) . "';";
14 $query .= "SELECT count(*) FROM replies WHERE author = '" . $link->real_escape_string($_SESSION['UID']) . "';";
15 $query .= 'SELECT count(*) FROM ip_bans;';
17 $link->multi_query($query);
19 $result = $link->store_result();
20 while ($row = $result->fetch_row())
22 $statistics[] = $row[0];
25 } while ($link->next_result());
27 $num_topics = $statistics[0];
28 $num_replies = $statistics[1];
29 $replies_per_topic = round($num_replies / $num_topics);
30 $num_bans = $statistics[2];
31 $your_topics = $statistics[3];
32 $your_replies = $statistics[4];
33 $your_posts = $your_topics +
$your_replies;
34 $num_ip_bans = $statistics[5];
36 $total_posts = $num_topics +
$num_replies;
37 $days_since_start = floor(( $_SERVER['REQUEST_TIME'] - SITE_FOUNDED
) / 86400);
38 $posts_per_day = round($total_posts / $days_since_start);
39 $topics_per_day = round($num_topics / $days_since_start);
40 $replies_per_day = round($num_replies / $days_since_start);
47 <th
class="minimal">Amount
</th
>
52 <th
class="minimal">Total existing posts
</th
>
53 <td
class="minimal"><?php
echo format_number($total_posts) ?
></td
>
58 <th
class="minimal">Existing topics
</th
>
59 <td
class="minimal"><?php
echo format_number($num_topics) ?
></td
>
64 <th
class="minimal">Existing replies
</th
>
65 <td
class="minimal"><?php
echo format_number($num_replies) ?
></td
>
66 <td
>That
's ~<?php echo $replies_per_topic ?> replies/topic.</td>
70 <th class="minimal">Posts/day</th>
71 <td class="minimal">~<?php echo format_number($posts_per_day) ?></td>
76 <th class="minimal">Topics/day</th>
77 <td class="minimal">~<?php echo format_number($topics_per_day) ?></td>
82 <th class="minimal">Replies/day</th>
83 <td class="minimal">~<?php echo format_number($replies_per_day) ?></td>
88 <th class="minimal">Temporarily banned IDs</th>
89 <td class="minimal"><?php echo format_number($num_bans) ?></td>
94 <th class="minimal">Banned IP addresses</th>
95 <td class="minimal"><?php echo format_number($num_ip_bans) ?></td>
100 <th class="minimal">Days since launch</th>
101 <td class="minimal"><?php echo number_format($days_since_start) ?></td>
102 <td>Went live on <?php echo date('Y
-m
-d
', SITE_FOUNDED) . ', ' . calculate_age(SITE_FOUNDED) ?> ago.</td>
113 <th class="minimal">Total posts by you</th>
114 <td><?php echo format_number($your_posts) ?></td>
118 <th class="minimal">Topics started by you</th>
119 <td><?php echo format_number($your_topics) ?></td>
123 <th class="minimal">Replies by you</th>
124 <td><?php echo format_number($your_replies) ?></td>
130 require('includes
/footer
.php
');