<?php
	/* WebWall */
	define("ONLINE", 1);
	$root = dirname( dirname( dirname(__FILE__) ) );
	require_once "$root/core.php";
	checkuserloggedoff();
	$arr = $engine_session->getallnotifications(''.USER_USERNAME.'');
	usort($arr, "compare");

	function compare($v1, $v2) 
	{
	    if ($v1["time"] == $v2["time"]) return 0;
	    return ($v1["time"] > $v2["time"])? -1: 1;
	}

	$msg = '<ul class="timeline">';
	for($i=0;$i<count($arr);$i++)
	{
		if($i%2==0) $d = 'r';
		else $d = 'l';
		$msg .= '<li>';
		$msg .= '<div class="direction-'.$d.'">';
		$msg .= '<div class="flag-wrapper">';
		$msg .= '<span class="flag"><div class="desc">'.$arr[$i]['type'].' '.$arr[$i]['info'].'</div>'.$arr[$i]['data'].'<span class="time-wrapper"><span class="time">'.counttime(usertime($arr[$i]['time'])).'</span></span></span>';		$msg .= '</div>';
		$msg .= '</div>';
		$msg .= '</li>';
	}
	$msg .= '</ul>';

	$template_session->setparameter("getnotifications", $msg, true);

	$template_session->loadhead($template_session->getlangval(849));
	$template_session->loadlogo(); 
	$template_session->loadmenu(); 
	$template_session->loadtpl("notifications");
	$template_session->loadtpl("footer");
	$template_session->loadend();
?>