Привет, всем!
Есть Mambo 1.0.9, почти первая Joomla.
Хочу вывести последние 6 публикация контента в модуле mod_latestnews.php.
В модуле нет запроса к базе для id меню, поэтому ссылка имеет id контента, но не имеет в конце id меню, что делает ссылку неполной.
В итоге ссылка выглядит так: _https://site.ru/content/view/446/
а должна выглядеть так: _https://site.ru/content/view/446/25/
Код модуля:
<?php
	// $Id: mod_latestnews.php,v 1.16 2004/04/07 11:56:03 rcastley Exp $
	/**
		* Latest News Module
		* @package Mambo Open Source
		* [member=126442]copyright[/member] (C) 2000 - 2003 Miro International Pty Ltd
		* @ All rights reserved
		* @ Mambo Open Source is Free Software
		* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
		* @version $Revision: 1.16 $
	**/
	
	defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
	
	global  $Itemid, $mosConfig_offset;
	
	$count = @$params->count ? intval( $params->count ) : 6;
	$catid = @$params->catid ? intval( $params->catid ) : 0;
	
	$now = date( "Y-m-d H:i:s", time()+$mosConfig_offset*60*60 );
	
	// set up the query, the '#__' is converted into the table prefix
	// set all content items:
	// - not on the front page :: mask=0
	// - pubslished :: state=1
	// - checked out :: checked_out = 0
	// - not in a menu :: sectionid > 0
	// - between the publish_up and publish_down dates
	// the the whole menu array and index the array by the id
	// get the home page
	
	$query = "SELECT f.content_id, a.id, a.title, a.sectionid, a.catid"
	. "\nFROM #__content AS a"
	. "\nLEFT JOIN #__content_frontpage AS f ON f.content_id = a.id"
	. "\nWHERE (f.content_id IS NULL AND a.state='1' AND a.checked_out='0' AND a.sectionid > '0')"
	. "\n	AND (a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '$now')"
	. "\n	AND (a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '$now')"
	. ($catid ? "\n	AND a.catid='$catid'" : '')
	. "\nORDER BY a.created DESC LIMIT $count";
	// initialise the query in the $database connector
	// this translates the '#__' prefix into the real database prefix
	
	$database->setQuery( $query );
	
	// retrieve the list of returned records as an array of objects
	
	$rows = $database->loadObjectList();
	
	// cycle through the returned rows displaying them in a table
	// with links to the content item
	// escaping in and out of php is now permitted
		
?>
<?php foreach ($rows as $row) { 
	
	?>
	
	<a href="<?php echo sefRelToAbs("index.php?option=content&task=view&id=$row->id"); ?>" class="m-06-press-entry-link">
		<?php echo $row->title ?>
	</a>
	
	<?php
	}
	?>
	
		
Я попытался добавить запрос к базе и извлечь из таблицы #__menu id меню, но не получилось, модуль не выводится, неправильный запрос.
Можете помочь?