Location: PHPKode > projects > Admbook > admin/index.php
<?php
	class Timer {
		var $startTime;
		var $endTime;
		function start() {
			$this->startTime = gettimeofday();
		}
		function stop() {
			$this->endTime = gettimeofday();
		}
		function elapsed() {
			return (($this->endTime["sec"] - $this->startTime["sec"]) * 1000000 + ($this->endTime["usec"] - $this->startTime["usec"])) / 1000000;
		}
	}
	$timer = new Timer();
	$timer->start();
	session_start();
	include("../settings-data.php");
	include("../lib.php");
	checkPermissions($login, $password);
	if (file_exists("../content-data.php"))
		include("../content-data.php");
	if (!isset($content))
		$content[0]['ip'] = "";
	$contentCnt = sizeof($content);
?>
<html>
<head>
<title>admbook :: version <?=$constant['version']?></title>
<?php
	if ($constant['charset'] != "")
	{
?>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$constant['charset']?>"/>
<?php
	}
?>
<script language="JavaScript" src="../script.js" type="text/javascript"></script>
<link href="../style.css" type="text/css" rel="stylesheet"/>
<style type="text/css">
<!--
.text {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['text-color']?>
}

.link {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['link-color']?>
}

.messagetext {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['message-text-color']?>
}

.messagelink {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['message-link-color']?>
}

.admintext {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['admin-message-text-color']?>
}

.adminlink {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['admin-message-link-color']?>
}

.headertext {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['header-text-color']?>
}

.headerlink {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['header-link-color']?>
}
-->
</style>
</head>
<body bgcolor="<?=$constant['background-color']?>" text="<?=$constant['text-color']?>" link="<?=$constant['link-color']?>" vlink="<?=$constant['link-color']?>" alink="<?=$constant['link-color']?>" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">
<table width="760" border="0" cellpadding="0" cellspacing="0" align="center" height="100%">
<form action="delete.php" method="get">
<input type="hidden" name="page" value="<?=$page?>"/>
<tr>
	<td valign="top" class="text">
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td bgcolor="<?=$constant['border-color']?>">
				<table width="100%" border="0" cellpadding="2" cellspacing="1">
				<tr>
					<td bgcolor="<?=$constant['header-background-color']?>" class="headertext" id="book-title">Admbook versi0n <?=$constant['version']?></td>
				</tr>
				</table>
			</td>
		</tr>
		</table>
		<br/>
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td bgcolor="<?=$constant['border-color']?>">
				<table width="100%" border="0" cellpadding="2" cellspacing="1">
				<tr>
					<td bgcolor="<?=$constant['header-background-color']?>" class="headertext" align="center"><a href="../index.php#post" class="headerlink"><b>Send Message</b></a></td>
				</tr>
				</table>
			</td>
		</tr>
		</table>
		<br/>
