<classname><![CDATA[wcf\system\dashboard\box\TodaysBirthdaysDashboardBox]]></classname>
<boxtype>sidebar</boxtype>
</dashboardbox>
+
+ <dashboardbox name="com.woltlab.wcf.user.todaysFollowingBirthdays">
+ <classname><![CDATA[wcf\system\dashboard\box\TodaysFollowingBirthdaysDashboardBox]]></classname>
+ <boxtype>sidebar</boxtype>
+ </dashboardbox>
+
+ <dashboardbox name="com.woltlab.wcf.user.usersOnlineSidebar">
+ <classname><![CDATA[wcf\system\dashboard\box\UsersOnlineSidebarDashboardBox]]></classname>
+ <boxtype>sidebar</boxtype>
+ </dashboardbox>
+
+ <dashboardbox name="com.woltlab.wcf.user.followingsOnlineSidebar">
+ <classname><![CDATA[wcf\system\dashboard\box\FollowingsOnlineSidebarDashboardBox]]></classname>
+ <boxtype>sidebar</boxtype>
+ </dashboardbox>
+
+ <dashboardbox name="com.woltlab.wcf.user.staffOnlineSidebar">
+ <classname><![CDATA[wcf\system\dashboard\box\StaffOnlineSidebarDashboardBox]]></classname>
+ <boxtype>sidebar</boxtype>
+ </dashboardbox>
</import>
</data>
--- /dev/null
+<ul class="sidebarBoxList">
+ {foreach from=$usersOnlineList item=userOnline}
+ <li class="box32">
+ <a href="{link controller='User' object=$userOnline}{/link}" class="framed">{@$userOnline->getAvatar()->getImageTag(32)}</a>
+
+ <div class="sidebarBoxHeadline">
+ <h3><a href="{link controller='User' object=$userOnline}{/link}" class="userLink" data-user-id="{@$userOnline->userID}">{$userOnline->username}</a></h3>
+ <small>{@$userOnline->lastActivityTime|time}</small>
+ </div>
+ </li>
+ {/foreach}
+</ul>
<fieldset class="dashboardBox">
- <legend>{lang}wcf.dashboard.box.{$box->boxName}{/lang}</legend>
+ <legend>{if $titleLink}<a href="{$titleLink}">{lang}wcf.dashboard.box.{$box->boxName}{/lang}</a>{else}{lang}wcf.dashboard.box.{$box->boxName}{/lang}{/if}</legend>
<div>
{@$template}
--- /dev/null
+<ul class="sidebarBoxList">
+ {foreach from=$usersOnlineList item=userOnline}
+ <li class="box32">
+ <a href="{link controller='User' object=$userOnline}{/link}" class="framed">{@$userOnline->getAvatar()->getImageTag(32)}</a>
+
+ <div class="sidebarBoxHeadline">
+ <h3><a href="{link controller='User' object=$userOnline}{/link}" class="userLink" data-user-id="{@$userOnline->userID}">{$userOnline->username}</a></h3>
+ <small>{if MODULE_USER_RANK && $userOnline->getUserTitle()} <span class="badge userTitleBadge{if $userOnline->getRank() && $userOnline->getRank()->cssClassName} {@$userOnline->getRank()->cssClassName}{/if}">{$userOnline->getUserTitle()}</span>{/if}</small>
+ </div>
+ </li>
+ {/foreach}
+</ul>
<ul class="sidebarBoxList">
{foreach from=$birthdayUserProfiles item=birthdayUserProfile}
- <li class="box24">
- <a href="{link controller='User' object=$birthdayUserProfile}{/link}" class="framed">{@$birthdayUserProfile->getAvatar()->getImageTag(24)}</a>
+ <li class="box32">
+ <a href="{link controller='User' object=$birthdayUserProfile}{/link}" class="framed">{@$birthdayUserProfile->getAvatar()->getImageTag(32)}</a>
<div class="sidebarBoxHeadline">
<h3><a href="{link controller='User' object=$birthdayUserProfile}{/link}" class="userLink" data-user-id="{@$birthdayUserProfile->userID}">{$birthdayUserProfile->username}</a></h3>
--- /dev/null
+<ul class="sidebarBoxList">
+ {foreach from=$birthdayUserProfiles item=birthdayUserProfile}
+ <li class="box32">
+ <a href="{link controller='User' object=$birthdayUserProfile}{/link}" class="framed">{@$birthdayUserProfile->getAvatar()->getImageTag(32)}</a>
+
+ <div class="sidebarBoxHeadline">
+ <h3><a href="{link controller='User' object=$birthdayUserProfile}{/link}" class="userLink" data-user-id="{@$birthdayUserProfile->userID}">{$birthdayUserProfile->username}</a></h3>
+ <small>{$birthdayUserProfile->getBirthday()}</small>
+ </div>
+ </li>
+ {/foreach}
+</ul>
--- /dev/null
+<ul class="dataList userList">
+ {foreach from=$usersOnlineList->getObjects() item=userOnline}
+ <li><a href="{link controller='User' object=$userOnline->getDecoratedObject()}{/link}" class="userLink" data-user-id="{@$userOnline->userID}">{@$userOnline->getFormattedUsername()}</a></li>
+ {/foreach}
+</ul>
+
+<p class="marginTopTiny"><small>{lang}wcf.user.usersOnline.detail{/lang}{if USERS_ONLINE_RECORD} - {lang}wcf.user.usersOnline.record{/lang}{/if}</small></p>
\ No newline at end of file
<?php
namespace wcf\system\dashboard\box;
+use wcf\system\WCF;
/**
* Default implementation for dashboard boxes displayed within the sidebar container.
* @see \wcf\system\dashboard\box\AbstractDashboardBoxContent::$templateName
*/
public $templateName = 'dashboardBoxSidebar';
+
+ /**
+ * title link
+ * @var string
+ */
+ public $titleLink = '';
+
+ /**
+ * @see \wcf\system\dashboard\box\IDashboardBox::getTemplate()
+ */
+ public function getTemplate() {
+ $template = $this->render();
+ if (empty($template)) {
+ return '';
+ }
+
+ WCF::getTPL()->assign(array(
+ 'box' => $this->box,
+ 'template' => $template,
+ 'titleLink' => $this->titleLink
+ ));
+
+ return WCF::getTPL()->fetch($this->templateName);
+ }
}
--- /dev/null
+<?php
+namespace wcf\system\dashboard\box;
+use wcf\data\dashboard\box\DashboardBox;
+use wcf\data\user\online\UsersOnlineList;
+use wcf\page\IPage;
+use wcf\system\WCF;
+
+/**
+ * Lists online users the active user is following.
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2014 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.dashboard.box
+ * @category Community Framework
+ */
+class FollowingsOnlineSidebarDashboardBox extends AbstractSidebarDashboardBox {
+ /**
+ * users online list
+ * @var \wcf\data\user\online\UsersOnlineList
+ */
+ public $usersOnlineList = null;
+
+ /**
+ * @see \wcf\system\dashboard\box\IDashboardBox::init()
+ */
+ public function init(DashboardBox $box, IPage $page) {
+ parent::init($box, $page);
+
+ if (MODULE_USERS_ONLINE && count(WCF::getUserProfileHandler()->getFollowingUsers())) {
+ $this->usersOnlineList = new UsersOnlineList();
+ $this->usersOnlineList->getConditionBuilder()->add('session.userID IN (?)', array(WCF::getUserProfileHandler()->getFollowingUsers()));
+ $this->usersOnlineList->readObjects();
+ }
+
+ $this->fetched();
+ }
+
+ /**
+ * @see \wcf\system\dashboard\box\AbstractContentDashboardBox::render()
+ */
+ protected function render() {
+ if (empty($this->usersOnlineList) || !count($this->usersOnlineList->getObjects())) {
+ return '';
+ }
+
+ WCF::getTPL()->assign(array(
+ 'usersOnlineList' => $this->usersOnlineList
+ ));
+ return WCF::getTPL()->fetch('dashboardBoxFollowingsOnlineSidebar');
+ }
+}
--- /dev/null
+<?php
+namespace wcf\system\dashboard\box;
+use wcf\data\dashboard\box\DashboardBox;
+use wcf\data\user\online\UsersOnlineList;
+use wcf\page\IPage;
+use wcf\system\WCF;
+
+/**
+ * Lists staff members who are online.
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2014 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.dashboard.box
+ * @category Community Framework
+ */
+class StaffOnlineSidebarDashboardBox extends AbstractSidebarDashboardBox {
+ /**
+ * users online list
+ * @var \wcf\data\user\online\UsersOnlineList
+ */
+ public $usersOnlineList = null;
+
+ /**
+ * @see \wcf\system\dashboard\box\IDashboardBox::init()
+ */
+ public function init(DashboardBox $box, IPage $page) {
+ parent::init($box, $page);
+
+ if (MODULE_USERS_ONLINE) {
+ $this->usersOnlineList = new UsersOnlineList();
+ $this->usersOnlineList->getConditionBuilder()->add('session.userID IN (SELECT userID FROM wcf'.WCF_N.'_user_to_group WHERE groupID IN (SELECT groupID FROM wcf'.WCF_N.'_user_group WHERE showOnTeamPage = ?))', array(1));
+ $this->usersOnlineList->readObjects();
+ }
+
+ $this->fetched();
+ }
+
+ /**
+ * @see \wcf\system\dashboard\box\AbstractContentDashboardBox::render()
+ */
+ protected function render() {
+ if (empty($this->usersOnlineList) || !count($this->usersOnlineList->getObjects())) {
+ return '';
+ }
+
+ WCF::getTPL()->assign(array(
+ 'usersOnlineList' => $this->usersOnlineList
+ ));
+ return WCF::getTPL()->fetch('dashboardBoxStaffOnlineSidebar');
+ }
+}
--- /dev/null
+<?php
+namespace wcf\system\dashboard\box;
+use wcf\data\dashboard\box\DashboardBox;
+use wcf\data\user\UserProfileList;
+use wcf\page\IPage;
+use wcf\system\user\UserBirthdayCache;
+use wcf\system\WCF;
+use wcf\util\DateUtil;
+
+/**
+ * Shows today's birthdays of users the active user is following.
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2014 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.dashboard.box
+ * @category Community Framework
+ */
+class TodaysFollowingBirthdaysDashboardBox extends AbstractSidebarDashboardBox {
+ /**
+ * user profiles
+ * @var arra<\wcf\data\user\UserProfile>
+ */
+ public $userProfiles = array();
+
+ /**
+ * @see \wcf\system\dashboard\box\IDashboardBox::init()
+ */
+ public function init(DashboardBox $box, IPage $page) {
+ parent::init($box, $page);
+
+ // get current date
+ $currentDay = DateUtil::format(null, 'm-d');
+ $date = explode('-', DateUtil::format(null, 'Y-n-j'));
+
+ // get user ids
+ $userIDs = UserBirthdayCache::getInstance()->getBirthdays($date[1], $date[2]);
+ $userIDs = array_intersect($userIDs, WCF::getUserProfileHandler()->getFollowingUsers());
+
+ if (!empty($userIDs)) {
+ $userProfileList = new UserProfileList();
+ $userProfileList->setObjectIDs($userIDs);
+ $userProfileList->readObjects();
+ foreach ($userProfileList as $userProfile) {
+ if (!$userProfile->isProtected() && substr($userProfile->birthday, 5) == $currentDay) {
+ $this->userProfiles[] = $userProfile;
+ }
+ }
+ }
+
+ $this->fetched();
+ }
+
+ /**
+ * @see \wcf\system\dashboard\box\AbstractContentDashboardBox::render()
+ */
+ protected function render() {
+ if (empty($this->userProfiles)) {
+ return '';
+ }
+
+ WCF::getTPL()->assign(array(
+ 'birthdayUserProfiles' => $this->userProfiles
+ ));
+ return WCF::getTPL()->fetch('dashboardBoxTodaysFollowingBirthdays');
+ }
+}
--- /dev/null
+<?php
+namespace wcf\system\dashboard\box;
+use wcf\data\dashboard\box\DashboardBox;
+use wcf\data\user\online\UsersOnlineList;
+use wcf\page\IPage;
+use wcf\system\WCF;
+use wcf\system\request\LinkHandler;
+
+/**
+ * Lists all users who are online.
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2014 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.dashboard.box
+ * @category Community Framework
+ */
+class UsersOnlineSidebarDashboardBox extends AbstractSidebarDashboardBox {
+ /**
+ * users online list
+ * @var \wcf\data\user\online\UsersOnlineList
+ */
+ public $usersOnlineList = null;
+
+ /**
+ * @see \wcf\system\dashboard\box\IDashboardBox::init()
+ */
+ public function init(DashboardBox $box, IPage $page) {
+ parent::init($box, $page);
+
+ if (MODULE_USERS_ONLINE) {
+ $this->usersOnlineList = new UsersOnlineList();
+ $this->usersOnlineList->readStats();
+ $this->usersOnlineList->checkRecord();
+ $this->usersOnlineList->getConditionBuilder()->add('session.userID IS NOT NULL');
+ $this->usersOnlineList->readObjects();
+ }
+
+ $this->fetched();
+ }
+
+ /**
+ * @see \wcf\system\dashboard\box\AbstractContentDashboardBox::render()
+ */
+ protected function render() {
+ if (empty($this->usersOnlineList) || !count($this->usersOnlineList->getObjects())) {
+ return '';
+ }
+
+ $this->titleLink = LinkHandler::getInstance()->getLink('UsersOnlineList');
+ WCF::getTPL()->assign(array(
+ 'usersOnlineList' => $this->usersOnlineList
+ ));
+ return WCF::getTPL()->fetch('dashboardBoxUsersOnlineSidebar');
+ }
+}
display: block;
}
}
+
+ .userList > li > a {
+ font-size: @wcfSmallFontSize;
+ }
}
.framedIconList {
<item name="wcf.dashboard.box.com.woltlab.wcf.like.mostLikedMembers"><![CDATA[Mitglieder mit den meisten Likes]]></item>
<item name="wcf.dashboard.box.mostLikedMembers.likes"><![CDATA[{#$likedMember->likesReceived} Like{if $likedMember->likesReceived != 1}s{/if}]]></item>
<item name="wcf.dashboard.box.com.woltlab.wcf.user.todaysBirthdays"><![CDATA[Heutige Geburtstage]]></item>
+ <item name="wcf.dashboard.box.com.woltlab.wcf.user.todaysFollowingBirthdays"><![CDATA[Heutige Geburtstage von Nutzern, denen Sie folgen]]></item>
+ <item name="wcf.dashboard.box.com.woltlab.wcf.user.usersOnlineSidebar"><![CDATA[Benutzer online]]></item>
+ <item name="wcf.dashboard.box.com.woltlab.wcf.user.followingsOnlineSidebar"><![CDATA[Benutzer online, denen Sie folgen]]></item>
+ <item name="wcf.dashboard.box.com.woltlab.wcf.user.staffOnlineSidebar"><![CDATA[Team-Mitglieder online]]></item>
</category>
<category name="wcf.date">
<item name="wcf.dashboard.box.com.woltlab.wcf.like.mostLikedMembers"><![CDATA[Most Liked Members]]></item>
<item name="wcf.dashboard.box.mostLikedMembers.likes"><![CDATA[{#$likedMember->likesReceived} Like{if $likedMember->likesReceived != 1}s{/if}]]></item>
<item name="wcf.dashboard.box.com.woltlab.wcf.user.todaysBirthdays"><![CDATA[Today’s Birthdays]]></item>
+ <item name="wcf.dashboard.box.com.woltlab.wcf.user.todaysFollowingBirthdays"><![CDATA[TODO: Heutige Geburtstage von Nutzern, denen Sie folgen]]></item>
+ <item name="wcf.dashboard.box.com.woltlab.wcf.user.usersOnlineSidebar"><![CDATA[Users Online]]></item>
+ <item name="wcf.dashboard.box.com.woltlab.wcf.user.followingsOnlineSidebar"><![CDATA[TODO: Benutzer online, denen Sie folgen]]></item>
+ <item name="wcf.dashboard.box.com.woltlab.wcf.user.staffOnlineSidebar"><![CDATA[TODO: Team-Mitglieder online]]></item>
</category>
<category name="wcf.date">