- md5
- c599bb94a62ae3bde09386ca3a8b798b
- sha1
- 5f7a609a4d6de61dcce804918a0fcd8eb1774494
- sha256
- 94586828a6fa8d46663c4247c28f3940f8c1951a6a5a9a987b5de747446739ed
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
<?php
/**
* @version $Id: view.feed.php 14401 2010-01-26 14:10:00Z louis $
* @package Joomla
* @subpackage Contact
* @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant to the
* GNU General Public License, and as distributed it includes or is derivative
* of works licensed under the GNU General Public License or other free or open
* source software licenses. See COPYRIGHT.php for copyright notices and
* details.
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die( 'Restricted access' );
jimport('joomla.application.component.view');
/**
* @pacakge Joomla
* @subpackage Contacts
*/
class ContactViewCategory extends JView
{
function display()
{
global $mainframe;
$db =& JFactory::getDBO();
$document =& JFactory::getDocument();
$document->link = JRoute::_('index.php?option=com_contact&view=category&catid='.JRequest::getVar('catid',null, '', 'int'));
$siteEmail = $mainframe->getCfg('mailfrom');
$fromName = $mainframe->getCfg('fromname');
$document->editor = $fromName;
$document->editorEmail = $siteEmail;
$limit = JRequest::getVar('limit', $mainframe->getCfg('feed_limit'), '', 'int');
$limitstart = JRequest::getVar('limitstart', 0, '', 'int');
$catid = JRequest::getVar('catid', 0, '', 'int');
$where = ' WHERE a.published = 1';
if ( $catid ) {
$where .= ' AND a.catid = '. (int) $catid;
}
$query = 'SELECT'
. ' a.name AS title,'
. ' CONCAT( a.con_position, \' - \', a.misc ) AS description,'
. ' "" AS date,'
. ' c.title AS category,'
. ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'
. ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as catslug'
. ' FROM #__contact_details AS a'
. ' LEFT JOIN #__categories AS c ON c.id = a.catid'
. $where
. ' ORDER BY a.catid, a.ordering'
;
$db->setQuery( $query, 0, $limit );
$rows = $db->loadObjectList();
foreach ( $rows as $row )
{
// strip html from feed item title
$title = $this->escape( $row->title );
$title = html_entity_decode( $title );
// url link to article
$link = JRoute::_('index.php?option=com_contact&view=contact&id='. $row->slug .'&catid='.$row->catslug );
// strip html from feed item description text
$description = $row->description;
$date = ( $row->date ? date( 'r', strtotime($row->date) ) : '' );
// load individual item creator class
$item = new JFeedItem();
$item->title = $title;
$item->link = $link;
$item->description = $description;
$item->date = $date;
$item->category = $row->category;
// loads item info into rss array
$document->addItem( $item );
}
}
}
The same content is in 11 releases, Joomla 1.5.16 to 1.5.26. See them all, or every version of this file.