Osclass forums

Support forums => Themes => Real Estate => Topic started by: maggiau on June 06, 2014, 02:06:27 pm

Title: [resolved] the random display of the premium listings windows
Post by: maggiau on June 06, 2014, 02:06:27 pm
in hPremium.php :
define the function like this :

 function osc_get_premiums($max = 2, $shuffle = false) {
        if (View::newInstance()->_exists('search')) {
            $mSearch = View::newInstance()->_get('search');
        } else {
            $mSearch = Search::newInstance();
            View::newInstance()->_exportVariableToView('search', $mSearch);
        }

        // juanramon: it should be fixed, little hack to get alerts work in search layout
        $mSearch->reconnect();
        $premiums = $mSearch->getPremiums($max);
if($shuffle){
    shuffle($premiums);
}
        View::newInstance()->_exportVariableToView('premiums', $premiums);

      return $premiums;

    }

in main.php
you need this :
<?php osc_get_premiums($max=20,true); ?>


I hope this will help you guys.

CHECK RESULT HERE : http://pa.strategies.ch (http://pa.strategies.ch)

Regards
A+lessandro
Title: Re: [resolved] the random display of the premium listings windows
Post by: elod on June 06, 2014, 10:07:28 pm
where to find hPremium.php ??? i m using moder theme...
Title: Re: [resolved] the random display of the premium listings windows
Post by: design on June 06, 2014, 10:42:38 pm
hpremium is in core


oc-includes/osclass/helpers/
Title: Re: [resolved] the random display of the premium listings windows
Post by: maggiau on June 07, 2014, 04:11:20 pm
hpremium is in core


oc-includes/osclass/helpers/

yes sorry , I forget to precise it

:-)
Title: Re: [resolved] the random display of the premium listings windows
Post by: dollar4all on November 15, 2014, 01:39:22 pm
thank you..  ;D