*

Pai Vo

  • **
  • 5 posts
Hi - I saw a topic here on the forum about displaying ads by category
I put it on my website's home page and I liked it.
But every time I access the website, it only shows the same ads
from the same store.

How can I add randomization to these ads?
-------------
1) get listings into memory:

<?php
   osc_query_item(array(
    "category" => "4"   
  ));
?>
------------
2) show listings:

<?php
while(osc_has_custom_items()) {
  echo osc_item_id();
}
?>
===============
This is mine and it worked but the code doesn't do random

 <?php osc_query_item(array("category" => "3", "results_per_page" => "4")); ?>
 <?php View::newInstance()->_exportVariableToView('', veronika_random_items()); ?>
       <?php if( osc_count_custom_items() > 0) { ?>
            <div class="wrap" style="margin:-30px 0 -20px 0;">
              <?php $c = 1; ?>
             <?php while( osc_has_custom_items() ) { ?>
                <?php veronika_draw_item($c, 'gallery'); ?>

*

MB Themes

https://docs.osclass-classifieds.com/query-items-custom-listings-select-i86

Code: [Select]
<?php
   osc_query_item
(array(
    
"category" => 4,
    
"order" => "RAND()"
  
));
?>

This might work until there is filter that check if RAND() is allowed.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Pai Vo

  • **
  • 5 posts
Oh my god. Thank you so much. I want to kiss you. lol