Exemple #1
0
 $amount = 20;
 // Number per page - could make configurable later if required
 if ($sub_action) {
     $from = intval($sub_action);
 }
 // @todo format form the 0.8 way
 $text = "<div style='text-align:center'>\n\t\t<form method='post' action='" . e_SELF . "?banlog-" . $from . "'>\n\t\t<table class='table adminform'>\n\t\t<colgroup>\n\t\t\t<col style='width:20%; vertical-align:top;' />\n\t\t\t<col style='width:30%; vertical-align:top;' />\n\t\t\t<col style='width:30%; vertical-align:top;' />\n\t\t\t<col style='width:30%; vertical-align:top;' />\n\t\t</colgroup>";
 // Get entries
 $banLogEntries = $ipAdministrator->getLogEntries($from, $amount, $num_entry);
 if (count($banLogEntries) == 0) {
     $text .= "<tbody><tr><td colspan='4'>" . BANLAN_82 . "</td></tr>";
     $num_entry = 0;
 } else {
     $text .= "<thead><tr><td class='fcaption'>" . BANLAN_83 . "</td><td class='fcaption'>" . BANLAN_84 . "</td>\n\t\t\t\t<td class='fcaption'>" . BANLAN_7 . "</td><td class='fcaption'>" . BANLAN_85 . "</td></tr></thead><tbody>";
     foreach ($banLogEntries as $ban) {
         $row = $ipAdministrator->splitLogEntry($ban);
         $text .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td class='forumheader3'>" . strftime($pref['ban_date_format'], $row['banDate']) . "</td>\n\t\t\t\t\t<td class='forumheader3'>" . e107::getIPHandler()->ipDecode($row['banIP']) . "</td>\n\t\t\t\t\t<td class='forumheader3'>" . $ipAdministrator->getBanTypeString($row['banReason'], FALSE) . "</td>\n\t\t\t\t\t<td class='forumheader3'>" . $row['banNotes'] . "</td>\n\t\t\t\t\t</tr>";
     }
     // End while
     // Next-Previous. ==========================
     if ($num_entry > $amount) {
         $parms = "{$num_entry},{$amount},{$from}," . e_SELF . "?" . $action . '-[FROM]';
         $text .= "<tr><td colspan='5' style='text-align:center'><br />" . $tp->parseTemplate("{NEXTPREV={$parms}}" . '<br /><br /></td></tr>');
     }
     $text .= "<tr><td colspan='4' style='text-align:center'>\n\t\t\t\t\t\t<input class='btn button' type='submit' name='delete_ban_log' value='" . BANLAN_88 . "' />\n\t\t\t\t\t\t<input type='hidden' name='e-token' value='" . e_TOKEN . "' />\n\t\t\t\t\t</td>\n\t\t\t\t\t  </tr>";
 }
 $text .= "</tbody></table></form></div>";
 if (count($banLogEntries)) {
     $text .= "&nbsp;&nbsp;&nbsp;" . str_replace('--NUM--', $num_entry, BANLAN_87);
 }
 echo $text;