Location: PHPKode > projects > SWG MiniBlog > sub/actions.php
<?php
	if (isset($_GET['action']))
	{
		switch($_GET['action'])
		{
			case "logout":
				userManager::logoutUser();
				break;
			case "login":
				if ($_POST['password']==$password)		
				{
					$_SESSION['loggedin'] = true;			
				}
				break;
			case "delblog":
				if (!isset($_SESSION['loggedin'])) break;
				$myblog->delBlogEntry($_GET['id']);
				break;
			case "addblog":
				if (!isset($_SESSION['loggedin'])) break;
				$myblog->addBlogEntry($_POST['subject'],$_POST['blogpost'],$_POST['tags']);
				break;
			case "enterchange":
				$changeid = $_GET['id'];
				break;
			case "modblog":
				if (!isset($_SESSION['loggedin'])) break;
				$myblog->changeBlogEntry($_GET['id'],$_POST['subject'], $_POST['blogpost'],$_POST['tags']);
				break;
			case "showall":
				$pagination = 0;
				break;
			case "showbytags":
				$pagination = 0;
				$tag = $_GET['t'];
				break;
			case "entercomment":				
				$comments = $_GET['id'];
				echo($myblog->getCommentForm($comments));
				break;
			case "showcomments":
				$comments = $_GET['id'];
				break;
			case "newcomment":
				$comments = $_GET['id'];
				$myblog->addBlogComment($_POST['username'],$_POST['comment'],$comments);
				break;
			case "delcomment":
				$comments = $myblog->getPostIdByCommentId($_GET['id']);
				if (!isset($_SESSION['loggedin'])) break;
				$myblog->delComment($_GET['id']);
				break;
			default:
				echo("No action defined..");
				break;
		}
	}
?>
Return current item: SWG MiniBlog