<?

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



	// ========================================================================================
	// save counter prefs
	// ========================================================================================
	
	$PageTitle = '<img src="'.$ImagesURL.'/admin/admincp_stats.gif" width="24" height="18"> '.$MsgText[4][8];
	$BrowserTitle = $MsgText[4][8];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="' . $MainURL . '/options.html">'.$MsgText[0][4].'</a> > '.$MsgText[4][8];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[402] == 'y') {
	
	
			ReadFormArguments();
			Global $FormArguments;
			
			if (count($FormArguments) > 0) {
			
			
				$FormArguments['TrackingURLs'] = str_replace("\r",'',$FormArguments['TrackingURLs']);
			
				$TrackingURLsArray = explode("\n",$FormArguments['TrackingURLs']);
				
				$FormArguments['TrackingURLs'] = '';
				if (strlen($TrackingURLsArray) > 0) {
					for ($i = 0; $i < count($TrackingURLsArray); $i++) {
						if ($TrackingURLsArray[$i] != '') {
							if ($FormArguments['TrackingURLs'] != '') {
								$FormArguments['TrackingURLs'] .= '$$$';
							}
						
							$FormArguments['TrackingURLs'] .= $TrackingURLsArray[$i];
						}
					}
				}
					
											
								
				$query = "update `".$Settings['DBPrefix']."cs-Settings` set Value='".intval($FormArguments['MaxRecent'])."' where Name='MaxRecent' limit 1";
				$result = mysql_query($query) or die (mysql_error());
				
				
				$query = "update `".$Settings['DBPrefix']."cs-Settings` set Value='".$FormArguments['TrackingURLs']."' where Name='TrackingURLs' limit 1";
				$result = mysql_query($query) or die (mysql_error());
						
				
				
				header('Location: ' . $MainURL . '/options.html');
				
				
			}
			else {
				$PageContents = $MsgText[0][98];
			}
			
		}
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}
	
	

	// ========================================================================================




?>