<?php
	$pageLine = pagesNumber($contentCnt, $constant['messages-to-page'], $page, "index.php", $constant['page-in-line'], "page: ", "total: ", "headerlink");
	if ($pageLine != "")
	{
?>		<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td bgcolor="<?=$constant['border-color']?>">
				<table width="100%" border="0" cellpadding="2" cellspacing="1">
				<tr>
					<td bgcolor="<?=$constant['header-background-color']?>" class="headertext"><?=$pageLine?></td>
				</tr>
				</table>
			</td>
		</tr>
		</table>
		<br/>
<?php
	}
	$z = $page*$constant['messages-to-page'] - ($constant['messages-to-page']-1);
	$currentContent = outputPageContent($content,$page,$constant['messages-to-page']);
	for ($i = 0; $i < sizeof($currentContent); $i++)
	{
		if (isset($currentContent[$i]['ip']) && $currentContent[$i]['ip'] != "")
		{
?>
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td bgcolor="<?=$constant['border-color']?>">
				<table width="100%" border="0" cellpadding="0" cellspacing="1">
				<tr>
					<td>
						<table width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="<?=$constant['header-background-color']?>">
<?php
			// ip : host >>
?>						<tr>
							<td width="3%"><input type="checkbox" name="id[]" value="<?=$z;?>"/></td>
							<td width="15"><a href="delete.php?id=<?=$z;?>"><img src="../img/delete.gif" width="15" height="15" border="0" alt="Delete message"></a></td>
							<td width="19"><a href="edit.php?id=<?=$z;?>&page=<?=$page?>"><img src="../img/edit.gif" width="19" height="17" border="0" alt="Edit message"></a></td>
<?php
			if ($currentContent[$i]['admin-name'] == "" && $currentContent[$i]['admin-message'] == "")
			{
?>							<td width="18"><a href="reply.php?id=<?=$z;?>&page=<?=$page?>"><img src="../img/reply.gif" width="18" height="14" border="0" align="absmiddle" alt="Reply message"></a></td>
<?php
			}
?>							<td width="100%" class="headertext">&nbsp;Ip : <a href="ip-ban-add.php?ip=<?=$currentContent[$i]['ip']?>" class="headerlink"><?=$currentContent[$i]['ip']?></a><?if ($currentContent[$i]['host'] != "") print " // host : ".$currentContent[$i]['host']?><?if ($currentContent[$i]['proxy'] != "") print " // proxy: <a href=\"ip-ban-add.php?ip=".$currentContent[$i]['proxy']."\" class=\"headerlink\">".$currentContent[$i]['proxy']."</a>"; ?></td>
						</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="<?=$constant['message-background-color']?>">
<?php
			// ip : host <<
			// name and email as link >>
			if ($currentContent[$i]['name'] != "")
			{
?>						<tr>
							<td width="1%" align="center"><img src="../img/name.gif" width="11" height="14" border="0" alt="Name"/></td>
							<td class="messagetext"><?php 
							if ($currentContent[$i]['mail'] != "") {
								print '<a href="mailto:'.$currentContent[$i]['mail'].'">'.$currentContent[$i]['name'].'</a>';
							}
							else {
								print $currentContent[$i]['name'];
							}
							$check['status'] = false;
							$check['id'] = -1;
							$check = checkPublishName($currentContent[$i]['name'], "", "../users-data.php");
							if(!$check['status'])
								print ' [<a href="javascript:info(\'../user-info.php?id='.$check['id'].'\',450,250)">info</a>]';
							?></td>
						</tr>
<?php
			}
			// name and email as link <<
			// url >>
			if ($currentContent[$i]['url'] != "")
			{
?>						<tr>
							<td align="center"><img src="../img/url.gif" width="18" height="18" border="0" alt="Url"/></td>
							<td class="messagetext"><a href="<?=$currentContent[$i]['url']?>" class="messagelink"><?=$currentContent[$i]['url']?></a></td>
						</tr>
<?php
			}
			// url <<
			// icq >>
			if ($currentContent[$i]['icq'] != "")
			{
?>						<tr>
							<td><img src="http://online.mirabilis.com/scripts/online.dll?icq=<?=$currentContent[$i]['icq']?>&img=5" width="18" height="18" alt="User status"></td>
							<td><a href="http://web.icq.com/whitepages/message_me/1,,,00.icq?uin=<?=$currentContent[$i]['icq']?>&action=message" class="messagelink"><?=$currentContent[$i]['icq']?></a></td>
						</tr>
<?php
			}
			// icq <<
			// date and time >>
			if ($currentContent[$i]['time'] != "")
			{
?>						<tr>
							<td align="center"><img src="../img/date.gif" width="17" height="18" border="0" alt="Date and Time"/></td>
							<td class="messagetext">[<?=getFullDate($currentContent[$i]['time'], $constant['locale']).", ".getTime($currentContent[$i]['time'])?>]</td>
						</tr>
						<tr>
							<td><img src="../img/sp.gif" width="1" height="1" border="0"/></td>
							<td><hr size="1" color="<?=$constant['line-color']?>"/></td>
						</tr>
<?php
			}
			// date and time <<
			// message >>
			if ($currentContent[$i]['message'] != "")
			{
?>						<tr>
							<td><img src="../img/sp.gif" width="18" height="20" border="0"/></td>
							<td class="messagetext" valign="top"><?=convertSmile($currentContent[$i]['message'],"../img/")?></td>
						</tr>
<?php
			}
			// message <<
			if ($currentContent[$i]['admin-name'] != "")
			{
?>						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="<?=$constant['admin-message-background-color']?>">
<?php
			}
			// admin name >>
			if ($currentContent[$i]['admin-name'] != "")
			{
?>						<tr>
							<td width="1%" align="center"><img src="../img/sp.gif" width="1" height="5"><br/><a href="reply-del.php?id=<?=$z;?>&page=<?=$page?>"><img src="../img/delete.gif" width="15" height="15" border="0" alt="Delete admin message"></a><img src="../img/sp.gif" width="5" height="1"><a href="edit.php?id=<?=$z;?>&page=<?=$page?>"><img src="../img/edit.gif" width="19" height="17" border="0" alt="Edit message"></a></td>
							<td class="admintext" valign="bottom"><?php
							if (isset($currentContent[$i]['admin-mail']) && $currentContent[$i]['admin-mail'] != "")
								print '<a href="mailto:'.$currentContent[$i]['admin-mail'].'"><b>'.$currentContent[$i]['admin-name'].'</b></a>';
							else
								print "<b>".$currentContent[$i]['admin-name']."</b>";
							$check['status'] = false;
							$check['id'] = -1;
							$check = checkPublishName($currentContent[$i]['admin-name'], "", "../users-data.php");
							if(!$check['status'])
								print ' [<a href="javascript:info(\'../user-info.php?id='.$check['id'].'\',450,250)">info</a>]';
							?></td>
						</tr>
<?php
			}
			// admin name <<
			// date and time >>
			if ($currentContent[$i]['admin-time'])
			{
?>						<tr>
							<td align="center"><img src="../img/date.gif" width="17" height="18" border="0" alt="Date and Time"/></td>
							<td class="admintext">[<?=getFullDate($currentContent[$i]['admin-time'], $constant['locale']).", ".getTime($currentContent[$i]['admin-time'])?>]</td>
						</tr>
						<tr>
							<td><img src="../img/sp.gif" width="1" height="1" border="0"/></td>
							<td><hr size="1" color="<?=$constant['admin-line-color']?>"/></td>
						</tr>
<?php
			}
			// date and time <<
			// admin message >>
			if ($currentContent[$i]['admin-message'] != "")
			{
?>						<tr>
							<td><img src="../img/sp.gif" width="18" height="20" border="0"/></td>
							<td class="admintext" valign="top"><?=convertSmile($currentContent[$i]['admin-message'],"../img/")?></td>
						</tr>
<?php
			}
			// admin message <<
?>
						</table>
					</td>
				</tr>
				</table>
			</td>
		</tr>
		</table>
		<br/>
<?php
		}
		$z++;
	}
	if ($pageLine != "")
	{
?>		<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td bgcolor="<?=$constant['border-color']?>">
				<table width="100%" border="0" cellpadding="2" cellspacing="1">
				<tr>
					<td class="headertext" bgcolor="<?=$constant['header-background-color']?>"><?=$pageLine?></td>
				</tr>
				</table>
			</td>
		</tr>
		</table>
		<br/>
<?php
	}
	$timer->stop();
