| @version 0.1.2 [0.1.0] - Alpha | | @website https://github.com/pytesNET/snicker | @license X11 / MIT License | @copyright Copyright © 2019 SamBrishes, pytesNET */ if(!defined("BLUDIT")){ die("Go directly to Jail. Do not pass Go. Do not collect 200 Cookies!"); } global $pages, $security, $Snicker, $SnickerIndex, $SnickerPlugin, $SnickerUsers; // Get Data $limit = $SnickerPlugin->getValue("frontend_per_page"); if($limit === 0){ $limit = 15; } $current = isset($_GET["tab"])? $_GET["tab"]: "pending"; // Get View $view = "index"; if(isset($_GET["view"]) && in_array($_GET["view"], array("search", "single", "uuid", "user"))){ $view = $current = $_GET["view"]; $tabs = array($view); } else { $tabs = array("pending", "approved", "rejected", "spam"); } // Render Comemnts Tab foreach($tabs AS $status){ if(isset($_GET["tab"]) && $_GET["tab"] === $status){ $page = max((isset($_GET["page"])? (int) $_GET["page"]: 1), 1); } else { $page = 1; } // Get Comments if($view === "index"){ $comments = $SnickerIndex->getList($status, $page, $limit); $total = $SnickerIndex->count($status); } else if($view === "search"){ $comments = $SnickerIndex->searchComments(isset($_GET["search"])? $_GET["search"]: ""); $total = count($comments); } else if($view === "single"){ $comments = $SnickerIndex->getListByParent(isset($_GET["single"])? $_GET["single"]: ""); $total = count($comments); } else if($view === "uuid"){ $comments = $SnickerIndex->getListByUUID(isset($_GET["uuid"])? $_GET["uuid"]: ""); $total = count($comments); } else if($view === "user"){ $comments = $SnickerIndex->getListByUser(isset($_GET["user"])? $_GET["user"]: ""); $total = count($comments); } // Render Tab Content $link = DOMAIN_ADMIN . "snicker?page=%d&tab={$status}#{$status}"; ?>
">
" />
$limit){ ?>
« « » »
getTokenCSRF(); ?> <> > getComment($uid, $status); if(!(isset($data["page_uuid"]) && is_string($data["page_uuid"]))){ continue; } $user = $SnickerUsers->getByString($data["author"]); ?>
getValue("comment_title") !== "disabled" && !empty($data["title"])){ echo '' . $data["title"] . ''; } echo '

' . (isset($data["excerpt"])? $data["excerpt"]: "") . '

'; if(!empty($data["parent_uid"]) && $SnickerIndex->exists($data["parent_uid"]) && $view !== "single"){ $reply = DOMAIN_ADMIN . "snicker?view=single&single={$uid}"; $reply = '' . $SnickerIndex->getComment($data["parent_uid"])["title"] . ''; echo "
" . sn__("Reply To") . ": " . $reply . "
"; } ?>
getByUUID($data["page_uuid"])); ?>