Is there a simple way for me to by default have all new items featured? I know it's against the premise behind the "feature" feature, but I use it with the XenPorta block on the homepage which randomly displays a selection of featured vehicles.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
/**
* Construct 'ORDER BY' clause
*
* @param array $fetchOptions (uses 'order' key)
* @param string $defaultOrderSql Default order SQL
*
* @return string
*/
public function prepareItemOrderOptions(array &$fetchOptions, $defaultOrderSql = '')
{
$choices = array(
'recent' => 'item.date_added',
'rated' => 'item.rating_avg %s, item.rating_count DESC, item.likes DESC, item.view_count DESC',
'reviewed' => 'item.review_count %s, item.rating_avg DESC, item.likes DESC, item.view_count DESC',
'popular' => 'item.view_count %s, item.rating_avg DESC',
'liked' => 'item.likes %s, item.rating_avg DESC, item.view_count DESC',
'updated' => 'item.last_update',
'featured' => 'rand() %s, item.last_update DESC',
'atoz' => 'item.item_name',
'random' => 'rand()',
);
return $this->getOrderByClause($choices, $fetchOptions, $defaultOrderSql);
}
$conditions = array(
'category_id' => $catIds,
'image' => ($imageRequired == 1) ? true : false,
'featured' => true
);
if ($featuredItems = $scItemModel->getItems($conditions, array(
'join' => NFLJ_Showcase_Model_Item::FETCH_CATEGORY
| NFLJ_Showcase_Model_Item::FETCH_USER,
'limit' => $options['scFI_numItems'],
'order' => 'featured',
'direction' => 'DESC')))
{
UPDATE `xf_nflj_showcase_item`
SET featured=0
'featured' => ($options['scI_sortOrder'] == 'featured') ? false : false,
'order' => $options['scI_sortOrder'],
'order' =>'random',