]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/online.tmpl
new WhoIsOnline plugin: session explorer (postnuke style)
[SourceForge/phpwiki.git] / themes / default / templates / online.tmpl
1 <?php // -*-php-*- ?>
2 <!-- $Id: online.tmpl,v 1.1 2004-02-26 19:15:37 rurban Exp $ -->
3 <?php
4 // Formatting and idea borrowed from postnuke.
5
6 // We have two modes: 1. a simple "summary" block, and
7 // 2. "detail" with a table of online users, date and current actions
8 $header = _("Who Is Online");
9 if ($MAX_ONLINE_TIME and $MAX_ONLINE_NUM)
10   $MAX_ONLINE_TIME = $Theme->formatDateTime($MAX_ONLINE_TIME);
11 ?>
12
13 <?php if ($mode == 'summary') {
14     if ($allow_detail) {
15       $url = WikiUrl($pagename,array("mode"=>"detail"));
16       $header = HTML::a(array('href'=>$url),_("Who Is Online"));
17     }
18     /*
19     $registered_names = array();
20     foreach ($REGISTERED as $user) {
21       $registered_names[] = WikiLink($user['name']);
22     }
23     */
24 ?>
25 <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
26   <tr><td class="cat" colspan="2"><?= $header ?></td></tr>
27   <tr><td class="row1" rowspan="3"><?= $ONLINE_ICON ?></td>
28       <td class="row1" class="gensmall"><?= fmt("Our users created a total of %d pages.",$NUM_PAGES) ?><br />
29           <?= fmt("We have a total of %d registered users.",$NUM_USERS) ?><br />
30           <?= $NEWEST_USER ? fmt("The newest registered user is %s",$NEWEST_USER) : ''?>
31           </td></tr>
32   <?php if ($SESSDATA_BOOL) { ?>
33   <tr><td class="row1" class="gensmall">
34           <?= fmt("In total there are %d user sessions online :: Unique %d Registered and %d Guests",
35                   $NUM_ONLINE,$NUM_REGISTERED,$NUM_GUESTS) ?><br />
36           <?= $MAX_ONLINE_NUM ? fmt("Most users ever online was %d at %s",$MAX_ONLINE_NUM,$MAX_ONLINE_TIME) : '' ?><br />
37           <?= fmt("Registered Users Online: ") ?>
38 <?php 
39     $s='';
40     foreach ($REGISTERED as $user) {
41       $link = WikiLink($user['name']);
42       $s .= $link->asXML() . ", ";
43     }
44     echo substr($s,0,-2);
45 ?>
46 <?php if (!empty($ADMINS) and $dispose_admin) { ?> 
47     <br />
48     <?= fmt("Admin is also online.") ?>
49 <?php } ?>
50   </td></tr>
51   <tr><td class="row1" class="gensmall">
52     <?= fmt("This data is based on users active over the past %s",$SESSION_TIME) ?><br />
53     </td></tr>
54   <?php } else { ?>
55   <tr><td class="row1" class="gensmall"><br />
56    <?= fmt("Sorry, no dynamic DB Session support.") ?><br />
57     </td></tr>
58   <?php } ?>
59 </table>
60 <?php } ?>
61
62 <?php if ($mode == 'detail') {
63     $url = WikiUrl($pagename,array("mode"=>"summary"));
64     $header = HTML::a(array('href'=>$url),_("Who Is Online"));
65 ?>
66 <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
67   <tr><td class="cat" colspan="3"><?= $header ?></td></tr>
68    <tr><td class="cat" colspan="3"><?= _("Registered Users") ?></td></tr>
69   <?php if (!empty($ADMINS) and $dispose_admin) { ?> 
70   <?php   foreach ($ADMINS as $user) { ?>
71   <tr><td class="row1" class="gensmall"><?= $user['name'] ?></td>
72       <td class="row1" class="gensmall"><?= $Theme->formatDateTime($user['date']) ?></td>
73       <td class="row1" class="gensmall"><?= $user['page'] ?></td>
74       </tr>
75   <?php   } ?>
76   <?php } ?>
77   <?php foreach ($REGISTERED as $user) { ?>
78   <tr><td class="row1" class="gensmall"><?= $user['name'] ?></td>
79       <td class="row1" class="gensmall"><?= $Theme->formatDateTime($user['date']) ?></td>
80       <td class="row1" class="gensmall"><?= $user['page'] ?></td>
81       </tr>
82   <?php } ?>
83    <tr><td class="cat" colspan="3"><?= _("Guests") ?></td></tr>
84   <?php foreach ($GUESTS as $user) { ?>
85   <tr><td class="row1" class="gensmall"><?= $user['name'] ?></td>
86       <td class="row1" class="gensmall"><?= $Theme->formatDateTime($user['date']) ?></td>
87       <td class="row1" class="gensmall"><?= $user['page'] ?></td>
88       </tr>
89   <?php } ?>
90 </table>
91 <?php } ?>
92 <hr class="no-css" />