| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Old Sites/eadsa/modules/mod_db8latestweblinks/ |
Upload File : |
<?php
/**
* @version $Id: helper.php 0003 2010-03-03 10:30:00Z pe7er $
* @copyright Copyright 2010 by Peter Martin / db8.nl. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
/**
* db8 Latest Weblinks Module Helper
*
* @static
*/
class modDB8LatestWeblinksHelper
{
/**
* Gets a list of latest added Weblinks
*
* @param JParameter Module parameters
* @return mixed Array of items, false on failure
*/
function &getItems(&$params)
{
$count = intval( $params->def( 'count', 5 ) );
$catid = trim( $params->get( 'catid' ) );
$show_unpublished = abs($params->def('show_unpublished', 0));
if ($show_unpublished) {
$user = &JFactory::getUser();
if ( $user->get('gid') < 20 ){ return array(); }
$querypublished = ' AND ( a.published = 0 OR a.approved = 0 )'; // if unpublished, return
}else{
$querypublished = ' AND ( a.published = 1 AND a.approved = 1 )';
}
$db =& JFactory::getDBO();
$query = 'SELECT a.id, a.title, a.url, a.description, a.catid' .
' FROM #__weblinks AS a' .
' LEFT JOIN #__categories AS cc ON cc.id = a.catid' .
' WHERE cc.published = 1' .
$querypublished .
( $catid ? "\n AND ( a.catid IN ( $catid ) )" : '' ).
' ORDER BY a.date DESC'
;
$db->setQuery($query,0,$count);
$list = $db->loadObjectList();
return $list;
}
}