Exemple #1
0
 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;
     }
 }
Exemple #2
0
 public function __construct()
 {
     parent::__construct();
     $editorial = Model_Editorial::getRandom();
     $this->template->title = $editorial->title;
     $this->template->image = HTML::image($editorial->image, array('alt' => $editorial->image_alt));
     $this->template->text = $editorial->text;
     $this->template->link = HTML::anchor($editorial->link, $editorial->link_text);
 }
Exemple #3
0
 public function __construct()
 {
     parent::__construct();
     $modules = array(array('title' => 'Adorable Cats', 'text' => 'These felines seem to enjoy posing for pictures!', 'image' => HTML::image('public/images/graphics/editorial_modules/calico-cat.jpg', array('alt' => 'Cat')), 'link' => HTML::anchor('http://kids.nationalgeographic.com/kids/photos/gallery/cats/', 'See More Photos')), array('title' => 'Fall Scenes', 'text' => 'Pumpkins brighten up the fall!', 'image' => HTML::image('public/images/graphics/editorial_modules/pumpkins.jpg', array('alt' => 'Pumpkins')), 'link' => HTML::anchor('http://kids.nationalgeographic.com/kids/photos/gallery/fall-scenes/', 'Look at Photos!')), array('title' => 'Gecko Puzzler', 'text' => 'Put together jigsaw puzzles.', 'image' => HTML::image('public/images/graphics/editorial_modules/blue-orange-tokay-gecko.jpg', array('alt' => 'Gecko eye')), 'link' => HTML::anchor('http://kids.nationalgeographic.com/kids/games/puzzlesquizzes/geckos-puzzler/', 'Check It Out!')), array('title' => 'Snowflakes Puzzler', 'text' => 'Solve snowflake slider puzzles.', 'image' => HTML::image('public/images/graphics/editorial_modules/snowflake.jpg', array('alt' => 'Snowflake')), 'link' => HTML::anchor('http://kids.nationalgeographic.com/kids/games/puzzlesquizzes/snowflakes-puzzler/', 'Try Now!')));
     $item = $modules[array_rand($modules)];
     $this->template->title = $item['title'];
     $this->template->image = $item['image'];
     $this->template->text = $item['text'];
     $this->template->link = $item['link'];
 }
Exemple #4
0
 public function __construct()
 {
     parent::__construct();
     $watcher = Model_WatchPhotographer::getCurrentWatch();
     if (!empty($watcher)) {
         $photo = $watcher->user->photos->where("moderation_status_id", "=", Model_ModerationStatus::APPROVED)->order_by(DB::expr('RAND()'))->find();
         $this->template->watcher = $watcher;
         $this->template->photo = $photo;
         $this->template->numPhotos = $watcher->user->photos->where("moderation_status_id", "=", Model_ModerationStatus::APPROVED)->find_all()->count();
     }
 }
Exemple #5
0
 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;
         }
     }
 }
Exemple #6
0
 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();
     }
 }
Exemple #7
0
 public function __construct()
 {
     parent::__construct();
     $this->template->user = Auth::instance()->get_user();
 }
Exemple #8
0
 public function __construct()
 {
     parent::__construct();
     $this->template = View::factory($this->determine_status());
     $this->template->user = Auth::instance()->get_user();
 }
Exemple #9
0
 public function __construct()
 {
     parent::__construct();
     $this->template->categories = ORM::factory('category')->find_all();
 }