-
Notifications
You must be signed in to change notification settings - Fork 0
/
helper.php
35 lines (28 loc) · 959 Bytes
/
helper.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php defined('_JEXEC') or die('Restricted access');
/**
* @version mod_basicmodule v1.0
* @author usantisteban <[email protected]>
* @copyright Copyright (C) 2008 - 2015 Sayga Informatica
* @license http:https://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
* @since 2.0
*/
class modSponsorScrollerHelper
{
public static function getSponsors($params)
{
$type = $params->get('type');
$fido = $params->get('fido');
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('alias, name, url, banner' . $type . ' AS banner');
$query->from($db->quoteName('#__sponsors_profile'));
$query->where($db->quoteName('state') . '= 1');
if ($fido == 1) {
$query->where($db->quoteName('fido') . ' = 1');
}
$query->order('rand()');
$db->setQuery($query);
$result = $db->loadObjectList();
return $result;
}
}