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