/**
  * @see	\wcf\system\dashboard\box\IDashboardBox::init()
  */
 public function init(DashboardBox $box, IPage $page)
 {
     parent::init($box, $page);
     //visitors of the last 604800 sec = 1 week
     $this->visits = VisitCountHandler::getInstance()->getVisitors(TIME_NOW - 604800, TIME_NOW);
     $this->fetched();
 }
 /**
  * @see	\wcf\system\dashboard\box\IDashboardBox::init()
  */
 public function init(DashboardBox $box, IPage $page)
 {
     parent::init($box, $page);
     if (WCF::getUser()->userID && MODULE_PAID_SUBSCRIPTION) {
         // get available subscriptions
         $this->subscriptions = PaidSubscriptionCacheBuilder::getInstance()->getData();
         // get purchased subscriptions
         $userSubscriptionList = new PaidSubscriptionUserList();
         $userSubscriptionList->getConditionBuilder()->add('userID = ?', array(WCF::getUser()->userID));
         $userSubscriptionList->getConditionBuilder()->add('isActive = ?', array(1));
         $userSubscriptionList->readObjects();
         // remove purchased subscriptions
         foreach ($userSubscriptionList as $userSubscription) {
             if (isset($this->subscriptions[$userSubscription->subscriptionID])) {
                 $userSubscription->setSubscription($this->subscriptions[$userSubscription->subscriptionID]);
                 unset($this->subscriptions[$userSubscription->subscriptionID]);
             }
         }
         // remove excluded subscriptions
         foreach ($userSubscriptionList as $userSubscription) {
             if ($userSubscription->getSubscription()->excludedSubscriptionIDs) {
                 foreach (explode(',', $userSubscription->getSubscription()->excludedSubscriptionIDs) as $subscriptionID) {
                     if (isset($this->subscriptions[$subscriptionID])) {
                         unset($this->subscriptions[$subscriptionID]);
                     }
                 }
             }
         }
     }
     $this->fetched();
 }
 /**
  * @see	\wcf\system\dashboard\box\IDashboardBox::init()
  */
 public function init(DashboardBox $box, IPage $page)
 {
     parent::init($box, $page);
     $this->entryList = new AccessibleEntryList();
     $this->entryList->getConditionBuilder()->add("news_entry.isArchived = ?", array(0));
     $this->entryList->sqlLimit = CMS_DASHBOARD_LATEST_NEWSENTRIES;
     $this->entryList->readObjects();
     $this->fetched();
 }
 /**
  * @see	\wcf\system\dashboard\box\IDashboardBox::init()
  */
 public function init(DashboardBox $box, IPage $page)
 {
     parent::init($box, $page);
     $this->vooliaNewsList = new AccessibleNewsList();
     $this->vooliaNewsList->getConditionBuilder()->add("news.isHot = ?", array(1));
     $this->vooliaNewsList->getConditionBuilder()->add("news.isArchived = ?", array(0));
     $this->vooliaNewsList->sqlLimit = NEWS_DASHBOARD_HOTNEWS_ENTRIES;
     $this->vooliaNewsList->readObjects();
     $this->fetched();
 }
 /**
  * @see	\wcf\system\dashboard\box\IDashboardBox::init()
  */
 public function init(DashboardBox $box, IPage $page)
 {
     parent::init($box, $page);
     if (WCF::getUser()->userID && count(WCF::getUserProfileHandler()->getFollowingUsers())) {
         $this->canFilterByFollowedUsers = true;
     }
     $this->eventList = new ViewableUserActivityEventList();
     if ($this->canFilterByFollowedUsers && WCF::getUser()->recentActivitiesFilterByFollowing) {
         $this->filteredByFollowedUsers = true;
         $this->eventList->getConditionBuilder()->add('user_activity_event.userID IN (?)', array(WCF::getUserProfileHandler()->getFollowingUsers()));
     }
     $this->eventList->sqlLimit = RECENT_ACTIVITY_ITEMS;
     $this->eventList->readObjects();
     $this->lastEventTime = $this->eventList->getLastEventTime();
     // removes orphaned and non-accessable events
     UserActivityEventHandler::validateEvents($this->eventList);
     $this->fetched();
 }