<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/

	incoh();
	include("modules/$module_name/l_config.php");
	menu(1);
	$lid = $db->XMFnum(trim($lid));
	$result = $db->sql_query("SELECT adminid, editorialtimestamp, editorialtext, editorialtitle FROM ".TABLE_LINKS_EDITORIALS." WHERE linkid = '$lid'");
	$recordexist = $db->sql_numrows($result);
	$transfertitle = ereg_replace ("_", " ", $ttitle);
	$displaytitle = $transfertitle;
	br('1');
	Max_OpenTable();
	echo "<center><font class=\"option\"><b>"._LINKPROFILE.": ".htmlentities($displaytitle)."</b></font><br />";
	linkinfomenu($lid, $ttitle);
	if ($recordexist != 0) {
		while($row = $db->sql_fetchrow($result)) {
			$adminid = $db->XMFnum($row['adminid']);
			$editorialtimestamp = $row['editorialtimestamp'];
			$editorialtext = stripslashes($row['editorialtext']);
			$editorialtitle = stripslashes(check_html($row['editorialtitle'], "nohtml"));
			ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $editorialtimestamp, $editorialtime);
			$editorialtime = strftime("%F",mktime($editorialtime[4],$editorialtime[5],$editorialtime[6],$editorialtime[2],$editorialtime[3],$editorialtime[1]));
			$date_array = explode("-", $editorialtime);
			$timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]);
			$formatted_date = date("F j, Y", $timestamp);
			br('2');
			OpenTable2();
			echo "<center><font class=\"option\"><b>'$editorialtitle'</b></font></center>"
			."<center><font class=\"tiny\">"._EDITORIALBY." $adminid - $formatted_date</font></center><br /><br />"
			."$editorialtext";
			CloseTable2();
		}
	} else {
		echo "<br /><br /><center><font class=\"option\"><b>"._NOEDITORIAL."</b></font></center>";
	}
	echo "<br /><br /><center>";
	linkfooter($lid,$ttitle);
	echo "</center>";
	Max_CloseTable();
	incof();