Featured

Hello,

There is a code that outputs the Featured files.

Files are arranged by date of uploading them to the site.

Please tell me, how they can be put on your site, how to place them in the right sequence to me, for example 1,2,3,4

but not by date.

 

Featured sounds filter in numerical order 1,2,3,4 how to do it?

 

require_once(BX_DIRECTORY_PATH_MODULES . 'boonex/sounds/classes/BxSoundsSearch.php');

$this->oSearch = new BxSoundsSearch();

$this->oSearch->aCurrent['restriction']['featured'] = array(

            'field' => 'Featured',

            'value' => '',

            'operator' => '=',

            'paramName' => 'featured'

        );

    $this->oSearch->aConstants['linksTempl']['featured'] = 'browse/featured';

        $aCustom = array(

        'per_page' => '8',

        'menu_bottom_type' => 'featured'

 

    );

        $aCode = $this->oSearch->getBrowseBlock(array('featured' => 1, 'allow_view' => $this->aVisible), $aCustom);

    if ($this->oSearch->aCurrent['paginate']['totalNum'] > 0)

return array($aCode['code'], $aCode['menu_top'], $aCode['menu_bottom'], '');

Untitled-1.jpg · 134.8K · 173 views
Quote · 12 Sep 2016

please, help

Quote · 16 Sep 2016

You might be able to use "order" here...  not sure though, not sure on exactly you want to do either.

 

'order' => " `ID` ASC ",  

 

Place this under "field featured" and see what happens. Not sure if the order operator will work here. 

 

Sorting by ID example...  you can pick what you want to sort by  id date time views .... 

https://dolphin-techs.com - Skype: Dolphin Techs
Quote · 16 Sep 2016

Thanks for the help!

'order' => " `ID` ASC ",    - did not help

obtained filter by date.

I created in database RayMp3Files column "number"  set the value in this column for files 1,2,3,4 ...

edit 'order' => " `ID` ASC ",  to 'order' => " `number` ASC ", 

did not help Frown


Are there any other options?

Quote · 18 Sep 2016

Try to modify modules/boonex/sounds/classes/BxSoundsSearch.php file:

            ...

            case 'featured':
                $this->aCurrent['restriction']['featured'] = array(
                    'value'=>'1', 'field'=>'Featured', 'operator'=>'=', 'paramName'=>'bx_sounds_mode'
                );
                $this->aCurrent['sorting'] = 'custom';
                break;

            ...


    function getAlterOrder()
    {
        $aSql = array();
        switch ($this->aCurrent['sorting']) {
            case 'popular':
                $aSql['order'] = " ORDER BY `Listens` DESC";
                break;

            case 'album_order':
                $aSql['order'] = " ORDER BY `obj_order` ASC, `id_object` DESC";
                break;

            case 'custom':
                $aSql['order'] = " ORDER BY `number` ASC, `id_object` DESC";
                break;


            default:
                $aSql = parent::getAlterOrder();
        }
        return $aSql;
    }


 

Rules → http://www.boonex.com/terms
Quote · 24 Sep 2016
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.