Hello,
I would love a little help.
Iv managed to make my premium ads show randomly, by modifying some core files of osclass Search , and changing the search, and using this steps.
• Find "getPremiums($max = 2)" and replace it with "getPremiums($max = 2, $random = false)".
• Find "$this->_makeSQLPremium($max)" and replace it with "$this->_makeSQLPremium($max, $random)".
• Find "_makeSQLPremium($num = 2)" and replace it with "_makeSQLPremium($num = 2, $random)".
• Find "$this->dao->orderBy(sprintf('SUM(%st_item_stats.i_num_premium_views)', DB_TABLE_PREFIX), 'ASC');" and replace it with
if(!$random) {
$this->dao->orderBy(sprintf('SUM(%st_item_stats.i_num_premium_views)', DB_TABLE_PREFIX), 'ASC');
}
And on search.gallery
<?php osc_get_premiums(del_param('premium_home_count'), true); ?>
However, i'm using another mods, to only show specific ads from specific categories, by using this
<?php
$search_cat_id = osc_search_category_id();
$search_cat_id = isset($search_cat_id[0]) ? $search_cat_id[0] : '';
View::newInstance()->_exportVariableToView('premiums', del_premium_items(del_param('premium_home_count' ), $search_cat_id));
?>
Now.. if i comment the "custom" display , my random will work, but showing ads that are not suposed to be shown.
Here i'm lost.... can i have a bit of help, to randomly display them, without the ads i don't want ? ( based on the new View instance )