$oList->setCustom("elemperpage", $_REQUEST["elemperpage"]); $aCols = array("rcpname", "rcpemail", "", "status", "sent"); $oList->setHeader(i18n("Recipient", $plugin_name), i18n("E-Mail", $plugin_name), i18n("Type", $plugin_name), i18n("Status", $plugin_name), i18n("Sent", $plugin_name), i18n("Actions", $plugin_name)); $oList->setSortable(0, true); $oList->setSortable(1, true); $oList->setSortable(2, false); $oList->setSortable(3, true); $oList->setSortable(4, true); // Get data $oLogs->resetQuery(); $oLogs->setWhere("idnewsjob", $_REQUEST["idnewsjob"]); $sBrowseLinks = "1"; if ($_REQUEST["elemperpage"] > 0) { // First, get total data count $oLogs->query(); $iRecipients = $oLogs->count(); // Getting item count without limit (for page function) - better idea anybody (performance)? if ($iRecipients > 0 && $iRecipients > $_REQUEST["elemperpage"]) { $sBrowseLinks = ""; for ($i = 1; $i <= ceil($iRecipients / $_REQUEST["elemperpage"]); $i++) { //$iNext = (($i - 1) * $_REQUEST["elemperpage"]) + 1; if ($sBrowseLinks !== "") { $sBrowseLinks .= " "; } if ($iNextPage == $i) { $sBrowseLinks .= $i . "\n"; // I'm on the current page, no link } else { $sBrowseLinks .= '<a href="' . $sess->url("main.php?area={$area}&action={$action}&frame={$frame}&idnewsjob=" . $_REQUEST["idnewsjob"] . "&nextpage={$i}&sortmode=" . $_REQUEST["sortmode"] . "&sortby=" . $_REQUEST["sortby"]) . '">' . $i . '</a>' . "\n"; } }