Esempio n. 1
0
 /**
  * get ids from ads in the order they should be displayed
  *
  * @param arr $ordered_ad_ids ad ids in the order from the main plugin
  * @param str $type group type
  * @param arr $ads array with ad objects
  * @param arr $weights array with ad weights
  * @param arr $group Advanced_Ads_Group Object
  * @return arr $ad_ids
  */
 public function output_ad_ids($ordered_ad_ids, $type, $ads, $weights, Advanced_Ads_Group $group)
 {
     // return order by weights if this is a slider
     if ($type === 'slider') {
         if (isset($group->options['slider']['random'])) {
             return $group->shuffle_ads($ads, $weights);
         } else {
             return array_keys($weights);
         }
     }
     // return default
     return $ordered_ad_ids;
 }