pickles/common/modules/store/home.php
Josh Sherman c6af785100 Latest and greatest.
git-svn-id: http://svn.cleancode.org/svn/pickles@85 4d10bc64-7434-11dc-a737-d2d0f8310089
2008-12-31 02:45:40 +00:00

25 lines
735 B
PHP

<?php
class store_home extends store {
protected $display = DISPLAY_SMARTY;
public function __construct(Config $config, DB $db, Mailer $mailer, Error $error) {
parent::__construct($config, $db, $mailer, $error);
}
public function __default() {
$featured = $this->db->getRow('SELECT id, name, teaser FROM products WHERE featured = "Y" AND id = 30 ORDER BY RAND() LIMIT 1;');
foreach (array('gif', 'jpg', 'png') as $extension) {
if (file_exists(getcwd() . '/images/products/' . $featured['id'] . '/medium.' . $extension)) {
$featured['image'] = $extension;
}
}
$this->featured = $featured;
$this->top_sellers = $this->db->getArray('SELECT id, name FROM products ORDER BY RAND() LIMIT 10;');
}
}
?>