A pouco tempo um cliente precisava colocar suas noticias no portal TERRA via FEED mas o formato que o Joomla utiliza não servia.
Fiz esse script para resolver de uma forma simples essa questão, espero que gostem!!

A short time ago a client needed to put his news on the TERRA portal via FEED but the format that Joomla uses was not useful.
I made this script to solve this question in a simple way, I hope you like it!!

Para o script funcionar conectando com o seu Joomla, acrescenta essas primeiras linhas:
For the script to work connecting with your Joomla, add these first lines:
define( '_JEXEC', 1 );
// Coloque o caminho fisico da sua instalação
define('JPATH_BASE', '/public_html/');
require_once ( JPATH_BASE .'/includes/defines.php' );
require_once ( JPATH_BASE .'/includes/framework.php' );
$app = JFactory::getApplication('site');

Adeque a consulta de acordo com suas necessidades
Tailor the consultation to your needs

/Fazendo consulta
$db = JFactory::getDBO();
$sql="SELECT *, `#__content`.`id` AS INDICE, `#__categories`.title AS CATEGORIA,`#__categories`.`alias` AS CALIAS, `#__users`.name AS AUTOR,`#__content`.`alias` AS COLIAS,
`#__content`.`introtext` AS SUBTITULO, `#__content`.`title` AS TITULO FROM `#__content`
INNER JOIN `#__categories` ON `#__categories`.`id` = `#__content`.`catid`
INNER JOIN `#__users` ON `#__content`.`created_by` = `#__users`.`id`
INNER JOIN `#__fields_values` ON `#__fields_values`.`item_id` =`#__content`.`id`
INNER JOIN `#__fields` ON `#__fields`.id = `#__fields_values`.field_id
WHERE `#__content`.`state`=1 ORDER BY `#__content`.`id` DESC limit 0,20";
$db->setQuery($sql);
$r = $db->loadObjectList();

E para finalizar a configuração, coloque o endereço do seu site no local indicado
to finish the configuration, put your website address in the indicated place


// ENDEREÇO DO SITE
$base_url = "https://seusiteaqui.com/feed.php";
echo "" . PHP_EOL;

FEED

FREE DOWNLOAD

Send download link to: