<?

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



	// ========================================================================================
	//  Track/Stop Tracking Board
	// ========================================================================================
	
			
		
		
		$BoardID = intval($Arguments3);
		
		if ($BoardID > 0) {
		
			if ($LoggedIn == 'y') {
			
				$query = "select NotifyBoards from `".$Settings['DBPrefix']."core-Users` where Username='".$CookieUsername."' limit 1";
				$result = mysql_query($query) or die (mysql_error());
				$row = mysql_fetch_array($result);
				
				
				$WorkingString = substr($row['NotifyBoards'],1,strlen($row['NotifyBoards'])-2);
				
				$NotifyBoardsArray = explode('-',$WorkingString);
				
				for ($i = 0; $i < count($NotifyBoardsArray); $i++) {
					if ($NotifyBoardsArray[$i] == $BoardID) {
						$CurrentlySet = 'y';					
					}
				}
				
				
				if ($CurrentlySet == 'y') {
					// already in there, so remove it
					
					for ($i = 0; $i < count($NotifyBoardsArray); $i++) {
						if ($NotifyBoardsArray[$i] != $BoardID) {
							$NotifyBoardsString .= '-'.$NotifyBoardsArray[$i];
						}
					}
					
					if ($NotifyBoardsString != '') {
						$NotifyBoardsString .= '-';
					}
					
				
				}
				else {
					// not already in there, so add it
					if ($row['NotifyBoards'] == '') {
						$row['NotifyBoards'] = '-';
					}
					$NotifyBoardsString = $row['NotifyBoards'] . $BoardID . '-';
				
				}
				
					
				$query = "update `".$Settings['DBPrefix']."core-Users` set NotifyBoards='".$NotifyBoardsString."' where Username='".$CookieUsername."' limit 1";
				$result = mysql_query($query) or die (mysql_error());
				
					
				
				header('Location: ' . $MainURL . '/forum/'.$BoardID.'.html');
					
					
				
				
			}		
			else {
			
				$PageContents = $MsgText[2][56];
			
			}	
		
	}
	else {
	
		$PageContents = $MsgText[2][57];
	
	}

	
	
?>
