$rowsperpage = 10; $adminpage = 'on'; $action = _GET('action', ''); $pressid = _GET('pressid', -1); $pg = _GET('pg', 1); if ($pg < 1) { $pg = 1; } switch ($action) { case 'remove': RemoveNews($pressid); } $first = ($pg - 1) * $rowsperpage; $no = $first + 1; $articles = GetPressList($first, $rowsperpage, BLOG); $content .= '<section id="adm_container"> <div class="container">'; $content .= '<p class="pressEdit-list">Total news: ' . GetNewsCount(BLOG) . '</p>'; $table = "<!--- start list of articles -->"; foreach ($articles as $key => $row) { $rowtpl = '<p class="pressEdit-list">@NO@: <a href="@EDITLINK@">@TITLE@</a> <a href="@DELLINK@">X</a></p>'; if ($row['flags'] == 1) { $nostr = '*' . $no; } else { $nostr = $no; } if ($row['flags'] & 2) { $nostr = '(T)' . $nostr; } $rowhtml = str_replace("@NO@", $nostr, $rowtpl);
} else { if (!isset($_SESSION['src'])) { $_SESSION['src'] = NEWS; } } //echo $_SESSION['src']; // <-- the src is not used, so it is set only here if ($pg < 1) { $pg = 1; } switch ($action) { case 'remove': RemoveNews($pressid); } $first = ($pg - 1) * $rowsperpage; $no = $first + 1; $articles = GetPressList($first, $rowsperpage, $_SESSION['src']); //$content = '<p class="statistics">Total news: '.GetNewsCount($_SESSION['src']).'</p>'; $content = '<section id="adm_container"> <div class="container">'; $table = "<!--- start list of articles -->"; foreach ($articles as $key => $row) { $rowtpl = '<p class="pressEdit-list">@NO@: <a href="@EDITLINK@">[@TITLE@]</a> <a href="@DELLINK@">X</a></p>'; if ($row['flags'] & 1) { $nostr = '*' . $no; } else { $nostr = $no; } if ($row['flags'] & 2) { $nostr = '(T)' . $nostr; } $rowhtml = str_replace("@NO@", $nostr, $rowtpl);