<?php
///////////////////////////////////////////////////////////////////////////////////////
// PHPizabi 0.848b C1 [ALICIA]                               http://www.phpizabi.net //
///////////////////////////////////////////////////////////////////////////////////////
// Please read the license.txt file before using / modifying this software           //
// Original author:         Claude Desjardins, R - feedback@realitymedias.com        //
// Last modification date:  August 26th 2006                                         //
// Version:                 PHPizabi 0.848b C1                                       //
//                                                                                   //
// (C) 2005, 2006 Real!ty Medias / PHPizabi - All rights reserved                    //
///////////////////////////////////////////////////////////////////////////////////////

	/* Check Structure Availability */
	if (!defined("CORE_STRAP")) die("Out of structure call");
	
	// TEMPLATE HANDLING ////////////////////////////////////////////////////////////////// FINAL //
	/*
		Initialize the template engine and
		load the template file. Get objects,
		convert self user.
	*/
	$tpl = new template;
	$tpl -> Load("page");
	
	if (isset($_GET["id"]) && is_numeric($_GET["id"])) $tpl -> AssignUser($_GET["id"]);
	else die("No user ID provided, unable to act");
	
	
	if (isset($_POST["Submit"])) {
	
		/*
			Paging flood protection
		*/
		if (isset($_SESSION["LAST_PAGE_UDATE"]) && $_SESSION["LAST_PAGE_UDATE"] > date("U")-130) $tpl->Zone("page", "floodControl");
				
		else {
			
			$_SESSION["LAST_PAGE_UDATE"] = date("U");
		
			/*
				If the user is online, we will send the page
				to the lane system
			*/
			if (_fnc("user", $_GET["id"], "last_load") > date("U")-300) {

				_fnc("laneMakeToken", "page", $_GET["id"], array(
					"{user.username}" => me("username"),
					"{body}" => _fnc("strtrim", $_POST["body"], 30)
				));
			}
			
			/*
				Show the success message
			*/
			$tpl->Zone("page", "success");
		}
	}
	
	
	else $tpl->Zone("page", "enabled");

	
	$tpl -> Flush();
	
?>