public function __construct() { parent::__construct(); $user = Helper_Widget::getBestUser(); if ($user->loaded()) { $this->template->photos = $user->favorite_photos->limit(10)->order_by(DB::expr('RAND()'))->find_all(); $this->template->user = $user; } }
public function __construct() { parent::__construct(); $user = Helper_Widget::getBestUser(); $loggedInUser = Auth::instance()->get_user(); if ($user->loaded()) { $gameUser = Helper_Game::getUser($user->id); $this->template->following = $gameUser->following; if ($user->id === $loggedInUser->id) { $this->template->matchingUsers = true; $this->template->loggedInUser = new stdClass(); $this->template->loggedInUser->id = $loggedInUser->id; } } }
public function __construct() { $user = Helper_Widget::getBestUser(); $loggedInUser = false; if ($user->loaded()) { if (Auth::instance()->get_user()->id == $user->id) { $loggedInUser = true; $this->template = "widget/minute/myminute"; } parent::__construct(); if (!$loggedInUser) { $this->template->minutelink = null; $show = $user->slideshows->where("complete", "=", 1)->order_by("created", "DESC")->find(); if ($show->loaded()) { $this->template->minutelink = $show->getLink(); } } } else { parent::__construct(); } }