/** * @see \wcf\system\menu\user\profile\content\IUserProfileMenuContent::getContent() */ public function getContent($userID) { $likeList = new ViewableLikeList(); $likeList->getConditionBuilder()->add("like_table.objectUserID = ?", array($userID)); $likeList->getConditionBuilder()->add("like_table.likeValue = ?", array(Like::LIKE)); $likeList->readObjects(); WCF::getTPL()->assign(array('likeList' => $likeList, 'userID' => $userID, 'lastLikeTime' => $likeList->getLastLikeTime())); return WCF::getTPL()->fetch('userProfileLikes'); }
/** * Loads a list of likes. * * @return array */ public function load() { $likeList = new ViewableLikeList(); if ($this->parameters['lastLikeTime']) { $likeList->getConditionBuilder()->add("like_table.time < ?", array($this->parameters['lastLikeTime'])); } if ($this->parameters['likeType'] == 'received') { $likeList->getConditionBuilder()->add("like_table.objectUserID = ?", array($this->parameters['userID'])); } else { $likeList->getConditionBuilder()->add("like_table.userID = ?", array($this->parameters['userID'])); } $likeList->getConditionBuilder()->add("like_table.likeValue = ?", array($this->parameters['likeValue'])); $likeList->readObjects(); if (!count($likeList)) { return array(); } // parse template WCF::getTPL()->assign(array('likeList' => $likeList)); return array('lastLikeTime' => $likeList->getLastLikeTime(), 'template' => WCF::getTPL()->fetch('userProfileLikeItem')); }