2012-12-01, 11:52 AM
Error that I get when I try go to bans.php:
Here's what's inside my bans.php:
And this is what's inside my banlistphp template:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/luccqqo/public_html/bans.php(7) : eval()'d code on line 4
Here's what's inside my bans.php:
<?php
define('IN_MYBB', 1); require "./global.php";
add_breadcrumb("Ban List", "bans.php");
eval("\$html = \"".$templates->get("banlistphp")."\";");
output_page($html);
?>
And this is what's inside my banlistphp template:
<html>
<head>
<title>'.$pages['name'].'</title>
{$headerinclude}
</head>
<body>
{$header}
<table border="0" cellspacing="1" cellpadding="3" class="tborder">
<thead>
<tr>
<td class="thead" colspan="5">
<strong><center>'.$pages['name'].'</center></strong>
</td>
</tr>
</thead>
<tbody>';
$template .= '
<tr align="center">
<td class="tcat"><span class="smalltext"><strong>Banned Person</strong></span></td>
<td class="tcat"><span class="smalltext"><strong>Banned Reason</strong></span></td>
<td class="tcat"><span class="smalltext"><strong>Who Banned ?</strong></span></td>
<td class="tcat"><span class="smalltext"><strong>On Date</strong></span></td>
<td class="tcat"><span class="smalltext"><strong>Lift Date</strong></span></td>
</tr>';
$query = $db->query("SELECT * FROM `".TABLE_PREFIX."banned` ORDER BY `dateline` DESC");
while ($ban = $db->fetch_array($query))
{
$uid = intval($ban['uid']);
$user = get_user($uid);
$ban_person = build_profile_link($user['username'],$ban['uid']);
if ($ban['reason'] == "")
{
$ban_reason = "N/A";
}
else
{
$ban_reason = htmlspecialchars_uni($ban['reason']);
}
$banu = get_user($ban['admin']);
$username = format_name($banu['username'], $banu['usergroup'], $banu['displaygroup']);
$who_ban = build_profile_link($username, $banu['uid']);
$on_date = my_date($mybb->settings['dateformat'],$ban['dateline']);
if ($ban['lifted'] == 'perm' || $ban['lifted'] == '' || $ban['bantime'] == 'perm' || $ban['bantime'] == '---')
{
$lift_date = "<div class='smalltext' align='center' style='font-color: red'>Permanent</div>";
}
else
{
$lift_date = my_date($mybb->settings['dateformat'],$ban['lifted']);
}
$template .= '
<tr align="center">
<td class="trow1">'.$ban_person.'</td>
<td class="trow2">'.$ban_reason.'</td>
<td class="trow1">'.$who_ban.'</td>
<td class="trow2">'.$on_date.'</td>
<td class="trow1">'.$lift_date.'</td>
</tr>';
}
// Figure out if we need to display multiple pages.
$perpage = $mybb->settings['threadsperpage'];
if($mybb->input['page'] != "last")
{
$page = intval($mybb->input['page']);
}
$query = $db->simple_select("banned", "COUNT(uid) AS count");
$banned_count = $db->fetch_field($query, "count");
$postcount = intval($banned_count);
$pages = $postcount / $perpage;
$pages = ceil($pages);
if($mybb->input['page'] == "last")
{
$page = $pages;
}
if($page > $pages || $page <= 0)
{
$page = 1;
}
if($page)
{
$start = ($page-1) * $perpage;
}
else
{
$start = 0;
$page = 1;
}
$upper = $start+$perpage;
$multipage = multipage($postcount, $perpage, $page, "misc.php?page=banned");
$template .= '
</tbody>
</table><div class="float_left">{$multipage}</div>
<br/>
{$footer}
</body>
</html>