y
*/
function getData()
{
// Lets load the content if it doesn't already exist
if (empty($this->_data))
{
$query = $this->_buildQuery();
$this->_data = $this->_getList($query);
}
return $this->_data;
}
/**
* Method to get the total number of weblink items for the category
*
* @access public
* @return integer
*/
function getTotal()
{
// Lets load the content if it doesn't already exist
if (empty($this->_total))
{
$query = $this->_buildQuery();
$this->_total = $this->_getListCount($query);
}
return $this->_total;
}
function _buildQuery()
{
$user =& JFactory::getUser();
$aid = $user->get('aid', 0);
//Query to retrieve all categories that belong under the web links section and that are published.
$query = 'SELECT cc.*, COUNT(a.id) AS numlinks,'
.' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(\':\', cc.id, cc.alias) ELSE cc.id END as slug'
.' FROM #__categories AS cc'
.' LEFT JOIN #__weblinks AS a ON a.catid = cc.id'
.' WHERE a.published = 1'
.' AND section = \'com_weblinks\''
.' AND cc.published = 1'
.' AND cc.access <= '.(int) $aid
.' GROUP BY cc.id'
.' ORDER BY cc.ordering';
return $query;
}
}
?>
Weblinks
|
We are regularly out on the Web. When we find a great site we list it. |