function showNewsWComments() { require 'database.php'; $name = $_SESSION['userAccount']; //show posted stories $stmt = $mysqli->prepare("SELECT * FROM news WHERE poster=?"); if (!$stmt) { printf("Query Prep Failed: %s\n", $mysqli->error); exit; } $stmt->bind_param('s', $name); $stmt->execute(); $result = $stmt->get_result(); echo "<table>\n\t\t\t<tr>\n\t\t\t<th>Previously Posted:</th>\n\t\t\t<th>Delete and Edit:</th>\n\t\t\t<th>News Links:</th>\n\t\t\t</tr>"; while ($row = $result->fetch_assoc()) { $_SESSION['newsStory'] = $row['newsstory']; echo "<tr>"; echo "<td>" . htmlentities($row['title']) . "</td>"; echo "<td>" . htmlentities($row['newsstory']) . "</td>"; echo "<td>" . '<a href="' . "http://" . htmlentities($row['links']) . '">' . htmlentities($row['links']) . ' </a>' . "</td>"; echo "<td>"; deleteStory($row['id']); editStory($row['id']); echo "</td>"; echo "</tr>"; } $stmt->close(); echo "</table>"; showComments(); }
function preComments($id) { $option = 'com_joomla_lms'; $data = new stdClass(); $data->component = $option . '_course'; $data->title = 'course'; $data->id = $id; $data->short = mosGetParam($_REQUEST, 'short', 0); showComments($data); }
function showComments($descriptor, $parent, $depth) { $result = mysql_query("\n SELECT `comment-id`, `parent-id`, `descriptor`, `comment-body`, `poster`, \n UNIX_TIMESTAMP(`posted-date`) as `posted-date`, `contact` \n FROM blog_comments \n WHERE `parent-id` = '{$parent}' AND descriptor = '{$descriptor}'\n ORDER BY `posted-date` ASC\n ") or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo '<div class = "comment" style = "margin-left: ' . $depth . 'px">'; echo formatContent($row['comment-body']); echo '<div class = "comment-footer">Posted by ' . $row['poster'] . ' ' . ($row['contact'] != 'None' ? '(' . $row['contact'] . ')' : '') . ' at ' . convertDate($row['posted-date']) . ' <a href = "javascript:nothing(\'\');" class = "reply">Reply</a></div>'; echo '</div>'; displayReply($row['comment-id']); showComments($descriptor, $row['comment-id'], $depth + 20); } }
function showComments($comments, &$rv, $pass = null) { if (!is_null($pass) && $pass == 0) { $pass++; } foreach ($comments as $comment) { $commentDate = new DateTime($comment->datePosted); $rv .= "<div id=\"comment-id_{$comment->id}\">"; $rv .= "<div class=\"well well-override\">"; $rv .= "<label>Posted By: <strong>{$comment->userName}</strong><span class=\"pull-right\">{$commentDate->format('Y-m-d')}</span></label>"; $rv .= $comment->displayBody; $rv .= "<div class=\"comment-reply\"><a id=\"comment-reply_{$comment->id}\" href=\"#comment-form\">Reply</a></div>"; if (!is_null($comment->replies)) { $pass = is_null($pass) ? $pass = 0 : $pass++; $rv .= showComments($comment->replies, $rv, $pass); } $rv .= "</div></div>"; if ($pass == 0 || is_null($pass)) { $rv .= "<hr>"; } } }
break; case "publish": publishComments($cid, 1, $option); break; case "unpublish": publishComments($cid, 0, $option); break; case "settings": showConfig($option); break; case "savesettings": $allow_comments_in_sections = implode(',', $_POST['mcselections']); saveConfig($option, $auto_publish_comments, $allow_anonymous_entries, $notify_new_entries, $allow_comments_in_sections, $comments_per_page, $admin_comments_length); break; default: showComments($option); break; } /** * @param option * @return list of comments */ function showComments($option) { global $database, $mainframe; $limit = $mainframe->getUserStateFromRequest("viewlistlimit", 'limit', 10); $limitstart = $mainframe->getUserStateFromRequest("view{$option}limitstart", 'limitstart', 0); $search = $mainframe->getUserStateFromRequest("search{$option}", 'search', ''); $search = $database->getEscaped(trim(strtolower($search))); $where = array(); if ($search) {
$combo_action[__('delete')] = 'delete'; } $has_action = !empty($combo_action) && (!$trackbacks->isEmpty() || !$comments->isEmpty()); echo '<div id="comments" class="multi-part" title="' . __('Comments') . '">'; if ($has_action) { echo '<form action="comments_actions.php" method="post">'; } echo '<h3>' . __('Trackbacks') . '</h3>'; if (!$trackbacks->isEmpty()) { showComments($trackbacks, $has_action); } else { echo '<p>' . __('No trackback') . '</p>'; } echo '<h3>' . __('Comments') . '</h3>'; if (!$comments->isEmpty()) { showComments($comments, $has_action); } else { echo '<p>' . __('No comment') . '</p>'; } if ($has_action) { echo '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right">' . __('Selected comments action:') . ' ' . form::combo('action', $combo_action) . form::hidden('redir', 'post.php?id=' . $post_id . '&co=1') . $core->formNonce() . '<input type="submit" value="' . __('ok') . '" /></p>' . '</div>' . '</form>'; } echo '</div>'; } /* Add a comment -------------------------------------------------------- */ if ($post_id) { echo '<div class="multi-part" id="add-comment" title="' . __('Add a comment') . '">' . '<h3>' . __('Add a comment') . '</h3>' . '<form action="comment.php" method="post" id="comment-form">' . '<fieldset class="constrained">' . '<p><label class="required" title="' . __('Required field') . '">' . __('Name:') . form::field('comment_author', 30, 255, html::escapeHTML($core->auth->getInfo('user_cn'))) . '</label></p>' . '<p><label>' . __('Email:') . form::field('comment_email', 30, 255, html::escapeHTML($core->auth->getInfo('user_email'))) . '</label></p>' . '<p><label>' . __('Web site:') . form::field('comment_site', 30, 255, html::escapeHTML($core->auth->getInfo('user_url'))) . '</label></p>' . '<p class="area"><label for="comment_content" class="required" title="' . __('Required field') . '">' . __('Comment:') . '</label> ' . form::textarea('comment_content', 50, 8, html::escapeHTML('')) . '</p>' . '<p>' . form::hidden('post_id', $post_id) . $core->formNonce() . '<input type="submit" name="add" value="' . __('save') . '" /></p>' . '</fieldset>' . '</form>' . '</div>'; } # Show comments or trackbacks function showComments(&$rs, $has_action)
$query['rss'] = null; } $q = ""; foreach ($query as $k => $v) { $q = "{$q}{$k}={$v}&"; } $_SERVER['REQUEST_URI'] = substr($q, 0, strlen($q) - 1); //////////// require 'cache.php'; fnxHtmlCache::readCache("[[random_string]]"); if (!fnxHtmlCache::hayCache()) { if (isset($_GET['up'])) { showIdea(); } else { if (!empty($_GET['id']) && is_numeric($_GET['id'])) { showComments($rss, $_GET['id']); } else { if (isset($_GET['rss'])) { showRSS($rss, $_GET['lang']); } } } } fnxHtmlCache::savePage(); exit; function showIdea() { $str = getContentHttps("https://xifrat.pirata.cat/ideatorrent2json.php"); //$str = file_get_contents("toString.json"); print $str; }
function showNewsWComments($id) { require 'database.php'; $stmt = $mysqli->prepare("SELECT * FROM news where id=?"); if (!$stmt) { printf("Query Prep Failed: %s\n", $mysqli->error); exit; } $stmt->bind_param('i', $id); $stmt->execute(); $result = $stmt->get_result(); echo "<table>\n\t\t\t<tr>\n\t\t\t<th>News:</th>\n\t\t\t<th>Link:</th>\n\t\t\t<th>Comment:</th>\n\t\t\t</tr>"; while ($row = $result->fetch_assoc()) { echo "<tr>"; echo "<td>" . htmlentities($row['title']) . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>" . htmlentities($row['newsstory']) . "</td>"; echo "<td>" . '<a href="' . "http://" . htmlentities($row['links']) . '">' . htmlentities($row['links']) . ' </a>' . "</td>"; echo "<td>"; if (isset($_SESSION['loggedIn']) && $_SESSION['loggedIn']) { commentPost($_SESSION['userAccount'], $id); } else { echo "Please log in to gain comment abilities"; } echo "</td>"; echo "</tr>"; } $stmt->close(); echo "</table>"; showComments($id); }
$trackbacks = $core->blog->getComments(array_merge($params, array('comment_trackback' => 1))); # Actions combo box $combo_action = $comments_actions_page->getCombo(); $has_action = !empty($combo_action) && !$trackbacks->isEmpty(); if (!empty($_GET['tb_auto'])) { $tb_urls = implode("\n", $TB->discover($post_excerpt_xhtml . ' ' . $post_content_xhtml)); } # Display tab echo '<div id="trackbacks" class="clear multi-part" title="' . __('Trackbacks') . '">'; # tracbacks actions if ($has_action) { echo '<form action="' . $core->adminurl->get("admin.post") . '" id="form-trackbacks" method="post">'; } echo '<h3>' . __('Trackbacks received') . '</h3>'; if (!$trackbacks->isEmpty()) { showComments($trackbacks, $has_action, true); } else { echo '<p>' . __('No trackback') . '</p>'; } if ($has_action) { echo '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right"><label for="action" class="classic">' . __('Selected trackbacks action:') . '</label> ' . form::combo('action', $combo_action) . form::hidden('id', $post_id) . form::hidden(array('section'), 'trackbacks') . $core->formNonce() . '<input type="submit" value="' . __('ok') . '" /></p>' . '</div>' . '</form>'; } /* Add trackbacks -------------------------------------------------------- */ if ($can_edit_post && $post->post_status) { echo '<div class="fieldset clear">'; echo '<h3>' . __('Ping blogs') . '</h3>' . '<form action="' . $core->adminurl->get("admin.post", array('id' => $post_id)) . '" id="trackback-form" method="post">' . '<p><label for="tb_urls" class="area">' . __('URLs to ping:') . '</label>' . form::textarea('tb_urls', 60, 5, $tb_urls) . '</p>' . '<p><label for="tb_excerpt" class="area">' . __('Excerpt to send:') . '</label>' . form::textarea('tb_excerpt', 60, 5, $tb_excerpt) . '</p>' . '<p>' . $core->formNonce() . '<input type="submit" name="ping" value="' . __('Ping blogs') . '" />' . (empty($_GET['tb_auto']) ? ' <a class="button" href="' . $core->adminurl->get("admin.post", array('id' => $post_id, 'tb_auto' => 1, 'tb' => 1)) . '">' . __('Auto discover ping URLs') . '</a>' : '') . '</p>' . '</form>'; $pings = $TB->getPostPings($post_id); if (!$pings->isEmpty()) { echo '<h3>' . __('Previously sent pings') . '</h3>'; echo '<ul class="nice">';
<?php require_once 'config.php'; $session->requireLoggedIn(); require 'design_head.php'; echo '<h1>Scribble</h1>'; echo showComments(COMMENT_SCRIBBLE); require 'design_foot.php';
<?php include "../universal/config.php"; //---saveComment---// if (isset($_POST["saveComment"])) { include "saveComment.php"; $result = saveComment($_POST["commentid"], $_POST["q"], $_POST["commentText"]); echo $result; } elseif (isset($_POST["editComment"])) { include "editComment.php"; $result = editComment($_POST["commentid"]); echo $result; } elseif (isset($_POST["deleteComment"])) { include "deleteComment.php"; $result = deleteComment($_POST["commentid"]); echo $result; } elseif (isset($_POST["showComments"])) { include "showComments.php"; $result = showComments($_POST["q"]); echo $result; }
<?php /** * $Id$ */ if (empty($_GET['i']) || !is_numeric($_GET['i'])) { die('bad'); } require_once 'find_config.php'; $header = new xhtml_header(); echo $header->render(); echo '<body style="background-color: #D80911;">'; echo '<center>'; echo showComments(COMMENT_FILE, $_GET['i'], 20, 3); echo '</center>';
<?php //viewarticle.php require_once "conn.php"; require_once "outputfunctions.php"; require_once "header.php"; outputStory($_GET["article"]); showComments($_GET["article"], TRUE); mysql_close($conn); require_once "footer.php";
function showSingle($id) { global $connection; include("../includes/settings.php"); if (!isset($langDefault) || ($langDefault=='')) { $langDefault = 'en'; } include("../languages/lang_".$langDefault.".php"); //query string $query = "SELECT * FROM ".$tableCollab["newsdeskposts"]." WHERE id=$id"; //store query result in a variable $result = mysql_query($query); //in case of error display friendly message if (mysql_num_rows($result) == 0) { echo "No results"; echo "\n"; return; } $row = mysql_fetch_assoc($result); //define variables $title = htmlentities ($row['title']); $content = nl2br($row['content']); //display echo "<div class='post'>"; echo "<div class=\"post-title\">"; echo "\n"; echo "$title"; echo "\n"; echo "</div>"; echo "\n"; echo "<div class=\"post-text\">"; echo "$content"; echo "\n"; echo "</div>\n"; echo "\n"; //display comments below single item showComments($id); echo "</div>\n"; }
<?php //comment.php require_once "conn.php"; require_once "outputfunctions.php"; require_once "header.php"; outputStory($_GET["article"]); ?> <h1>Add a comment:</h1> <form method="post" action="transact-article.php"> <p> Comment: <br/> <textarea id="comment" name="comment" rows="10" cols="60"></textarea> </p> <p> <input type="submit" class="submit" name="action" value="Submit Comment" /> <input type="hidden" name="article" value="<?php echo $_GET['article']; ?> " /> </p> </form> <?php showComments($_GET["article"], FALSE); mysql_close($conn); require_once "footer.php";
<?php //Show comments if admin if (checkadmin($login)) { ?> <div class="row"> <div class="jumbotron"> <div class="container"> <?php $n_comments = countnewcomments(); echo "<h1 style=\"text-align:center\">Comments (" . $n_comments . " new)</h1>"; ?> </div> </div> </div> <div class="row"> <div class="col-md-8 col-md-offset-2 aboutus"> <form action="index.php?page=notifications" role="form" method="post"> <?php require_once "utilities/userfunctions.php"; showComments(); ?> </form> </div> </div> <?php } ?> </div>
<?php require_once 'config.php'; require 'design_head.php'; echo '<h1>Pastebin</h1>'; echo showComments(COMMENT_PASTEBIN, 0, 80, 30); require 'design_foot.php';