<?

/*
FlexCMS (http://www.flexcms.com)
Flexible, Powerful, Affordable.

Contents of this file are protected by the copyright
notice found at http://www.flexcms.com/flex/pages/copyright.html,
and its usage is subject to the terms of the licensing agreement 
available at http://www.flexcms.com/flex/pages/license.html
*/



	// ========================================================================================
	// manage news/articles
	// ========================================================================================
	
	$query = "select * from `".$Settings['DBPrefix']."na-Settings`";
	$result = mysql_query($query) or die (mysql_error());
	while ($row = mysql_fetch_array($result)) {
		$nlSettings[$row['Name']] = $row['Value'];
	}
	
	
	$PageTitle = $MsgText[7][5];
	$BrowserTitle = $MsgText[7][5];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="' . $MainURL . '/options.html">'.$MsgText[0][4].'</a> > '.$MsgText[7][5];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[703] == 'y') {
			
			ReadFormArguments();
			Global $FormArguments;

				
				$ArticlesCount = intval($FormArguments['ArticlesCount']);
				$ArticlesOffset = intval($FormArguments['ArticlesOffset']);
				
				if ($FormArguments['CategoriesSelector'] == 'all') {
					$CategoriesList = '';
				}
				else {
					for ($i = 0; $i < count($FormArguments['Categories']); $i++) {
						$CategoriesList .= $FormArguments['Categories'][$i];
					}
					$CategoriesList = substr($CategoriesList,0,strlen($CategoriesList)-1);
				}
				
				
				$PageContents = '<br>'.$MsgText[7][50].'<br><br><div align="center"><b>{FlexCMS-Articles|'.$FormArguments['StyleCode'].'|'.$ArticlesOffset.','.$ArticlesCount.'|'.$CategoriesList.'}</b></div>';
					
			
		}
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}
		


?>
