Advertisement:

Author Topic: [resolved] the random display of the premium listings windows  (Read 2110 times)

maggiau

  • Newbie
  • *
  • Posts: 10
  • Hello - Salut - Ciao - Tschuess
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

Regards
A+lessandro
« Last Edit: June 06, 2014, 02:09:03 pm by maggiau »

elod

  • Jr. Member
  • **
  • Posts: 51
Re: [resolved] the random display of the premium listings windows
« Reply #1 on: June 06, 2014, 10:07:28 pm »
where to find hPremium.php ??? i m using moder theme...

design

  • Hero Member
  • *****
  • Posts: 2619
  • Osclass 3.5 MAC/PC w/ Modern Browsers
Re: [resolved] the random display of the premium listings windows
« Reply #2 on: June 06, 2014, 10:42:38 pm »
hpremium is in core


oc-includes/osclass/helpers/

maggiau

  • Newbie
  • *
  • Posts: 10
  • Hello - Salut - Ciao - Tschuess
Re: [resolved] the random display of the premium listings windows
« Reply #3 on: June 07, 2014, 04:11:20 pm »
hpremium is in core


oc-includes/osclass/helpers/

yes sorry , I forget to precise it

:-)

dollar4all

  • Newbie
  • *
  • Posts: 18
Re: [resolved] the random display of the premium listings windows
« Reply #4 on: November 15, 2014, 01:39:22 pm »
thank you..  ;D