echo $urlActionPrefix . $banIpAction . "&t=trash\">" . $banIpLang . "</a>";
 } else {
     echo $urlActionPrefix . "modify\">" . $lang['pModify'] . "</a> - " . $urlActionPrefix . "delete\"\">" . $lang['pDelete'] . "</a> - ";
     if ($res['rid'] == NULL) {
         echo $urlActionPrefix . "reply\">" . $lang['pReply'] . "</a> - ";
     }
     echo $urlActionPrefix . $banIpAction . "\">" . $banIpLang . "</a> - ";
     echo $urlActionPrefix . $publishAction . "\">" . $publishLang;
 }
 echo "</a></td>\n\t\t\t \t\t\t<td align=\"right\" width=\"10%\">\n\t\t\t \t\t\t\t<input type=\"checkbox\" value=\"" . secureVar($res['id'], 'html') . "\" name=\"checked_items[]\" onclick=\"checkAllFields(" . secureVar($res['id'], 'html') . ");\" />\n\t\t\t \t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr class=\"topInfos\">\n\t\t\t\t\t\t<td>";
 if ($isTrash) {
     echo secureVar($res['name'], 'html');
 } else {
     echo "<a href=\"index.php?a=posts&id=" . secureVar($res['id'], 'html') . "\">" . secureVar($res['name'], 'html') . "</a>";
 }
 echo ", " . date($config['dateFormat'], secureVar($res['date'], 'html')) . ", \n\t\t\t\t\t\t\t" . secureVar($res['location'], 'html') . " <a href=\"index.php?a=posts&cc=" . secureVar($res['country'], 'html') . "\"><img src=\"../images/countries/" . secureVar($res['country'], 'html') . ".png\" \n\t\t\t\t\t\t\talt=\"" . $countryName->getCountry($res['country']) . "\" /></a> \n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<a href=\"javascript:toggle(" . secureVar($res['id'], 'html') . ")\"><img src=\"../images/posts/toggle1.gif\" id=\"m" . secureVar($res['id'], 'html') . "\" alt=\"toggle\" /></a>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan=\"2\" class=\"message\" id='i" . secureVar($res['id'], 'html') . "'>";
 if (isset($actionId) && $postActionId == secureVar($res['id'], 'html')) {
     $urlActionPrefix = "index.php?a=posts&p=" . $pageNum . "&postid=" . secureVar($res['id'], 'html');
     if ($isTrash) {
         $urlActionPrefix .= "&t=trash";
     }
     if ($actionId == 'modify') {
         echo "<form action=\"" . $urlActionPrefix . "\" method=\"post\"><fieldset>\n\t\t\t\t \t\t\t\t\t<textarea name='modifyMessage' rows='5' cols='50' onfocus='this.select()'>" . htmlspecialchars_decode(secureVar($res['message'], 'html'), ENT_QUOTES) . "</textarea>\n\t\t\t\t \t\t\t\t\t<input type=\"hidden\" name=\"postid\" value=\"" . secureVar($res['id'], 'html') . "\" />\n\t\t\t\t \t\t\t\t\t<input type=\"submit\" name=\"submit\" value=\"" . $lang['modify'] . "\" />\n\t\t\t\t \t\t\t\t\t</fieldset></form>";
     } elseif ($actionId == 'reply') {
         echo $messageValue . "<hr />\n\t\t\t\t \t\t\t\t<form action=\"" . $urlActionPrefix . "\" method=\"post\"><fieldset>\n\t\t\t\t \t\t\t\t\t<textarea name='replyMessage' rows='5' cols='35'></textarea>\n\t\t\t\t \t\t\t\t\t<input type=\"hidden\" name=\"postid\" value=\"" . secureVar($res['id'], 'html') . "\" />\n\t\t\t\t \t\t\t\t\t<input type=\"submit\" name=\"submit\" value=\"" . $lang['modify'] . "\" />\n\t\t\t\t \t\t\t\t\t</fieldset></form>";
     } else {
         echo $messageValue;
     }
 } else {
     echo $messageValue;
 }
 $signCheck['publish'] = !$config['moderateMsg'];
 if ($config['autoCensor']) {
     include_once 'classes/manage/message.class.php';
     if (Message::isCensored($signCheck['message'])) {
         $signCheck['publish'] = 0;
     }
 }
 $boxContent->assign("ERROR_MSG", $errorField);
 $boxContent->parse('sign.signCheck');
 $signCheck['date'] = time();
 $signCheck['ip'] = getIP();
 $signCheck['useragent'] = $_SERVER['HTTP_USER_AGENT'];
 include_once 'classes/manage/countries.class.php';
 $countriesName = new Countries();
 $ratingArray = array("0" => "0", "1" => "1", "2" => "2", "3" => "3", "4" => "4", "5" => "5");
 $resCountries = $countriesName->getCountry($signCheck['country']);
 if (empty($resCountries) || $resCountries == '') {
     $signCheck['country'] = '00';
 }
 if (!in_array($signCheck['rating'], $ratingArray)) {
     $signCheck['rating'] = '-1';
 }
 if ($errorField == "") {
     $queryMsg = "INSERT INTO " . $dbTables['posts'] . " (\n\t\t`id` ,\n\t\t`name` ,\n\t\t`country` ,\n\t\t`date` ,\n\t\t`location` ,\n\t\t`email` ,\n\t\t`message` ,\n\t\t`useragent` ,\n\t\t`rating` ,\n\t\t`publish` ,\n\t\t`ip` )\n\t\tVALUES (\n\t\tNULL ,\n\t\t'" . secureVar($signCheck['name'], 'sql') . "',\n\t\t'" . secureVar($signCheck['country'], 'sql') . "',\n\t\t'" . secureVar($signCheck['date'], 'sql') . "',\n\t\t'" . secureVar($signCheck['location'], 'sql') . "',\n\t\t'" . secureVar(base64_encode($signCheck['email']), 'sql') . "',\n\t\t'" . secureVar($signCheck['message'], 'sql') . "',\n\t\t'" . secureVar($signCheck['useragent'], 'sql') . "',\n\t\t'" . secureVar($signCheck['rating'], 'sql') . "',\n\t\t'" . secureVar($signCheck['publish'], 'sql') . "',\n\t\t'" . secureVar($signCheck['ip'], 'sql') . "' )";
     if ($con->modify($queryMsg)) {
         // Send email if enabled
         if ($config['receiveEmailNotification']) {
             include_once 'classes/email/email.class.php';
             $senderEmail = base64_decode($config['email']);
             $sendEmail = new Email($senderEmail);
             $sendEmail->sendEmail($senderEmail, $senderEmail, $lang['newMsgEmailSubject'], $lang['newMsgEmail'], "text");
 if ($searchUsed) {
     $boxContent->assign("MESSAGES_LANG", $lang['numberResults']);
     $boxContent->assign("NUM_MESSAGES", $con->getNumRows());
     $boxContent->parse('posts.num_posts');
 }
 include_once 'classes/manage/statistics.class.php';
 include_once 'classes/manage/countries.class.php';
 foreach ($con->queryResult as $res) {
     // Get data, format it if necessary, and publish it
     $userAgent = new Statistics($res['useragent']);
     $countryName = new Countries();
     $messageValue = Message::formatMessage(secureVar($res['message'], 'html'), $censoredList, $censoredLists);
     $messageValue = Message::formatSmilies($messageValue, null, $smiliesReplacement);
     $boxContent->assign("DATE", date($config['dateFormat'], secureVar($res['date'], 'html')));
     $boxContent->assign("POST_ID", secureVar($res['id'], 'html'));
     $boxContent->assign("COUNTRY", $countryName->getCountry($res['country']));
     $boxContent->assign("COUNTRY_ICON", "images/countries/" . secureVar($res['country'], 'html') . ".png");
     $boxContent->assign("NAME", secureVar($res['name'], 'html'));
     $boxContent->assign("LOCATION", secureVar($res['location'], 'html'));
     $boxContent->assign("MESSAGE", $messageValue);
     $boxContent->assign("USER_AGENT", secureVar($res['useragent'], 'html'));
     $boxContent->assign("RATING", secureVar($res['rating'], 'html'));
     $boxContent->assign("RATING_ICON", "images/stars/" . secureVar($res['rating'], 'html') . ".gif");
     $boxContent->assign("PAGE_ADDR", "index.php?id=" . secureVar($res['id'], 'html'));
     $boxContent->assign("COUNTRY_ADDR", "index.php?cc=" . secureVar($res['country'], 'html'));
     $boxContent->assign("BROWSER_ICON", "images/browsers/icon_" . $userAgent->getBrowser() . ".png");
     $boxContent->assign("OS_ICON", "images/os/icon_" . $userAgent->getOS() . ".png");
     // Admin reply
     if ($res['rid'] != NULL) {
         $messageValue = Message::formatMessage(secureVar($res['rmessage'], 'html'), $censoredList, $censoredLists);
         $messageValue = Message::formatSmilies($messageValue, null, $smiliesReplacement);
 }
 $con->connect();
 $con->getRows($queryMsg);
 //$totalFlags = 0;
 if ($con->getNumRows() > 0) {
     include_once 'classes/manage/countries.class.php';
     $countryName = new Countries();
     foreach ($con->queryResult as $res) {
         if ($res['country'] != '') {
             //$totalFlags += $res['nb_country'];
             $percentage = number_format($res['nb_country'] * 100 / $totalFlags, 2);
             $boxContent->assign("FLAG_ICON", "images/countries/" . $res['country'] . ".png");
             $boxContent->assign("FLAG_ID", $res['country']);
             $boxContent->assign("URL_FLAG", "index.php?cc=" . $res['country']);
             $boxContent->assign("NUM_FLAG", $res['nb_country']);
             $boxContent->assign("NAME_FLAG", $countryName->getCountry($res['country']));
             $boxContent->assign('PER_FLAG', $percentage);
             $boxContent->parse('stats.stats_posts.flagStats');
         }
     }
 }
 $boxContent->assign('TOTAL_FLAGS', $totalFlags);
 $boxContent->assign('LANG_COUNTRY', $lang['country']);
 $boxContent->assign('LANG_NB_POSTS', $lang['nbPosts']);
 $boxContent->assign('LANG_TOTAL', $lang['total']);
 $boxContent->assign('LANG_BROWSER', $lang['browser']);
 $boxContent->assign('LANG_OS', $lang['os']);
 $boxContent->assign("ALL_TIME", $allTimeURL);
 $boxContent->assign("LAST_MONTH", $lastMonthURL);
 $boxContent->assign('LANG_WHEN', $lang['when']);
 $boxContent->parse('stats.stats_posts');