* @license	GNU/GPL, see LICENSE.php
 *
 * Zonales 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.
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
// helper ContentHelperRoute
require_once JPATH_BASE . DS . 'components' . DS . 'com_content' . DS . 'helpers' . DS . 'route.php';
// helper zonales
require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_eqzonales' . DS . 'helper' . DS . 'contenthelper.php';
// lista de zonales, zonal actualmente seleccionado
$helper = new comEqZonalesContentHelper();
/*
 * Ejecuto una búsqueda Solr de los artículos publicados como soy corresponsal.
*/
$limit = 100;
$results = array();
try {
    $results = $helper->getContent(0, $limit, array("tags_values:la_voz_del_vecino"));
} catch (Exception $e) {
    print_r($e->getMessage());
}
$articles = array();
$moreArticles = array();
$cantArticles = 0;
// display results
if ($results) {
 /**
  * Method to load content item data for items in the category if they don't
  * exist.
  *
  * @access	private
  * @return	boolean	True on success
  */
 function _loadData($state = 1)
 {
     if (empty($this->_user)) {
         return false;
         // TODO: set error -- can't get siblings when we don't know the category
     }
     // Lets load the siblings if they don't already exist
     if (empty($this->_content[$state])) {
         $getDenounced = JRequest::getVar('getDenounced') != null ? JRequest::getInt('getDenounced') : false;
         require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_eqzonales' . DS . 'helper' . DS . 'contenthelper.php';
         $contenthelper = new comEqZonalesContentHelper();
         // Get the pagination request variables
         $limit = JRequest::getVar('limit', 100, '', 'int');
         $limitstart = JRequest::getVar('limitstart', 0, '', 'int');
         $Arows = $contenthelper->getContent($limitstart, $limit, array(!$getDenounced ? '!tags_values:la_voz_del_vecino' : "denuncias:[1 TO *]", $this->_user->get('gid') < $this->_publishing_group ? "created_by:" . $this->_user->get('id') : ""));
         // special handling required as Uncategorized content does not have a section / category id linkage
         $i = $limitstart;
         $rows = array();
         foreach ($Arows as $row) {
             //$row->slug = strlen($row->alias) ? "$row->id:$row->alias" : $row->id;
             //$row->catslug = strlen($row->catalias) ? "$row->catid:$row->catalias" : $row->catid;
             // check to determine if section or category has proper access rights
             $rows[$i] = $row;
             $i++;
         }
         $this->_data[$state] = $rows;
     }
     return true;
 }
 /**
  * Method to load content item data for items in the category if they don't
  * exist.
  *
  * @access	private
  * @return	boolean	True on success
  */
 function _loadData($state = 1)
 {
     if (empty($this->_category)) {
         return false;
         // TODO: set error -- can't get siblings when we don't know the category
     }
     // Lets load the siblings if they don't already exist
     if (empty($this->_content[$state])) {
         // Get the pagination request variables
         $limit = JRequest::getVar('limit', 0, '', 'int');
         $limitstart = JRequest::getVar('limitstart', 0, '', 'int');
         //$query = $this->_buildQuery();
         //$Arows = $this->_getList($query, $limitstart, $limit);
         // Resultados desde Solr
         require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_eqzonales' . DS . 'helper' . DS . 'contenthelper.php';
         $contenthelper = new comEqZonalesContentHelper();
         $params = array();
         $menu = JRequest::getString('banda', NULL, 'get');
         if ($menu) {
             $params[] = "tags_values:{$menu}";
         }
         $params[] = "!tags_values:la_voz_del_vecino";
         $Arows = $contenthelper->getContentArray($limitstart, $limit, $params);
         // special handling required as Uncategorized content does not have a section / category id linkage
         $i = $limitstart;
         $rows = array();
         foreach ($Arows as $row) {
             //$row->slug = strlen($row->alias) ? "$row->id:$row->alias" : $row->id;
             //$row->catslug = $row->catid;
             // check to determine if section or category has proper access rights
             $rows[$i] = $row;
             $i++;
         }
         $this->_data[$state] = $rows;
     }
     return true;
 }