?>
		<table border="0" cellpadding="0" cellspacing="0" align="center">
		<tr>
			<td><input type="submit" value="delete" class="button"/></td>
			<td><input type="button" value="configuration" class="button" onClick="javascript:location.href='config.php?page=<?=$page?>'"/></td>
			<td><input type="button" value="censored word" class="button" onClick="javascript:location.href='censored.php'"/></td>
			<td><input type="button" value="help" class="button" onClick="javascript:location.href='<?=$constant['locale'] == "rus" ? $constant['help-page-ru'] : $constant['help-page-en'] ?> '"/></td>
		</tr>
		<tr>
			<td><input type="button" value="check all" class="halfbutton" onClick="javascript:check(true)"/><input type="button" value="uncheck all" class="halfbutton" onClick="javascript:check(false)"/></td>
			<td><input type="button" value="user list" class="button" onClick="javascript:location.href='user-list.php'"/></td>
			<td><input type="button" value="banned ip" class="button" onClick="javascript:location.href='ip-ban.php'"/></td>
			<td><input type="button" value="back" class="button" onClick="javascript:location.href='../index.php?page=<?=$page?>'"/></td>
		</tr>
		<tr>
			<td colspan="4" align="right"><input type="button" value="logout" class="button" onClick="javascript:location.href='logout.php'"/></td>
		</table>
	</td>
	</form>
</tr>
<tr>
	<td valign="bottom" align="right" height="1" class="text">
		<br/>
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td width="50%" bgcolor="<?=$constant['header-background-color']?>" class="headertext" align="center"><span class="text">&copy;&nbsp;</span>trent&nbsp;<a href="http://www.low.ru/dev/guestbook/" class="text" target="_top">Download this guestbook</a>&nbsp;</td>
			<td width="50%" bgcolor="<?=$constant['header-background-color']?>" class="headertext" align="center"><span class="text">&nbsp;&nbsp;&nbsp;</span><a href="http://www.mylov.ru" onclick="location.href='http://partner.mylov.ru/link.phtml?pid=10359084&lid=553';return false;" class="link" target="_top">Çíàêîìñòâà è îáùåíèå</a>&nbsp;</td>
		</tr>
		</table>
	</td>
</tr>
</table>
<!-- generation time <?=$timer->elapsed()." sec";?> -->
</body>
</html>
Return current item: Admbook