<?php
// $Id: mod_sections.php,v 1.11 2004/04/07 11:56:03 rcastley Exp $
/**
* Section Listing Module
* @package Mambo Open Source
* @Copyright (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.11 $
**/

/**
* Sections Module
*
*/

// following line is to prevent direct access to this script via the url
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

$count = @$params->count ? intval( $params->count ) : 50;
$access = !$mainframe->getCfg( 'shownoauth' );

$database->setQuery( "SELECT id AS id, title AS title FROM #__sections"
	. "\nWHERE scope='content'"
	. "\nAND published='1'"
	. ($access ? "\n	AND access<='$my->gid'" : "" )
	. "\nORDER BY title ASC"
	. "\nLIMIT $count"
);

$rows = $database->loadObjectList();
if ($rows) {?>
	<table cellpadding="1" cellspacing="1" border="0">
	<?php
	foreach ($rows as $row) { ?>
	<tr>
	  <td valign="top"><img src="<?php echo $mosConfig_live_site;?>/images/M_images/arrow.png" alt="" /></td>
	  <td><a href="<?php echo sefRelToAbs("index.php?option=content&task=blogsection&id=".$row->id); ?>"><?php echo $row->title;?></a></td>
	</tr>
	<?php
	}
	?>
</table>
<?php
}
?>
