*

Miller

  • ****
  • 141 posts
Premium ads block
« on: September 08, 2018, 07:10:11 PM »
Hello sir
How to show ads random in premium block ?

Found a solution but not working in premium block

<?php
function cust_all_premiums_ontop_random() {
    $mSearch =  Search::newInstance();
    $query_elements = (array) json_decode($mSearch->toJson());

    $mSearch->addField(sprintf("(SELECT RAND() FROM %st_item i2 WHERE %st_item.pk_i_id = i2.pk_i_id AND %st_item.b_premium = 1) AS rand_premiums",  DB_TABLE_PREFIX, DB_TABLE_PREFIX, DB_TABLE_PREFIX));
    $mSearch->order("rand_premiums DESC, " . $query_elements['order_column'], $query_elements['order_direction']);
}

osc_add_hook('search_conditions', 'cust_all_premiums_ontop_random');
?>

*

MB Themes

Re: Premium ads block
« Reply #1 on: September 10, 2018, 08:05:21 AM »
@Miller
It does not look it should work...
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Miller

  • ****
  • 141 posts
Re: Premium ads block
« Reply #2 on: September 10, 2018, 10:50:28 AM »
@mbthemes

Please help me

*

MB Themes

Re: Premium ads block
« Reply #3 on: September 10, 2018, 10:58:32 AM »
@Miller
I do not think there is possibility to have impact on premium loop. What you modify is classic search.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Miller

  • ****
  • 141 posts
Re: Premium ads block
« Reply #4 on: September 10, 2018, 04:10:49 PM »
@mbthemes

I want work premium block only but working 2nd area

http://prntscr.com/ksqej4

*

Miller

  • ****
  • 141 posts
Re: Premium ads block
« Reply #5 on: September 11, 2018, 10:17:36 AM »
@mbthemes
Please help me