redirect("/"); } } else { $strana = 1; } $limit = "40"; $celkovy_pocet = $rows1; $pocet_stran = ceil($celkovy_pocet / $limit); $pociatok = $strana * $limit - $limit; $result = dbquery("SELECT * FROM bg_comments ORDER BY comment_id DESC LIMIT {$pociatok}, {$limit}"); if ($strana > $pocet_stran) { redirect("/"); } while ($data = dbarray($result)) { $nameexist = $data["comment_type"] == "A" ? articlename($data["comment_pageid"]) : projektname($data["comment_pageid"]); $name = $data["comment_type"] == "A" ? articleurl($data["comment_pageid"], articlename($data["comment_pageid"])) : projekturl($data["comment_pageid"], projektname($data["comment_pageid"]), 0, 0); echo '<tr id="article' . $data["comment_id"] . '" class="' . ($data["comment_delete"] == 1 ? "danger" : ($nameexist == "" ? "warning" : "")) . '"> <td><span class="label label-default">' . $data["comment_id"] . '</span></td> <td>' . ($nameexist == "" ? "Článok alebo projekt neexistuje" : $name) . '</td> <td>' . date("j. n. Y", $data["comment_time"]) . '</td> <td>' . username($data["comment_userid"], 0) . '</td> <td align="right"><a href="?cdel=' . $data["comment_id"] . '" class="label label-danger">Kôš</a> <span class="label label-default articleinf" data-toggle="popover" data-placement="right" data-trigger="hover" data-html="true" data-content="<div style=\'width:160px\'>' . str_replace("\"", "'", bbcode(badwords(smiley($data["comment_text"])))) . '</div>">Obsah</span></td> </tr>'; } echo '</table>'; pagination($rows1, $limit, $pocet_stran, $strana); } else { echo "Žiadní užívatelia.<br/>"; } ?> </div>
echo ' </div> </div> <div class="tab-pane fade in active" id="comments"> <div class="list-group" style="margin-top:15px;"> '; while ($datap = dbarray($result_comments)) { if ($datap["comment_type"] == "A") { $type = articleurl($datap["comment_pageid"], trimlink(articlename($datap["comment_pageid"]), 22), 1, 1); $name = articlename($datap["comment_pageid"]); } else { if ($datap["comment_type"] == "P") { $type = projekturl($datap["comment_pageid"], trimlink(projektname($datap["comment_pageid"]), 22), 1, 1); $name = projektname($datap["comment_pageid"]); } } echo '<a href="' . $type . '" class="list-group-item">' . $name . '<br/><small>' . trimlink(bbcoderemove(badwords($datap["comment_text"])), 70) . '</small> <span class="badge">' . timeago($datap["comment_time"]) . '</span></a>'; } echo ' </div> </div> <div class="tab-pane fade" id="forum"> <div class="list-group" style="margin-top:15px;"> '; while ($datap = dbarray($result_forumt)) { echo '<a href="/tema/' . $datap["forumt_id"] . '/' . bezd($datap["forumt_name"]) . '" class="list-group-item">' . $datap["forumt_name"] . ' <span class="badge">' . timeago($datap["forumt_time"]) . '</span></a>'; }