<!DOCTYPE html >
<html lang="en">
<head>
  <title><%cat_full_name%>: Who's Online</title>
<%include include_common_head.html%>
</head>

<%~set content_header_title = "Who's Online"%>

<body class="page-<%page_id%>">
  <div class="container-b">
    <%include include_header.html%>

    <div class="main">
      <div class="contentwrapper clearfix">
        <div class="sidebar">
            <%include include_sidebar.html%>
        </div>

        <%~init array breadcrumbs%><%init hash breadcrumbs.0%>
        <%~set breadcrumbs.0.name = $content_header_title%>

        <%include include_breadcrumb.html%>

        <div class="content"><%-- start content--%>
          <%include include_content_header.html%>

          <p><%online_users.length%> user<%if online_users.length != 1%>s<%endif%> and <%online_guests.length%> guest<%if online_guests.length != 1%>s<%endif%> online in the past 15 minutes.</p>

          <h4>Buddies</h4>
          <div class="dtable">
            <div class="dhead">
              <div class="drow">
                <div class="dcell username">Username</div>
                <div class="dcell"></div>
                <%~if current.user_status == $ADMINISTRATOR%>
                <div class="dcell ip">IP</div>
                <%~endif%>
                <div class="dcell where">Where</div>
                <div class="dcell date">Last seen</div>
              </div>
            </div>
            <div class="dbody">
              <%~loop online_buddies%>
              <div class="drow">
                <div class="dcell username"><%include include_username.html%></div>
                <div class="dcell action">
                  <%~set url_user_username = escape_url unescape_html $user_username%>
                  <img src="<%image_url('message.png')%>" alt="Send PM" /> <a href='<%GForum::SEO::url(params => "do=message;user_username=$url_user_username")%>'>Send PM</a>
                </div>
                <%~if current.user_status == $ADMINISTRATOR%>
                <div class="dcell ip">
                  <a href='<%GForum::SEO::url(params => "do=ip_summary;ip=$online_ip")%>' title="View IP summary"><%online_ip%></a>
                  <span class="ban"> (<a href='<%GForum::SEO::url(params => "do=ban_ip;redo=$this_do;ip=$online_ip")%>' title="Ban this IP">Ban</a>)</span>
                </div>
                <%~endif%>
                <div class="dcell where"><%online_action%></div>
                <div class="dcell date"><%user_last_seen_date%></div>
              </div>
              <%~endloop%>
            </div>
          </div>
          <%~unless online_buddies.length%>
          <p>None of your buddies are online</p>
          <%~endunless%>

          <h4>Users</h4>
          <div class="dtable">
            <div class="dhead">
              <div class="drow">
                <div class="dcell username">Username</div>
                <div class="dcell nickname">Title</div>
                <%~if current.user_status == $ADMINISTRATOR%>
                <div class="dcell ip">IP</div>
                <%~endif%>
                <div class="dcell where">Where</div>
                <div class="dcell date">Last seen</div>
              </div>
            </div>
            <div class="dbody">
              <%~loop online_users%>
              <div class="drow">
                <div class="dcell username"><%include include_username.html%></div>
                <div class="dcell nickname"><%user_title%></div>
                <%~if current.user_status == $ADMINISTRATOR%>
                <div class="dcell ip">
                  <a href="<%GForum::SEO::url(params => "do=ip_summary;ip=$online_ip")%>" title="View IP summary"><%online_ip%></a>
                  <span class="ban"> (<a href='<%GForum::SEO::url(params => "do=ban_ip;redo=$this_do;ip=$online_ip")%>' title="Ban this IP" rel="post-only">Ban</a>)</span>
                </div>
                <%~endif%>
                <div class="dcell where"><%online_action%></div>
                <div class="dcell date"><%user_last_seen_date%></div>
              </div>
              <%~endloop%>
            </div>
          </div>
          <%~unless online_users.length%>
          <p>There are no users online</p>
          <%~endunless%>

          <h4>Guests</h4>
          <div class="dtable">
            <div class="dhead">
              <div class="drow">
                <div class="dcell username">Username</div>
                <%~if current.user_status == $ADMINISTRATOR%>
                <div class="dcell ip">IP</div>
                <%~endif%>
                <div class="dcell where">Where</div>
                <div class="dcell date">Last seen</div>
              </div>
            </div>
            <div class="dbody">
              <%~loop online_guests%>
              <div class="drow">
                <div class="dcell username">Guest #<%row_num%></div>
                <%~if current.user_status == $ADMINISTRATOR%>
                <div class="dcell ip">
                  <a href='<%GForum::SEO::url(params => "do=ip_summary;ip=$online_ip")%>' title="View IP summary"><%online_ip%></a>
                  <span class="ban"> (<a href='<%GForum::SEO::url(params => "do=ban_ip;redo=$this_do;ip=$online_ip")%>' title="Ban this IP" rel="post-only">Ban</a>)</span>
                </div>
                <%~endif%>
                <div class="dcell where"><%online_action%></div>
                <div class="dcell date"><%online_date%></div>
              </div>
              <%~endloop%>
            </div>
          </div>
          <%~unless online_guests.length%>
          <p>There are no guests online</p>
          <%~endunless%>

        </div><%-- end content --%>
      </div>
    </div>
    <%include include_footer.html%>
  </div>

</body>
<%~include include_global_js.html%>
<%~if current.user_status == $ADMINISTRATOR%>
  <script type="text/javascript">
    $(document).ready(function () {
      GForum.init_post_only();
    });
  </script>
<%~endif%>
</html>
