<?

/*
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
*/



	// ========================================================================================
	// create new links categories
	// ========================================================================================
	
	
	$query = "select * from `".$Settings['DBPrefix']."lm-Settings`";
	$result = mysql_query($query) or die (mysql_error());
	while ($row = mysql_fetch_array($result)) {
		$lmSettings[$row['Name']] = $row['Value'];
	}
	
	
	$PageTitle = $MsgText[8][19];
	$BrowserTitle = $MsgText[8][19];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="' . $MainURL . '/options.html">'.$MsgText[0][4].'</a> > <a href="'.$MainURL.'/admin/links.html">'.$MsgText[8][2].'</a> > '.$MsgText[8][19];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[801] == 'y') {
		
			ReadFormArguments();
			Global $FormArguments;
			
			if (count($FormArguments) > 0) {
			
				if ($FormArguments['Title'] != '') {
			
					$query = "insert into `".$Settings['DBPrefix']."lm-Categories` (Title,Description, Parent) values ('".$FormArguments['Title']."', '".$FormArguments['Description']."', '".$FormArguments['Parent']."')";
					$result = mysql_query($query) or die (mysql_error());
					
						
					Header('Location: '.$MainURL.'/admin/links.html');
					
				}
				else {
					
					$PageContents = $MsgText[8][21];
				
				}				

			}
			else {
				$PageContents = $MsgText[0][98];
			}
		
		} // end if permissions are sufficient
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}
				
	
	// ========================================================================================




?>
