} 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> <?php require "inc/footer.php";
if (!isset($touserid)) { redirect("/"); } if ($touserid == $userinfo["user_id"]) { redirect("/"); } $selmes = dbquery("SELECT * FROM bg_messages WHERE (mes_userid='" . $userinfo["user_id"] . "' AND mes_touserid='" . $touserid . "') OR (mes_userid='" . $touserid . "' AND mes_touserid='" . $userinfo["user_id"] . "') ORDER BY mes_id ASC"); $pocet = dbrows($selmes); if ($pocet >= 1) { while ($data = dbarray($selmes)) { if ($data["mes_userid"] == $userinfo["user_id"]) { $changepull = "pull-left"; } else { $changepull = "pull-left"; } echo ' <div class="media komentar"> <a class="' . $changepull . '"> <img class="media-object img-circle" src="' . (useravatar($data["mes_userid"]) != "/file/avatars/avatar.png" ? useravatar($data["mes_userid"]) : useravatar($data["mes_userid"])) . '" alt="avatar"> </a> <div class="media-body"> <h4 class="media-heading"><a class="profillink" data-target="65">' . username($data["mes_userid"]) . '</a> <span class="time pull-right">' . timeago($data["mes_time"]) . '</span></h4> ' . bbcode(badwords(smiley($data["mes_text"]))) . ' </div> </div> '; } } else { echo "<div style='padding:15px'>Žiadne správy s užívateľom <b>" . username($touserid, 0) . "</b></div>"; } dbquery("UPDATE bg_messages SET mes_read='1' WHERE mes_touserid='" . $userinfo["user_id"] . "' AND mes_userid='" . $touserid . "'");
if ($_GET['action'] == 'new') { $reponse = $bdd->query("SELECT pseudo, message_text \n FROM chat_messages \n WHERE message_room_id=" . $_SESSION['room_id'] . "\n ORDER BY message_id ASC LIMIT 0, 50"); while ($donnees = $reponse->fetch()) { $pseudo = $donnees['pseudo']; $texte = $donnees['message_text']; $message = smiley($texte); echo '<p><strong>' . $pseudo . '</strong> : ' . $message . '</p>'; } $reponse->closeCursor(); } if ($_GET['action'] == 'anc') { $reponse_2 = $bdd->query("SELECT pseudo, message \n FROM ancien_message \n WHERE message_room_id=" . $_SESSION['room_id'] . "\n ORDER BY id ASC "); while ($donnees_2 = $reponse_2->fetch()) { $pseudo_2 = $donnees_2['pseudo']; $texte_2 = $donnees_2['message']; $message_2 = smiley($texte_2); echo '<p><strong>' . $pseudo_2 . '</strong> : ' . $message_2 . '</p>'; } $reponse_2->closeCursor(); } function smiley($texte) { $texte = str_replace(' :) ', '<img src="./images/sourire.png" />', $texte); $texte = str_replace(':) ', '<img src="./images/sourire.png" />', $texte); $texte = str_replace(':)', '<img src="./images/sourire.png" />', $texte); $texte = str_replace(' :)', '<img src="./images/sourire.png" />', $texte); $texte = str_replace(' ;) ', '<img src="./images/clin.png" />', $texte); $texte = str_replace(';) ', '<img src="./images/clin.png" />', $texte); $texte = str_replace(';)', '<img src="./images/clin.png" />', $texte); $texte = str_replace(' ;)', '<img src="./images/clin.png" />', $texte); $texte = str_replace(' :p ', '<img src="./images/langue.png" />', $texte);
/** * Post comment link */ function post_comment() { global $cd, $cfg, $lang, $id, $row, $session_status, $row, $trows, $comment_class, $forum_table, $block_spam; $tsql = "SELECT `id`, `tid`, `user_name`, `user_uri`, `title`, `comment`, `date`, `color`, `trash` FROM `{$forum_table}`" . " WHERE (`refer_id` = '{$row['id']}') AND (`trash` = '0') ORDER BY `date` ASC"; $tres = mysql_query($tsql); if (!$tres) { return ' Comment : Off'; exit; } $trow = mysql_num_rows($tres); if ($trow == '0') { $cstr = 'Comment'; } elseif ($trow == '1') { $cstr = $trow . ' Comment'; } else { $cstr = $trow . ' Comments'; } // comment field name $comment_field_name = md5($block_spam['comment_field_name']); if ($trow != 0) { // When there are some comments... $comments = ''; while ($trows = mysql_fetch_array($tres)) { $trows['title'] = htmlspecialchars(utf8_convert($trows['title'])); $trows['comment'] = nl2p(htmlspecialchars(utf8_convert($trows['comment']))); $trows['user_name'] = htmlspecialchars(utf8_convert($trows['user_name'])); $class_order = array_keys($comment_class); $color_class = $class_order[$trows['color']]; // If user's website URI was posted, wrap the user name with anchor. if (isset($trows['user_uri']) && preg_match('/([^=^\\"]|^)(http\\:[\\w\\.\\~\\-\\/\\?\\&\\+\\=\\:\\@\\%\\;\\#\\%]+)/', $trows['user_uri'])) { $user_name = '<a href="' . $trows['user_uri'] . '" rel="nofollow">' . $trows['user_name'] . '</a>'; } else { $user_name = $trows['user_name']; } // Smiley! $trows = smiley($trows); $comments .= '<h5 id="c' . $trows['id'] . '">' . $trows['title'] . "</h5>\n" . '<div class="' . $color_class . '">' . "\n" . $trows['comment'] . '<p class="author">From : ' . $user_name . ' @ ' . $trows['date'] . ' ' . '<span class="edit"><a href="./forum/comment_edit.php?id=' . $trows['id'] . '">' . $lang['edit'] . '</a></span>' . "</p>\n" . "</div>\n"; // Admin button if ($session_status == 'on') { $comments .= '<form action="./forum/admin/comment_edit.php" method="post">' . "\n" . '<div class="submit-button">' . "\n" . '<input type="hidden" name="edit" value="1" />' . "\n" . '<input type="hidden" name="id" value="' . $trows['id'] . '" />' . "\n" . '<input type="submit" value="' . $lang['mod_del'] . '" />' . "\n" . '</div>' . "\n" . '</form>' . "\n"; } $tid = $trows['tid']; } // Cookies if (isset($_COOKIE['p_blog_forum_user'])) { $user_name = $_COOKIE['p_blog_forum_user']; $checked = ' checked="checked"'; } else { $user_name = ''; $checked = ''; } if (isset($_COOKIE['p_blog_forum_email'])) { $user_email = $_COOKIE['p_blog_forum_email']; } else { $user_email = ''; } if (isset($_COOKIE['p_blog_forum_uri'])) { $user_uri = $_COOKIE['p_blog_forum_uri']; } else { $user_uri = ''; } // Settings for "Comment Form Template" $post_title = ''; $title = 'Re: ' . $row['name']; $comment = $lang['no_tags_allowed']; $action = './forum/comment_reply.php'; $refer_id = $row['id']; // Set parent key = 0 since parent comment is already posted, // and specify the topic id. $parent_key = '<input type="hidden" name="parent_key" value="0" />' . "\n" . '<input type="hidden" name="tid" value="' . $tid . '" />'; $comment_title = $lang['view_com_title_1'] . htmlspecialchars(strip_tags($row['name'])) . $lang['view_com_title_2']; $comment_link = '<a href="./article.php?id=' . $row['id'] . '#comments" title="' . $comment_title . '" class="status-on">' . $cstr . '</a> '; } else { // When No Comment... // Settings for "Comment Form Template" $post_title = ''; $action = './forum/comment_reply.php'; $refer_id = $row['id']; // Initialize user info because it's the first time post $user_name = ''; $user_email = ''; $user_uri = ''; $title = 'Re: ' . $row['name']; $comment = $lang['no_tags_allowed']; $checked = ''; // Set parent key = 1 $parent_key = '<input type="hidden" name="parent_key" value="1" />'; $comments = '<p class="gray-out">No Comments</p>'; $comment_title = $lang['post_com_title_1'] . htmlspecialchars(strip_tags($row['name'])) . $lang['post_com_title_2']; $comment_link = '<a href="./article.php?id=' . $row['id'] . '#comments" title="' . $comment_title . '">' . 'Post Comment</a> '; $tid = ''; } // Load the presentation template of "Comment Form" $comment_form = ''; // Initialize comment form require_once $cd . '/forum/contents/comment_form.tpl.php'; $comment_list = <<<EOD <!-- Begin #comment-list --> <div id="comment-list"> <h4 id="comments">{$cstr}</h4> {$comments} {$comment_form} </div> <!-- End #comment-list --> EOD; if (!empty($id)) { // When Permalink $comment = $comment_list; } else { $comment = $comment_link; } return $comment; }
if ($session_status == 'on') { $mod_del_button = '<th class="mod-del" summary="Delete">' . $lang['delete'] . '</th>' . "\n"; } else { $mod_del_button = ''; } // Create topic list $list = ''; while ($row = mysql_fetch_array($res)) { // Check the number of replies $rep_sql = "SELECT COUNT(`id`) FROM `{$forum_table}` WHERE `tid` = '{$row['tid']}' AND `parent_key` = '0' AND `trash` = '0'"; $rep_res = mysql_query($rep_sql); $rep_row = mysql_fetch_array($rep_res); $row['title'] = htmlspecialchars($row['title']); $row['user_name'] = htmlspecialchars($row['user_name']); $row = convert_to_utf8($row); $row = smiley($row); // Status if ($row['mod'] > date('Y/m/d g:i:s', time() - 24 * 3600)) { $status = ' class="status-on"'; } else { $status = ''; } // Generate the link to the latest post in the last page. // p= means the first post of each pages. // pn= means page number $pn = ceil(($rep_row[0] + 1) / $cfg['pagemax']); $p = floor(($pn - 1) * $cfg['pagemax']); $query_to_thread = $row['tid'] . '&p=0'; $query_to_the_latest = '<a href="./topic.php?tid=' . $row['tid'] . '&p=' . $p . '&pn=' . $pn . '&pm=' . $cfg['pagemax'] . '#latest" class="latest-post" title="' . $lang['latest'] . '">' . $row['mod'] . '</a>'; $list .= "<tr>\n" . '<td><a href="./topic.php?tid=' . $query_to_thread . '"' . $status . '>' . $row['title'] . '</a></td>' . "\n" . '<td>' . $rep_row[0] . "</td>\n" . '<td>' . $row['user_name'] . "</td>\n" . '<td class="last-modified">' . $query_to_the_latest . "</td>\n"; if ($session_status == 'on') {
<div class="list-group-item" style="background:#5cb85c;border-color:#5cb85c;">Téma: ' . htmlspecialchars($_POST["name"]) . '</div> <div class="list-group-item"> <a href="#p0" class="idf">#0</a><strong>' . username($userinfo["user_id"], 1) . '</strong> - ' . $adminprava[$userinfo["user_perm"]] . '<span class="pull-right">' . date("j. n. Y H:i:s", $dataf3["post_time"]) . '</span> </div> <div class="list-group-item"> <div class="row"> <div class="col-md-2 visible-md visible-lg"> ' . (useravatar($userinfo["user_id"]) != "/file/avatars/avatar.png" ? '<img src="' . useravatar($userinfo["user_id"]) . '" alt="avatar" class="img-responsive"/>' : '<img src="' . useravatar($userinfo["user_id"]) . '" alt="avatar" class="img-responsive" />') . ' </div> <div class="col-md-10"> ' . userdetect(smiley(bbcode(badwords(nl2br($_POST["forumnew"]))))) . ' </div> </div> </div> <div class="list-group-item"></div> </div> '; } echo '<div class="list-group"> <form name="form" action="" method="POST"> <div class="list-group-item list-group-item-warning">Vytvoriť novú tému v fóre: ' . forumcat($_GET["forumfid"]) . '</div> <div class="list-group-item"> <input name="name" class="form-control" style="width:100%" value="' . (isset($_POST["name"]) ? $_POST["name"] : "") . '" placeholder="zadajte názov témy..." type="text"> </div> <textarea name="forumnew" class="list-group-item" rows="15" placeholder="" style="width:100%;padding:10px;font-size:12px;resize:vertical">' . (isset($_POST["forumnew"]) ? $_POST["forumnew"] : "") . '</textarea>
/** * Article Box */ function display_forum_log_box($row) { global $cfg, $keys, $lang, $log_table, $comment_class, $forum_table, $cd, $row, $tid, $session_status, $rrow, $case, $i, $keys, $request_uri, $p, $pn; $row['title'] = sanitize($row['title']); $row['comment'] = sanitize($row['comment']); $row['user_name'] = sanitize($row['user_name']); $row['user_uri'] = sanitize($row['user_uri']); $row['date'] = sanitize($row['date']); $row['parent_key'] = sanitize(intval($row['parent_key'])); hit_key_highlight(); // Check the ID of the latest post $check_latest_sql = "SELECT `id` FROM `{$forum_table}` WHERE `tid` = '{$row['tid']}' AND `parent_key` = '0' AND `trash` = '0' ORDER BY `mod` DESC LIMIT 1"; $check_latest_res = mysql_query($check_latest_sql); $check_latest_row = mysql_fetch_array($check_latest_res); if ($check_latest_row[0] == $row['id']) { $check_latest = ' id="latest"'; } else { $check_latest = ''; } if ($row['parent_key'] == 1) { if (isset($row['refer_id']) && $row['refer_id'] != 0) { $rsql = "SELECT `name` FROM `{$log_table}` WHERE `id` = '{$row['refer_id']}'"; $rres = mysql_query($rsql); $rrow = mysql_fetch_array($rres); $rrow = convert_to_utf8($rrow); $anchor = '<h2>' . '» ' . '<a href="../article.php?id=' . $row['refer_id'] . '"> ' . $rrow['name'] . " </a></h2>\n"; $top_title = '<div class="comments">' . "\n" . '<h3>' . $row['title'] . "</h3>\n"; } else { $anchor = ''; $top_title = '<div class="comments"' . $check_latest . '>' . "\n" . '<h2 id="topic-title">' . $row['title'] . "</h2>\n"; // Parent post title } $comment = $anchor . $top_title; } else { $comment = '<div class="comments"' . $check_latest . '>' . "\n" . '<h3>' . $row['title'] . "</h3>\n"; } // in case ">" is posted...convert ">" to ">" //$row['comment'] = htmlspecialchars($row['comment']); // auto line-breaks $row['comment'] = nl2p($row['comment']); // generate URI if (isset($row['user_uri']) && preg_match('/([^=^\\"]|^)(http\\:[\\w\\.\\~\\-\\/\\?\\&\\+\\=\\:\\@\\%\\;\\#\\%]+)/', $row['user_uri'])) { $author = '<a href="' . $row['user_uri'] . '">' . $row['user_name'] . '</a>'; } else { $author = $row['user_name']; } $comment .= '<p class="author">' . 'From : ' . $author . ' @ ' . $row['date'] . ' ' . '<span class="edit"><a href="./modify.php?tid=' . $row['tid'] . '&id=' . $row['id'] . '">' . $lang['edit'] . "</a></span>\n" . '<span class="quote"><a href="./topic.php?tid=' . $row['tid'] . '&p=' . $p . '&pn=' . $pn . '&pm=' . $cfg['pagemax'] . '&qid=' . $row['id'] . '#addform">' . $lang['quote'] . "</a></span></p>\n"; $class_order = array_keys($comment_class); $color_class = $class_order[$row['color']]; $comment .= '<div class="' . $color_class . '">' . "\n" . $row['comment'] . "</div>\n"; if (preg_match('/forum\\/search.php/', $request_uri)) { $comment .= '<div class="a-footer"><a href="./topic.php?tid=' . $row['tid'] . '">' . $lang['topic'] . '</a></div>'; } // Display "Update" and "Delete" button while admin is logged-in. if ($session_status == 'on') { $comment .= '<form action="./admin/modify.php" method="post">' . "\n" . '<div class="submit-button">' . "\n" . '<input type="hidden" name="id" value="' . $row['id'] . '" />' . "\n" . '<input type="hidden" name="tid" value="' . $row['tid'] . '" />' . "\n" . '<input type="submit" value="' . $lang['mod'] . '" />' . "\n" . "</div>\n" . "</form>\n" . '<form method="post" action="./admin/delete.php">' . "\n" . '<div class="submit-button">' . "\n" . '<input type="hidden" name="id" value="' . $row['id'] . '" />' . "\n" . '<input type="hidden" name="tid" value="' . $row['tid'] . '" />' . "\n" . '<input type="submit" value="' . $lang['delete'] . '" />' . "\n" . "</div>\n" . '</form>' . "\n"; } else { $comment .= ''; } $comment .= "</div>\n"; $comment = smiley($comment); return $comment; }
function komentare($clanok, $type = "A", $link = "") { global $userinfo; echo '<div class="komentare" id="komentare">'; if (MEMBER) { if (isset($_GET["komentar"]) && isset($_GET["zmazat"]) && $_GET["zmazat"] != "") { if (!ctype_digit($_GET['zmazat'])) { redirect("/"); } $result66 = dbquery("SELECT * FROM bg_comments WHERE comment_id='" . strip_tags((int) $_GET["zmazat"]) . "' AND comment_type='" . $type . "'"); $rows55 = dbrows($result66); $data8 = dbarray($result66); if ($rows55 == 1) { if (!userperm("5")) { if ($data8["comment_userid"] == $userinfo["user_id"]) { dbquery("UPDATE bg_comments SET comment_delete='1' WHERE comment_id='" . strip_tags((int) $_GET["zmazat"]) . "' AND comment_type='" . $type . "'"); if ($link == "") { redirect("/clanok/" . $_GET["id"] . "/" . strip_tags($_GET["n"]) . "#komentare"); } else { redirect($link); } } else { redirect("/"); } } else { dbquery("UPDATE bg_comments SET comment_delete='1' WHERE comment_id='" . strip_tags((int) $_GET["zmazat"]) . "' AND comment_type='" . $type . "'"); dbquery("UPDATE bg_comments SET comment_delete='1' WHERE comment_type='" . $type . "' AND comment_reply='" . strip_tags((int) $_GET["zmazat"]) . "'"); if ($link == "") { redirect("/clanok/" . $_GET["id"] . "/" . strip_tags($_GET["n"]) . "#komentare"); } else { redirect($link); } } } else { redirect("/"); } } $antispamnum = rand(1, 99); if (isset($_POST["addcomment"]) && $_POST["textarea"] != "") { $text = trim(htmlspecialchars($_POST["textarea"], ENT_QUOTES, "UTF-8")); $reply = isset($_GET["reply"]) ? strip_tags((int) $_GET["reply"]) : "0"; if ($reply != 0) { $resultcom = dbquery("SELECT * FROM bg_comments WHERE comment_id='" . strip_tags((int) $_GET["reply"]) . "' AND comment_type='" . $type . "'"); $rows5com = dbrows($resultcom); if ($rows5com != 1) { if ($link == "") { redirect("/clanok/" . $_GET["id"] . "/" . strip_tags($_GET["n"]) . "#komentare"); } else { redirect($link); } } } if (!dbcount("(comment_id)", "bg_comments", "comment_userid='" . $userinfo["user_id"] . "' AND comment_time > " . strtotime("-30 seconds") . "")) { if ($text != "" and strlen($text) >= 8) { dbquery("INSERT INTO bg_comments(comment_userid, comment_text, comment_time, comment_pageid, comment_type, comment_reply)\n VALUES('" . $userinfo["user_id"] . "','" . $text . "','" . time() . "','" . $clanok . "','" . $type . "','" . $reply . "')"); } } if ($link == "") { redirect("/clanok/" . $_GET["id"] . "/" . strip_tags($_GET["n"]) . "#komentare"); } else { redirect($link); } } if (isset($_GET['reply'])) { if (!ctype_digit($_GET['reply'])) { redirect("/"); } } if (dbcount("(comment_id)", "bg_comments", "comment_userid='" . $userinfo["user_id"] . "' AND comment_time > " . strtotime("-30 seconds") . "")) { echo '<div class="alert alert-danger">O 30 sekúnd môžeš znova komentovať.</div>'; } echo '<div class="list-group komentboxarea ' . (isset($_GET['reply']) ? "showdiv" : "hidediv") . '" id="komreply"> <form name="form" action="#komentare" method="POST"> <div class="list-group-item list-group-item-info">Pridaj komentár</div> <textarea name="textarea" class="list-group-item" maxLength="800" rows="1" placeholder="text komentáru..." style="width:100%;padding:10px;font-size:12px;resize:vertical"></textarea> <div class="list-group-item"> <span class="bbcody"> <a href="javascript:addText(\'textarea\', \'[b]\', \'[/b]\', \'form\');" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="[b]tučný[/b]"><i class="fa fa-bold"></i></a> <a href="javascript:addText(\'textarea\', \'[i]\', \'[/i]\', \'form\');" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="[i]kurzíva[/i]"><i class="fa fa-italic"></i></a> <a href="javascript:addText(\'textarea\', \'[u]\', \'[/u]\', \'form\');" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="[u]podčiarknuté[/u]"><i class="fa fa-underline"></i></a> <a href="javascript:addText(\'textarea\', \'[url]\', \'[/url]\', \'form\');" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="[url]odkaz[/url]"><i class="fa fa-link"></i></a> </span> <span class="pull-right"> ' . (isset($_GET["reply"]) ? ' <a href="' . ($link == "" ? "/clanok/" . $_GET["id"] . "/" . strip_tags($_GET["n"]) . "#komentare" : $link) . '" class="btn btn-warning btn-sm">Zrušiť odpoveď</a>' : "") . ' <input name="addcomment" class="btn btn-success btn-sm" value="' . (isset($_GET["reply"]) ? 'Odpovedať na komentár ID #' . strip_tags((int) $_GET["reply"]) . '' : "Pridať komentár") . '" type="submit"> </span> <div class="clearfix"></div> </div> </form> </div> '; } else { echo '<div class="alert alert-info">Pred pridaním komentára sa musíš <a href="/registracia">zaregistrovať</a> alebo prihlásiť.</div>'; } echo ' <div class="page-header"> <h5>Komentáre ' . (!isset($_GET['reply']) ? '<a id="showcommentarea" class="btn btn-success btn-xs pull-right">Pridať komentár</a>' : '') . ' </h5> </div> '; if (isset($_GET["vsetkykomentare"]) && $_GET["vsetkykomentare"] == "zobrazit") { $comlimit = ""; } else { $comlimit = "LIMIT 0,7"; } $result2 = dbquery("SELECT * FROM bg_comments WHERE comment_delete='0' AND comment_pageid='" . $clanok . "' AND comment_type='" . $type . "' AND comment_reply='0' ORDER BY comment_id DESC"); $rows3 = dbrows($result2); if ($rows3 >= 1) { $result3 = dbquery("SELECT * FROM bg_comments WHERE comment_delete='0' AND comment_pageid='" . $clanok . "' AND comment_type='" . $type . "' AND comment_reply='0' ORDER BY comment_id DESC " . $comlimit); while ($data2 = dbarray($result3)) { $resultreply = dbquery("SELECT * FROM bg_comments WHERE comment_delete='0' AND comment_pageid='" . $clanok . "' AND comment_type='" . $type . "' AND comment_reply='" . $data2["comment_id"] . "' ORDER BY comment_id DESC"); // def reply $rowsrep = dbrows($resultreply); // def reply echo ' <div class="media komentar"> <a class="pull-left"> <img class="media-object img-circle" src="' . useravatar($data2["comment_userid"]) . '" alt="' . username($data2["comment_userid"]) . '"> </a> <div class="media-body"> <h4 class="media-heading">' . username($data2["comment_userid"], 1) . ' <span class="time">' . timeago($data2["comment_time"]) . '</span></h4> ' . wordwrap(bbcode(badwords(smiley($data2["comment_text"]))), 100, " ", 1) . ' <div class="clearfix"></div> <div class="buttonsinfo"> '; if (MEMBER) { echo '<a href="?reply=' . $data2["comment_id"] . '#komreply" class="btn btn-default btn-xs"><i class="fa fa-share"></i> Odpovedať</a> '; } if (SADMIN or MEMBER && $data2["comment_userid"] == $userinfo["user_id"]) { echo '<a href="?zmazat=' . $data2["comment_id"] . '&komentar" onclick="return confirm(\'Zmazať komentár užívateľa ' . username($data2["comment_userid"]) . ' ?\');" title="Odstrániť komentár" class="btn btn-default btn-xs"><i class="fa fa-ban"></i> Odstrániť komentár</a>'; } echo $rowsrep >= 3 ? ' <a class="btn btn-default btn-xs sreply" data-comid="' . $data2["comment_id"] . '"><i class="fa fa-level-down"></i> Zobraziť ďaľšie odpovede (' . ($rowsrep - 1) . ')</a>' : ""; echo '</div>'; $schovaj = $rowsrep >= 3 ? 'hidencom kom' . $data2["comment_id"] : ""; if ($rowsrep >= 1) { $i = 0; while ($datareply = dbarray($resultreply)) { echo ' <div class="media komentarreply ' . ($i == 0 ? "" : $schovaj) . '"> <a class="pull-left"> <img class="media-object img-circle" src="' . useravatar($datareply["comment_userid"]) . '" alt="' . username($datareply["comment_userid"]) . '"> </a> <div class="media-body"> <h4 class="media-heading">' . username($datareply["comment_userid"], 1) . ' <span class="time">' . timeago($datareply["comment_time"]) . '</span></h4> ' . wordwrap(bbcode(badwords(smiley($datareply["comment_text"]))), 100, " ", 1) . ' <div class="clearfix"></div> <div class="buttonsinfo"> '; if (SADMIN or MEMBER && $datareply["comment_userid"] == $userinfo["user_id"]) { echo '<a href="?zmazat=' . $datareply["comment_id"] . '&komentar" onclick="return confirm(\'Zmazať komentár užívateľa ' . username($datareply["comment_userid"]) . ' ?\');" title="Odstrániť komentár" class="btn btn-default btn-xs"><i class="fa fa-ban"></i> Odstrániť komentár</a>'; } echo ' </div> </div> </div> '; $i++; } } echo ' </div> </div> '; } if ($rows3 > "7") { if (isset($_GET["vsetkykomentare"]) && $_GET["vsetkykomentare"] == "zobrazit") { echo "<a href='?vsetkykomentare=skryt#komentare' class='buttonf'>Skryť všetky komentáre</a>"; } else { echo "<a href='?vsetkykomentare=zobrazit#komentare' class='buttonf'>Zobraziť všetky komentáre</a>"; } } } else { echo "<p style='padding: 10px;'>Žiadny komentár ešte nebol pridaný. Buďte prvý kto pridá komentár.</p>"; } echo "</div>"; }
$doublepostuserid = 0; } else { echo ' <div class="row forumpost" id="p' . $dataf3["post_id"] . '"> <div class="col-md-1 visible-md visible-lg"> ' . (useravatar($dataf3["post_userid"]) != "avatar.png" ? '<img src="' . useravatar($dataf3["post_userid"]) . '" alt="avatar" class="img-responsive img-circle" style="max-width:60px;"/>' : '<img src="' . useravatar($dataf3["post_userid"]) . '" alt="avatar" class="img-responsive img-circle" style="max-width:60px;" />') . ' </div> <div class="col-md-11"> <div class="forumpostbody"> <div class="forumposthead ' . ($resultf5["post_id"] == $dataf3["post_id"] ? "" : "OSTATNEPOSTY") . '"> <a href="#p' . $dataf3["post_id"] . '" class="idf">#' . $i . '</a> <strong>' . username($dataf3["post_userid"], 1) . '</strong> — ' . ($permuser >= 2 ? $adminprava[$permuser] : userrank($dataf3["post_userid"], 1)) . '<span class="pull-right time">' . timeago($dataf3["post_time"]) . '</span> </div> ' . userdetect(smiley(bbcode(badwords(nl2br($dataf3["post_text"])), 1))) . ' <div class="forumpostfooter"> ' . ($dataf3["post_edittime"] ? 'Upravil/a ' . username($dataf3["post_edituser"], 1) . ' dňa ' . date("j. n. Y H:i:s", $dataf3["post_edittime"]) . '' : '') . '' . (SADMIN ? " IP: " . $dataf3["post_ip"] : "") . ' </div> '; if ($dataf2["forumt_locked"] == 0) { echo '<span class="postbuttons">'; if (MEMBER && $userinfo["user_id"] == $dataf3["post_userid"] || userperm("5")) { echo '[<a href="?upravit=' . $dataf3["post_id"] . '#upravit">Upraviť</a>] ' . ($resultf5["post_id"] == $dataf3["post_id"] ? '' : '[<a href="?zmazatf=' . $dataf3["post_id"] . '" onclick="return confirm(\'Príspevok už nebude možné vrátiť späť. Prajete ho vymazať?\');">Vymazať</a>]'); } echo '</span>'; } echo ' </div>