示例#1
0
/**
 * Prints out a list of files and their comments
 *
 * @param unknown_type $rootDirs
 * @param unknown_type $relPath
 * @param unknown_type $title
 */
function print_files($rootDirs, $relPath, $title, $comments)
{
    if ($comments) {
        echo "<div><h2>{$title}</h2>";
    } else {
        echo "<div class='api-list' style='float: left;'><h2>{$title}</h2>";
    }
    foreach ($rootDirs as $dir) {
        if (!file_exists($dir . $relPath)) {
            continue;
        }
        $files = scandir($dir . $relPath);
        echo '<ul>';
        foreach ($files as $file) {
            if (!is_dir($file)) {
                echo '<li><STRONG>' . get_file_name($file) . '</STRONG></li>';
                if ($comments) {
                    echo '<li><STRONG>File Path:</STRONG> ' . $dir . DIRECTORY_SEPARATOR . $relPath . DIRECTORY_SEPARATOR . $file . '</li>';
                    echo '<li>' . getComments($dir . DIRECTORY_SEPARATOR . $relPath . DIRECTORY_SEPARATOR . $file) . '</li>';
                }
            }
        }
        echo '</ul>';
    }
    echo '</div>';
}
示例#2
0
文件: pag1.php 项目: Triumvirato/Tesi
function getVar($url, $url_comment, $url_changes, $id, $con)
{
    $content = file_get_contents($url);
    $json = json_decode($content, true);
    $creator_email = $json['bugs'][0]['creator_detail']['email'];
    $component = $json['bugs'][0]['component'];
    $assigned_email = $json['bugs'][0]['assigned_to_detail']['email'];
    $priority = $json['bugs'][0]['priority'];
    $severity = $json['bugs'][0]['severity'];
    $platform = $json['bugs'][0]['platform'];
    $op_sys = $json['bugs'][0]['op_sys'];
    $resolution = $json['bugs'][0]['resolution'];
    $status = $json['bugs'][0]['status'];
    $creation_time = $json['bugs'][0]['creation_time'];
    $last_change_time = $json['bugs'][0]['last_change_time'];
    $target_milestone = $json['bugs'][0]['target_milestone'];
    $nr_cc_detail = count($json['bugs'][0]['cc_detail']);
    $json_c = getComments($url_comment);
    $nr_comments = count($json_c['bugs'][$id]['comments']);
    $json_ch = getChanges($url_changes);
    $nr_history = count($json_ch['bugs'][0]['history']);
    //insert into mysql table
    $sql = "INSERT INTO bug\n    VALUES('{$id}', '{$creator_email}', '{$component}', '{$assigned_email}', '{$priority}', '{$severity}', '{$platform}', '{$op_sys}', '{$resolution}', '{$status}',     '{$creation_time}', '{$last_change_time}', '{$target_milestone}', '{$nr_cc_detail}','{$nr_comments}','{$nr_history}')";
    if (!mysql_query($sql, $con)) {
        die('Error : ' . mysql_error());
    } else {
        echo 'inserito';
        echo '<br>';
    }
    /* (id, creator_email, component, assigned_email, priority, platform, op_sys, resolution, status, creation_time, last_change_time, target_milestone, nr_cc_detail, nr_comments, nr_history)*/
}
示例#3
0
function CommentsBlock($ThisID, $Thiskey)
{
    global $DBConn;
    if ($Thiskey == 's') {
        $q = "SELECT * FROM comment WHERE Story_AID = " . $ThisID . " and Parent_ID=0 ORDER by ID";
    }
    if ($Thiskey == 'i') {
        $q = "SELECT * FROM comment WHERE Comment_Object_ID = " . $ThisID . " and Comment_Object_ID <> 0 and Parent_ID=0 ORDER by ID";
    }
    // comments must be wrapped in a div like this
    //	echo '<div class="commentsdialog" id="commentspop'.$Thiskey.'_'.$ThisID.'"><ul id=commentlist'.$Thiskey.'_'.$ThisID.'> ';
    echo '<ul id=commentlist' . $Thiskey . '_' . $ThisID . '> ';
    $r = mysqli_query($DBConn, $q);
    while ($row = mysqli_fetch_assoc($r)) {
        getComments($row, $ThisID, $Thiskey);
    }
    echo '</ul>';
    echo '<br><div class="smaller" id="replyto_' . $Thiskey . '_' . $ThisID . '"></div>';
    echo '<a href="" onclick="javascript: return false;" title="Add Comment"><img class="submit_button" id="submit_button' . $Thiskey . '_' . $ThisID . '" src="images/add.png"></a>';
    echo ' <textarea class="w80 commenth" name="comment_text_' . $ThisID . '" rows="3" cols="80" id="comment_text_' . $ThisID . '"></textarea>  ';
    echo ' <input type="hidden" name="User_Name" id="User_Name_' . $ThisID . '' . '" value="' . $_SESSION['Name'] . '"/>  ';
    echo ' <input type="hidden" name="Parent_ID" id="Parent_ID_' . $Thiskey . '_' . $ThisID . '" value="0"/>  ';
    echo ' <input type="hidden" name="Iteration_ID" id="CIteration_ID" value="' . $_REQUEST['IID'] . '"/>  ';
    // remember that this is not the Story_AID for iterations it is the Comment_Object_ID
    // being a lazy beggar it this is just easier
    echo ' <input type="hidden" name="Story_AID" id="Story_AID_' . $ThisID . '' . '" value="' . $ThisID . '"/>  ';
    //	echo ' <input type="hidden" name="PID" id="Story_PID_'.$ThisID.''.'" value="'.$_REQUEST['PID'].'"/>  ';
    //	echo '</div>  ';
}
示例#4
0
function getVar($url, $url_comment, $url_changes, $id, $con, $collection)
{
    $json = acquisisci($url);
    //richiama la curl
    $creator_email = $json['bugs'][0]['creator_detail']['email'];
    $component = $json['bugs'][0]['component'];
    $assigned_email = $json['bugs'][0]['assigned_to_detail']['email'];
    $priority = $json['bugs'][0]['priority'];
    $severity = $json['bugs'][0]['severity'];
    $platform = $json['bugs'][0]['platform'];
    $op_sys = $json['bugs'][0]['op_sys'];
    $resolution = $json['bugs'][0]['resolution'];
    $status = $json['bugs'][0]['status'];
    $creation_time = $json['bugs'][0]['creation_time'];
    $last_change_time = $json['bugs'][0]['last_change_time'];
    $target_milestone = $json['bugs'][0]['target_milestone'];
    $nr_cc_detail = count($json['bugs'][0]['cc_detail']);
    $json_c = getComments($url_comment);
    $nr_comments = count($json_c['bugs'][$id]['comments']);
    $json_ch = getChanges($url_changes);
    $nr_history = count($json_ch['bugs'][0]['history']);
    /*insert into mysql table
        $sql = "INSERT INTO bug
        VALUES('$id', '$creator_email', '$creator_email', '$assigned_email', '$priority', '$severity', '$platform', '$op_sys', '$resolution', '$status',     '$creation_time', '$last_change_time', '$target_milestone', '$nr_cc_detail','$nr_comments','$nr_history')";
        if(!mysql_query($sql,$con))
        {
            die('Error : ' . mysql_error());
        }
        else
        {
            echo 'inserito';
            echo '<br>';
        }
    	
    	*/
    $collection->insert($json);
    /*
    	//inserisco un documento nella collection appena selezionata
       $document = array( 
          "id" => $id, 
          "creator_email" => $creator_email, 
          "assigned_email" => $assigned_email,
          "priority" => $priority,
          "severity", $severity,
    	  "platform" => $platform, 
          "op_sys" => $op_sys,
          "resolution" => $resolution,
    	  "status" => $status, 
          "creation_time" => $creation_time,
          "last_change_time" => $last_change_time,
    	  "target_milestone" => $target_milestone,
          "nr_cc_detail" => $nr_cc_detail,
    	  "nr_comments" => $nr_comments, 
          "nr_history" => $nr_history
       );
       $collection->insert($document);
       echo "<br>Document inserted successfully";
    */
}
示例#5
0
function showComments($option = '')
{
    $pageComments = $_POST['commentPage'];
    if (empty($pageComments)) {
        $pageComments = 1;
    }
    $comments = getComments($option, $pageComments);
    return $comments;
}
示例#6
0
function interpretRequest($method, $data)
{
    if ($method == 'getsubreddit') {
        sendJsonObject(getSubreddit($data));
    }
    if ($method == 'getcomments') {
        sendJsonObject(getComments($data));
    }
}
示例#7
0
 protected function OnOutput()
 {
     if (isClosed($this->id) && $_SESSION['role'] == '2') {
         $vars = array('claim' => $this->claiminfo, 'comment' => getComments($this->id));
         $this->content = $this->Template('application/views/claims/close.php', $vars);
     } else {
         $com = getComments($this->id);
         $vars = array('claim' => $this->claiminfo, 'comment' => $com);
         $this->content = $this->Template('application/views/claims/editclaim.php', $vars);
     }
     parent::OnOutput();
 }
 public function getMain()
 {
     global $config;
     $output = "";
     $output .= "<h2>Recent comments</h2>";
     $output .= "<p>There are currently " . $this->commentsCount . " comments. ";
     $output .= "You are now displaying comments " . ($this->page - 1) * $config["comments per page"] . " to " . min($this->page * $config["comments per page"], $this->commentsCount) . " in reverse chronological order.</p>";
     $comments = getComments($this->db, ($this->page - 1) * $config["comments per page"], $config["comments per page"]);
     $output .= "<ul>";
     foreach ($comments as $comment) {
         $output .= printComment($comment);
     }
     $output .= "</ul>";
     return $output;
 }
示例#9
0
文件: comments.php 项目: lmcro/fcms
/**
 * displayComments 
 * 
 * Valid params:
 *
 *  currentUserId - The current user's id.
 *  id            - The id of the thing we are commenting on.
 *  header        - The header for the entire comments block. Defaults to ''.
 *  label         - The label for the text area. Defaults to 'Add Comment'.
 *  submit        - The value for the submit button. Defaults to 'Comment'.
 *  submitClass   - The class for the style of the submit button.  Defaults to 'sub1'.
 *  hidden        - An array of hidden inputs for the add form. Key is name, value is value.
 * 
 * @param string $url 
 * @param string $type
 * @param array  $params 
 * 
 * @return void
 */
function displayComments($url, $type, $params = null)
{
    $addForm = getAddCommentsForm($url, $params);
    $comments = getComments($url, $type, $params);
    $header = '';
    if (isset($params['header'])) {
        $header = '<h2>' . $params['header'] . '</h2>';
    }
    echo '
        <div id="comments">
            ' . $header . '
            ' . $comments . '
            ' . $addForm . '
        </div>';
}
示例#10
0
function getComments($row)
{
    echo "<div class='media'>";
    echo "<div class='media-body'>\n\t\t\t<h4 class='media-heading'>" . $row['author'] . "</h4>";
    echo $row['comment'];
    echo "<div class='col-md-12 commeta-option'>\n\t\t\t<span class='pull-left commeta-reply'>\n\t\t\t<a class='reply' href='#comment_form' id='" . $row['id'] . "'> Reply </a>\n\t\t\t</span>\n\t\t\t<span class='pull-right'>\n\t\t\t\t" . $row['created_at'] . "\n\t\t\t</span>\n\t\t\t";
    echo "</div>";
    $q = "SELECT * FROM comment WHERE parent_id = " . $row['id'] . "";
    $r = mysql_query($q);
    if (mysql_num_rows($r) > 0) {
        while ($row = mysql_fetch_assoc($r)) {
            getComments($row);
        }
    }
    echo "</div></div>";
}
示例#11
0
function postComment($comment)
{
    session_start();
    global $con;
    try {
        $sql = "INSERT INTO `sports_comments` (`ID`, `USER`, `COMMENT`) VALUES (NULL, :user, :comment)";
        $sql = $con->prepare($sql);
        $sql->bindParam(':user', $_SESSION['username']);
        $sql->bindParam(':comment', $comment);
        $sql->execute();
    } catch (PDOException $e) {
        echo $e;
        return;
    }
    buildCommentSection(getComments());
}
示例#12
0
function getComments(&$reply, $conn)
{
    $stmnt = $conn->prepare("select id, created, name, username, content, reply_to from threads where reply_to = :id");
    $stmnt->bindParam(":id", $reply["id"], PDO::PARAM_INT);
    $stmnt->execute();
    $results = $stmnt->fetchAll(PDO::FETCH_ASSOC);
    if (sizeof($results) > 0) {
        //        foreach ($results as $new) {
        //            getComments($new, $conn);
        //        }
        for ($i = 0; $i < sizeof($results); $i++) {
            getComments($results[$i], $conn);
        }
        $reply["replies"] = $results;
    }
}
示例#13
0
function postComment($comment)
{
    session_start();
    global $con;
    try {
        $sql = "INSERT INTO `comments` (`id`, `title_id`, `title`, `username`, `comment`) VALUES (NULL, :title_id, :title, :name, :comment)";
        $sql = $con->prepare($sql);
        $sql->bindParam(':title_id', $_SESSION['title_id']);
        $sql->bindParam(':title', $_SESSION['title']);
        $sql->bindParam(':name', $_SESSION['username']);
        $sql->bindParam(':comment', $comment);
        $sql->execute();
    } catch (PDOException $e) {
        echo $e;
        return;
    }
    buildCommentSection(getComments());
}
示例#14
0
文件: video.php 项目: lindaqq/MeTube
if (isset($username) && isset($_GET["commentid"])) {
    $commentid = $_GET["commentid"];
    rmComment($commentid);
}
if (isset($username) && $_SERVER["REQUEST_METHOD"] == "POST") {
    if (!empty($_POST["playlist"])) {
        foreach ($_POST["playlist"] as $playlistid) {
            addPlaylistMedia($playlistid, $mediaid);
        }
    }
    if (!empty($_POST["comment"])) {
        $content = $_POST["comment"];
        addComment($username, $mediaid, $content);
    }
    if (!empty($_POST["rate"])) {
        $score = $_POST["rate"];
        rateMedia($mediaid, $username, $score);
    }
}
$recommend = recommend($mediaid, 8);
$media = viewMedia($mediaid);
$comments = getComments($mediaid);
if (isset($username) && isset($_GET["subscribe"])) {
    $subscriber_id = $username;
    $channel_id = $media['username'];
    if ($subscriber_id != $channel_id) {
        addChannel($subscriber_id, $channel_id);
    }
}
render("video_template.php", ["media" => $media, "comments" => $comments, "mediaid" => $mediaid, "recommend" => $recommend, "playlists" => $playlists, "Category" => $Category, "Keywords" => $Keywords]);
$db->sql_close();
示例#15
0
         case "PATCH":
             $data["goalID"] = $path[1];
             $results = editGoal($data);
             break;
         case "DELETE":
             $data["goalID"] = $path[1];
             $results = deleteGoal($data);
             break;
         default:
             $results["meta"] = methodNotAllowed($method, $path);
     }
     break;
 case "comments":
     switch ($method) {
         case "GET":
             $results = getComments($data);
             break;
         case "POST":
             $results = addComment($data);
             break;
         case "PATCH":
             $data["commentID"] = $path[1];
             $results = editComment($data);
             break;
         case "DELETE":
             $data["commentID"] = $path[1];
             $results = deleteComment($data);
             break;
         default:
             $results["meta"] = methodNotAllowed($method, $path);
     }
示例#16
0
                    <div class="comment-area">
                        <form action="" id="comment-form">
                            <div class="form-item no-height"><textarea class="comment-textarea" data-id="<?php 
        echo $project['project_id'];
        ?>
"></textarea></div>
                            <!--<div class="form-item"><input type="submit" value="Add" class="project-action-btn" id="add-comment-btn" data-id="<?php 
        echo $project['project_id'];
        ?>
"></div>-->
                        </form>

                        <div class="inbox-messages">
                            <?php 
        $messages = getComments($project['project_id']);
        if ($messages) {
            foreach ($messages as $ix => $m) {
                ?>
                                    <div class="message-item <?php 
                if ($ix % 2 == 0) {
                    echo 'odd';
                }
                ?>
" data-id="<?php 
                echo $ix;
                ?>
">
                                        <div class="message-author">
                                            <?php 
                $u = getUserData($m['created_by']);
示例#17
0
function printIphoneCommentView($entryId, $page = null, $mode = null)
{
    global $blogURL, $blogid, $skinSetting, $paging;
    if ($mode == 'recent') {
        // Recent comments
        list($comments, $paging) = getCommentsWithPaging($blogid, $page, 10, null, '?page=');
    } else {
        if (!is_null($page)) {
            // Guestbook
            list($comments, $paging) = getCommentsWithPagingForGuestbook($blogid, $page, $skinSetting['commentsOnGuestbook']);
        } else {
            // Comments related to specific article
            $comments = getComments($entryId);
        }
    }
    if (count($comments) == 0) {
        ?>
		<p>&nbsp;<?php 
        echo $entryId == 0 ? _text('방명록이 없습니다') : _text('댓글이 없습니다');
        ?>
</p>
		<?php 
    } else {
        foreach ($comments as $commentItem) {
            ?>
		<ul id="comment_<?php 
            echo $commentItem['id'];
            ?>
" class="comment">
			<li class="group">
				<span class="left">
					<?php 
            if (!empty($commentItem['name'])) {
                ?>
<strong><?php 
                echo htmlspecialchars($commentItem['name']);
                ?>
</strong><?php 
            }
            ?>
					(<?php 
            echo Timestamp::format5($commentItem['written']);
            ?>
)
				</span>
				<span class="right">
					<a href="<?php 
            echo $blogURL;
            ?>
/comment/comment/<?php 
            echo $commentItem['id'];
            ?>
"><?php 
            echo $entryId == 0 ? _text('방명록에 댓글 달기') : _text('댓글에 댓글 달기');
            ?>
</a> :
					<a href="<?php 
            echo $blogURL;
            ?>
/comment/delete/<?php 
            echo $commentItem['id'];
            ?>
"><?php 
            echo _text('지우기');
            ?>
</a>
				</span>
			</li>
			<li class="body">
				<?php 
            echo ($commentItem['secret'] && doesHaveOwnership() ? '<div class="hiddenComment" style="font-weight: bold; color: #e11">' . ($entryId == 0 ? _text('비밀 방명록') : _text('비밀 댓글')) . ' &gt;&gt;</div>' : '') . nl2br(addLinkSense(htmlspecialchars($commentItem['comment'])));
            ?>
			</li>
			<?php 
            foreach (getCommentComments($commentItem['id']) as $commentSubItem) {
                ?>
			<li class="groupSub">
				<span class="left">&nbsp;Re :
					<?php 
                if (!empty($commentSubItem['name'])) {
                    ?>
<strong><?php 
                    echo htmlspecialchars($commentSubItem['name']);
                    ?>
</strong><?php 
                }
                ?>
					(<?php 
                echo Timestamp::format5($commentSubItem['written']);
                ?>
)
				</span>
				<span class="right">
					<a href="<?php 
                echo $blogURL;
                ?>
/comment/delete/<?php 
                echo $commentSubItem['id'];
                ?>
">DEL</a><br />
				</span>
			</li>
			<li class="body">
				<?php 
                echo ($commentSubItem['secret'] && doesHaveOwnership() ? '<div class="hiddenComment" style="font-weight: bold; color: #e11">' . _t('Secret Comment') . ' &gt;&gt;</div>' : '') . nl2br(addLinkSense(htmlspecialchars($commentSubItem['comment'])));
                ?>
			</li>
			<?php 
            }
            ?>
		</ul>
		<?php 
        }
    }
    if ($mode != 'recent') {
        printIphoneCommentFormView($entryId, $entryId == 0 ? _text('방명록 쓰기') : _text('댓글 쓰기'), 'comment');
    }
}
示例#18
0
            if ($result == null) {
                $reply['status'] = "empty";
            } else {
                $reply['status'] = "fail";
            }
        }
    } else {
        $reply['status'] = "invalid";
    }
}
//Get comments of an activity
if (isset($_REQUEST['action']) && $_REQUEST['action'] == "comment") {
    $result = array();
    $noOfComments = getNoOfComments($pdo);
    if ($noOfComments != 0) {
        $result = getComments($pdo);
        if ($result != null) {
            $reply['status'] = "success";
            $reply['total_c'] = $noOfComments;
            $reply['comment'] = $result;
        } else {
            $reply['status'] = "fail";
        }
    } else {
        $reply['status'] = "success";
        $reply['total_c'] = "No";
        $reply['comment'] = $result;
    }
}
//Add a new comment to an activity
if (isset($_REQUEST['action']) && $_REQUEST['action'] == "addcomment") {
示例#19
0
function getCommentView($entry, $skin, $inputBlock = true, $page = 1, $count = null, $listBlock = true)
{
    global $contentContainer;
    static $dressCommentBlock = false;
    $context = Model_Context::getInstance();
    if (is_null($count)) {
        if ($context->getProperty('skin.commentsOnEntry')) {
            $count = $context->getProperty('skin.commentsOnEntry');
        } else {
            $count = 15;
        }
    }
    if (!isset($entry)) {
        $entry['id'] = 0;
    }
    $blogid = getBlogId();
    importlib("model.common.setting");
    importlib("model.blog.entry");
    importlib("model.blog.comment");
    importlib('blogskin');
    $authorized = doesHaveOwnership();
    $useAjaxBlock = $context->getProperty('blog.useAjaxComment', true);
    $useMicroformat = $context->getProperty('blog.useMicroformat', 3);
    $fn = '';
    $fn_nickname = '';
    if ($useMicroformat > 1) {
        $fn = 'class="fn url nickname" ';
        $fn_nickname = 'class="fn nickname" ';
    }
    if ($entry['id'] > 0) {
        $prefix1 = 'rp';
        $isComment = true;
    } else {
        $prefix1 = 'guest';
        $isComment = false;
    }
    $commentView = $isComment ? $skin->comment : $skin->guest;
    $commentItemsView = '';
    if ($listBlock === true) {
        if ($isComment == false) {
            global $comments;
            if (!isset($comments)) {
                list($comments, $paging) = getCommentsWithPagingForGuestbook($blogid, $context->getProperty('suri.page'), $context->getProperty('skin.commentsOnGuestbook'));
            }
            foreach ($comments as $key => $value) {
                if ($value['secret'] == 1) {
                    if (!$authorized) {
                        if (!doesHaveOpenIDPriv($value)) {
                            $comments[$key]['name'] = _text('비밀방문자');
                            $comments[$key]['homepage'] = '';
                            $comments[$key]['comment'] = _text('관리자만 볼 수 있는 방명록입니다.');
                        } else {
                            $comments[$key]['name'] = _text('비밀방문자') . ' ' . $comments[$key]['name'];
                        }
                    }
                }
            }
        } else {
            if ($useAjaxBlock) {
                list($comments, $paging) = getCommentsWithPagingByEntryId($blogid, $entry['id'], $page, $count, 'loadComment', '(' . $entry['id'] . ',', ',true,true);return false;', null, $context->getProperty('skin.sortCommentsBy', 'ASC'));
            } else {
                $comments = getComments($entry['id'], $context->getProperty('skin.sortCommentsBy', 'ASC'));
            }
        }
        if (empty($skin->dressCommentBlock)) {
            if ($dressCommentBlock) {
                if ($isComment) {
                    $skin->commentGuest = $dressCommentBlock;
                } else {
                    $skin->guestGuest = $dressCommentBlock;
                }
            } else {
                if ($isComment) {
                    $dressCommentBlock = $skin->commentGuest = addOpenIDPannel($skin->commentGuest, 'rp');
                } else {
                    $dressCommentBlock = $skin->guestGuest = addOpenIDPannel($skin->guestGuest, 'guest');
                }
            }
            $skin->dressCommentBlock = true;
        }
        /// Dressing comments
        foreach ($comments as $commentItem) {
            $commentItemView = $isComment ? $skin->commentItem : $skin->guestItem;
            $commentSubItemsView = '';
            $subComments = getCommentComments($commentItem['id'], $commentItem);
            foreach ($subComments as $commentSubItem) {
                $commentSubItemView = $isComment ? $skin->commentSubItem : $skin->guestSubItem;
                $commentSubItem['name'] = htmlspecialchars($commentSubItem['name']);
                $commentSubItem['comment'] = htmlspecialchars($commentSubItem['comment']);
                $rp_class = $prefix1 . '_general';
                if ($blogid == $commentSubItem['replier']) {
                    $rp_class = $prefix1 . '_admin';
                } else {
                    if ($commentSubItem['secret'] == 1) {
                        $rp_class = $prefix1 . '_secret';
                        if ($authorized) {
                            $commentSubItem['comment'] = '<span class="hiddenCommentTag_content">' . _text('[비밀댓글]') . '</span> ' . $commentSubItem['comment'];
                        } else {
                            $rp_class .= ' hiddenComment';
                            $commentSubItem['name'] = '<span class="hiddenCommentTag_name">' . _text('비밀방문자') . '</span>' . (doesHaveOpenIDPriv($commentSubItem) ? ' ' . $commentSubItem['name'] : '');
                        }
                    }
                }
                dress($prefix1 . '_rep_class', $rp_class, $commentSubItemView);
                if (dress($prefix1 . '_rep_id', ($entry['id'] == 0 ? 'guestbook' : 'comment') . $commentSubItem['id'], $commentSubItemView) == false) {
                    $commentSubItemView = "<a id=\"comment{$commentSubItem['id']}\"></a>" . $commentSubItemView;
                }
                if (empty($commentSubItem['homepage']) || $commentSubItem['secret'] == 1 && !doesHaveOwnership()) {
                    dress($prefix1 . '_rep_name', fireEvent($isComment ? 'ViewCommenter' : 'ViewGuestCommenter', "<span {$fn_nickname}>" . $commentSubItem['name'] . "</span>", $commentSubItem), $commentSubItemView);
                } else {
                    dress($prefix1 . '_rep_name', fireEvent($isComment ? 'ViewCommenter' : 'ViewGuestCommenter', '<a ' . $fn . 'rel="external nofollow" href="' . htmlspecialchars(addProtocolSense($commentSubItem['homepage'])) . '" onclick="return openLinkInNewWindow(this)">' . $commentSubItem['name'] . '</a>', $commentSubItem), $commentSubItemView);
                }
                $contentContainer["{$prefix1}_{$commentSubItem['id']}"] = fireEvent($isComment ? 'ViewCommentContent' : 'ViewGuestCommentContent', nl2br(addLinkSense($commentSubItem['comment'], ' onclick="return openLinkInNewWindow(this)"')), $commentSubItem);
                dress($prefix1 . '_rep_desc', setTempTag("{$prefix1}_{$commentSubItem['id']}"), $commentSubItemView);
                dress($prefix1 . '_rep_date', fireEvent($isComment ? 'ViewCommentDate' : 'ViewGuestCommentDate', Timestamp::format5($commentSubItem['written']), $commentSubItem['written']), $commentSubItemView);
                dress($prefix1 . '_rep_link', $context->getProperty('uri.blog') . "/" . ($entry['id'] == 0 ? "guestbook/{$commentItem['id']}#guestbook{$commentSubItem['id']}" : ($context->getProperty('blog.useSloganOnPost') ? "entry/" . URL::encode($entry['slogan'], $context->getProperty('service.useEncodedURL')) : $entry['id']) . "#comment{$commentSubItem['id']}"), $commentSubItemView);
                dress($prefix1 . '_rep_onclick_delete', "deleteComment({$commentSubItem['id']}); return false;", $commentSubItemView);
                $commentSubItemsView .= $commentSubItemView;
            }
            $commentSubContainer = $isComment ? $skin->commentSubContainer : $skin->guestSubContainer;
            dress($isComment ? 'rp2_rep' : 'guest_reply_rep', $commentSubItemsView, $commentSubContainer);
            if (count($subComments) > 0) {
                dress($isComment ? 'rp2_container' : 'guest_reply_container', $commentSubContainer, $commentItemView);
            }
            $commentItem['name'] = htmlspecialchars($commentItem['name']);
            $commentItem['comment'] = htmlspecialchars($commentItem['comment']);
            $rp_class = $prefix1 . '_general';
            if ($blogid == $commentItem['replier']) {
                $rp_class = $prefix1 . '_admin';
            } else {
                if ($commentItem['secret'] == 1) {
                    $rp_class = $prefix1 . '_secret';
                    if ($authorized) {
                        $commentItem['comment'] = '<span class="hiddenCommentTag_content">' . _text('[비밀댓글]') . '</span> ' . $commentItem['comment'];
                    } else {
                        $rp_class .= ' hiddenComment';
                        $commentItem['name'] = '<span class="hiddenCommentTag_name">' . _text('비밀방문자') . '</span>' . (doesHaveOpenIDPriv($commentItem) ? ' ' . $commentItem['name'] : '');
                    }
                }
            }
            dress($prefix1 . '_rep_class', $rp_class, $commentItemView);
            if (dress($prefix1 . '_rep_id', ($entry['id'] == 0 ? 'guestbook' : 'comment') . $commentItem['id'], $commentItemView) == false) {
                $commentItemView = "<a id=\"comment{$commentItem['id']}\"></a>" . $commentItemView;
            }
            if (empty($commentItem['homepage']) || $commentItem['secret'] == 1 && !doesHaveOwnership()) {
                dress($prefix1 . '_rep_name', fireEvent($isComment ? 'ViewCommenter' : 'ViewGuestCommenter', "<span {$fn_nickname}>" . $commentItem['name'] . "</span>", $commentItem), $commentItemView);
            } else {
                dress($prefix1 . '_rep_name', fireEvent($isComment ? 'ViewCommenter' : 'ViewGuestCommenter', '<a ' . $fn . 'rel="external nofollow" href="' . htmlspecialchars(addProtocolSense($commentItem['homepage'])) . '" onclick="return openLinkInNewWindow(this)">' . $commentItem['name'] . '</a>', $commentItem), $commentItemView);
            }
            $contentContainer["{$prefix1}_{$commentItem['id']}"] = fireEvent($isComment ? 'ViewCommentContent' : 'ViewGuestCommentContent', nl2br(addLinkSense($commentItem['comment'], ' onclick="return openLinkInNewWindow(this)"')), $commentItem);
            dress($prefix1 . '_rep_desc', setTempTag("{$prefix1}_{$commentItem['id']}"), $commentItemView);
            dress($prefix1 . '_rep_date', fireEvent($isComment ? 'ViewCommentDate' : 'ViewGuestCommentDate', Timestamp::format5($commentItem['written']), $commentItem['written']), $commentItemView);
            if (!$context->getProperty('blog.acceptComments', true) || $prefix1 == 'guest' && $authorized != true && $context->getProperty('blog.allowWriteDblCommentOnGuestbook') == 0) {
                $doubleCommentPermissionScript = 'alert(\'' . _text('댓글을 사용할 수 없습니다.') . '\'); return false;';
            } else {
                $doubleCommentPermissionScript = '';
            }
            dress($prefix1 . '_rep_onclick_reply', $doubleCommentPermissionScript . "commentComment({$commentItem['id']}); return false", $commentItemView);
            dress($prefix1 . '_rep_onclick_delete', "deleteComment({$commentItem['id']});return false", $commentItemView);
            dress($prefix1 . '_rep_link', $context->getProperty('uri.blog') . "/" . ($entry['id'] == 0 ? "guestbook/{$commentItem['id']}#guestbook{$commentItem['id']}" : ($context->getProperty('blog.useSloganOnPost') ? "entry/" . URL::encode($entry['slogan'], $context->getProperty('service.useEncodedURL')) : $entry['id']) . "?commentId=" . $commentItem['id'] . "#comment{$commentItem['id']}"), $commentItemView);
            $commentItemsView .= $commentItemView;
        }
        /// Merging comments with its paging links.
        $commentContainer = $isComment ? $skin->commentContainer : $skin->guestContainer;
        dress($isComment ? 'rp_rep' : 'guest_rep', $commentItemsView, $commentContainer);
        if (count($comments) > 0) {
            if ($isComment && $useAjaxBlock) {
                $pagingView = Paging::getPagingView($paging, $skin->paging, $skin->pagingItem, false, 'onclick');
            } else {
                $pagingView = '';
            }
            dress($prefix1 . '_container', "<div id=\"entry" . $entry['id'] . "CommentList\">" . $commentContainer . $pagingView . "</div>", $commentView);
        }
    } else {
        dress($prefix1 . '_container', '', $commentView);
    }
    /// Comment write block
    if ($inputBlock == true) {
        if (!empty($entry['acceptcomment'])) {
            $acceptcomment = $entry['acceptcomment'];
        } else {
            $pool = DBModel::getInstance();
            $pool->reset('Entries');
            $pool->setQualifier('blogid', 'equals', $blogid);
            $pool->setQualifier('id', 'equals', $entry['id']);
            $pool->setQualifier('draft', 'equals', 0);
            $acceptcomment = $pool->getCell('acceptcomment');
        }
        $useForm = false;
        $openid_identity = Acl::getIdentity('openid');
        if ($isComment) {
            if (!($skin->commentForm == '')) {
                $commentRrevView = $commentView;
                /// Comment Lists.
                $commentView = $skin->commentForm;
                /// Comment write block.
                $useForm = true;
            }
        } else {
            if (!($skin->guestForm == '')) {
                $commentRrevView = $commentView;
                $commentView = $skin->guestForm;
                $useForm = true;
            }
        }
        $default_guestname = '';
        $default_homepage = '';
        if (doesHaveOwnership() || $isComment && $acceptcomment == 1 && Setting::getBlogSettingGlobal('acceptComments', 1) || $isComment == false || $useForm == false) {
            $commentMemberView = $isComment ? $skin->commentMember : $skin->guestMember;
            if (!doesHaveMembership()) {
                $commentGuestView = $isComment ? $skin->commentGuest : $skin->guestGuest;
                dress($prefix1 . '_input_name', 'name', $commentGuestView);
                dress($prefix1 . '_input_password', 'password', $commentGuestView);
                dress($prefix1 . '_input_homepage', 'homepage', $commentGuestView);
                if (!empty($_POST["name_{$entry['id']}"])) {
                    $guestName = htmlspecialchars($_POST["name_{$entry['id']}"]);
                } else {
                    if (!empty($_SESSION['openid']['nickname'])) {
                        $guestName = htmlspecialchars($_SESSION['openid']['nickname']);
                    } else {
                        if (!empty($_COOKIE[$context->getProperty('service.cookie_prefix') . 'guestName'])) {
                            $guestName = htmlspecialchars($_COOKIE[$context->getProperty('service.cookie_prefix') . 'guestName']);
                        } else {
                            $guestName = '';
                        }
                    }
                }
                dress('guest_name', $guestName, $commentGuestView);
                if (!empty($_POST["homepage_{$entry['id']}"]) && $_POST["homepage_{$entry['id']}"] != 'http://') {
                    if (strpos($_POST["homepage_{$entry['id']}"], 'http://') === 0) {
                        $guestHomepage = htmlspecialchars($_POST["homepage_{$entry['id']}"]);
                    } else {
                        $guestHomepage = 'http://' . htmlspecialchars($_POST["homepage_{$entry['id']}"]);
                    }
                } else {
                    if (!empty($_SESSION['openid']['homepage'])) {
                        $guestHomepage = htmlspecialchars($_SESSION['openid']['homepage']);
                    } else {
                        if (!empty($_COOKIE[$context->getProperty('service.cookie_prefix') . 'guestHomepage'])) {
                            $guestHomepage = htmlspecialchars($_COOKIE[$context->getProperty('service.cookie_prefix') . 'guestHomepage']);
                        } else {
                            $guestHomepage = 'http://';
                        }
                    }
                }
                dress('guest_homepage', $guestHomepage, $commentGuestView);
                dress($prefix1 . ($isComment ? '_guest' : '_form'), $commentGuestView, $commentMemberView);
            }
            dress($prefix1 . '_input_is_secret', 'secret', $commentMemberView);
            dress($prefix1 . '_member', $commentMemberView, $commentView);
            dress($prefix1 . '_input_comment', 'comment', $commentView);
            dress($prefix1 . '_onclick_submit', "addComment(this, {$entry['id']}); return false;", $commentView);
            dress($prefix1 . '_textarea_body', 'comment', $commentView);
            dress($prefix1 . '_textarea_body_value', '', $commentView);
        } else {
            if ($useForm == true) {
                $commentView = '';
            }
        }
        if ($useForm == true) {
            dress($prefix1 . '_input_form', "<form id=\"entry" . $entry['id'] . "WriteComment\" method=\"post\" action=\"" . $context->getProperty('uri.blog') . "/comment/add/{$entry['id']}\" onsubmit=\"return false\" style=\"margin: 0\">" . $commentView . '</form>', $commentRrevView);
            $commentView = $commentRrevView;
        } else {
            $commentView = "<form id=\"entry" . $entry['id'] . "WriteComment\" method=\"post\" action=\"" . $context->getProperty('uri.blog') . "/comment/add/{$entry['id']}\" onsubmit=\"return false\" style=\"margin: 0\">" . $commentView . '</form>';
        }
    } else {
        dress($prefix1 . '_input_form', "", $commentView);
    }
    /// Adding feed links.
    dress('article_rep_rp_atomurl', $context->getProperty('uri.default') . '/atom/comment/' . $entry['id'], $commentView);
    dress('article_rep_rp_rssurl', $context->getProperty('uri.default') . '/rss/comment/' . $entry['id'], $commentView);
    return $commentView;
}
示例#20
0
function navigationBar($id, $title, $loc)
{
    global $NEXT, $PREV, $tstamp, $CHARSET;
    $navClass = $NEXT[1] || $PREV[1] ? 'manual-navigation' : 'manual-navigation manual-navigation-no-nav';
    echo "<!-- START MANUAL NAVIGATION -->\n";
    echo "<div class=\"{$navClass}\" id=\"manual-navigation-{$loc}\">\n";
    if ($PREV[1]) {
        $link = $PREV[1];
        if (strlen($link) > 45) {
            $link = str_replace('::', '::<br />', $link);
        }
        // not using make_link because of embedded <span>
        $accesskey = $loc == 'top' ? ' accesskey="r"' : '';
        echo " <a class=\"manual-previous\" href=\"{$PREV[0]}\"{$accesskey}>";
        echo $link . "\n";
        echo '<span class="title">(P<span class="accesskey">r</span>evious)</span>';
        echo "</a>\n";
    }
    echo "\n";
    if ($NEXT[1]) {
        $link = $NEXT[1];
        if (strlen($link) > 45) {
            $link = str_replace('::', '::<br />', $link);
        }
        // not using make_link because of embedded <span>
        $accesskey = $loc == 'top' ? ' accesskey="x"' : '';
        echo " <a class=\"manual-next\" href=\"{$NEXT[0]}\"{$accesskey}>";
        echo $link . "\n";
        echo '<span class="title">(Ne<span class="accesskey">x</span>t)</span>';
        echo "</a>\n";
    }
    echo "\n";
    echo " <div class=\"manual-clear\"></div>\n";
    if ($loc == 'bottom') {
        // info and download links
        echo " <div class=\"manual-info\">";
        echo "Last updated: {$tstamp}";
        // UTF-8 em-dash
        echo " — " . make_link('/manual/', 'Download Documentation');
        echo "</div>\n";
        echo "\n";
        // bug report links
        $package_name = getPackageNameForId($id);
        echo " <div class=\"manual-bug\">\n";
        echo '  Do you think that something on this page is wrong?';
        echo '  Please <a href="' . getBugReportLink($package_name) . '">file a bug report</a> ';
        echo '  or <a href="/notes/add-note-form.php?redirect=' . htmlentities($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8') . '&amp;uri=' . htmlspecialchars(urlencode($id)) . '">add a note</a>. ';
        echo "\n";
        echo " </div>\n";
        echo "\n";
        // language chooser
        global $LANGUAGES, $LANG;
        $langs = array();
        foreach ($LANGUAGES as $code => $name) {
            if (file_exists("../{$code}/{$id}")) {
                $langs[] = array('code' => $code, 'title' => $name, 'link' => make_link("../{$code}/{$id}", $name));
            }
        }
        $file = substr($id, 0, -4);
        if (file_exists("html/{$file}.html")) {
            $langs[] = array('code' => null, 'title' => 'Plain HTML', 'link' => make_link("html/{$file}.html", 'Plain HTML'));
        }
        if (count($langs)) {
            echo " <div class=\"manual-languages\">\n";
            echo 'View this page in:';
            echo "  <ul class=\"manual-language-list\">\n";
            $count = 0;
            foreach ($langs as $lang) {
                echo "   <li class=\"manual-language\">";
                if ($count > 0) {
                    // UTF-8 bullet
                    echo " &nbsp;•&nbsp; ";
                }
                if ($lang['code'] == $LANG) {
                    echo '<strong>' . $lang['title'] . '</strong>';
                } else {
                    echo $lang['link'];
                }
                echo "</li>\n";
                $count++;
            }
            echo "  </ul>\n";
            echo " </div>\n";
        }
        echo "\n";
        // user notes
        echo " <div class=\"manual-notes\" id=\"user-notes\">\n";
        echo "  <h3>User Notes:</h3>\n";
        echo "  " . getComments($id) . "\n";
        echo " </div>\n";
    }
    echo "</div>\n<!-- END MANUAL NAVIGATION -->\n\n";
}
示例#21
0
    </div>
    <div class = "newsDiv">
        <?php 
echo $currentNews['text'];
?>
    </div>
    <div class = "commentsDate">
        <?php 
echo reverseDate($currentNews['date'], "-");
?>
    </div>
    
    <!-- Комментарии -->
    <h3>Комментарии</h3>
    <?php 
$comments = getComments($newsId);
foreach ($comments as $comment) {
    ?>
        <div class = "commentsDiv">
            <i><?php 
    echo getNicknameById($comment['user']) . ":";
    ?>
</i>
            <?php 
    echo $comment['text'];
    ?>
            <div class = "commentsDate">
                <?php 
    echo $comment['date'];
    ?>
            </div>
示例#22
0
if (!$_GET["close"]) {
    require_once CONFIG_DIR . $_SESSION["lang"] . ".translation.inc";
    $objStructure->fnInclude();
    if (!$_GET["action"]) {
        $_GET["action"] = "view";
    }
    $arrSetRights = $objUserRights->fnGetRights("", $_SESSION["user"]->ID);
    $arrGlobalRights = $objStructure->fnGetNode(1, "rights", "", "", $arrSetRights);
    if (@in_array($_GET["action"], array("update"))) {
        if ($arrGlobalRights[$_GET["ID"]] == "write") {
            include MODULE_DIR . "structure/actions.position.inc";
        } else {
            $_GET["action"] = "view";
            $strError = $arrTranslation["error"]["noprivileges"];
        }
    }
    if ($_GET["ID"] and $arrGlobalRights[$_GET["ID"]] != "deny") {
        include MODULE_DIR . "structure/actions.position.inc";
    } else {
        $_GET["close"] = 1;
    }
}
$recNode = $objStructure->fnGetDataRecord("ID='" . $_GET["ID"] . "'", "ID, type");
$engSmarty->assign("recNode", $recNode);
$recStructure->recData->comments = getComments($_GET['ID']);
$engSmarty->assign("recStructure", $recStructure);
$engSmarty->assign("arrNode", $arrNode);
$engSmarty->assign("_GET", $_GET);
$engSmarty->assign("strError", $strError);
$engSmarty->assign("arrTranslation", $arrTranslation);
$engSmarty->display("admin/pop.position.tpl");
示例#23
0
     $xmlRoot->appendChild(editUsername($dbconn, $xmlDoc, $_REQUEST['id'], $_REQUEST['username']));
     break;
 case "castVote":
     $xmlRoot->appendChild(castVote($dbconn, $xmlDoc, $_REQUEST['user_id'], $_REQUEST['post_id'], $_REQUEST['vote']));
     break;
 case "tallyVotes":
     $xmlRoot->appendChild(tallyVotes($dbconn, $xmlDoc, $_REQUEST['post_id']));
     break;
 case "checkForUserVote":
     $xmlRoot->appendChild(checkForUserVote($dbconn, $xmlDoc, $_REQUEST['post_id'], $_REQUEST['user_id']));
     break;
 case "addComment":
     $xmlRoot->appendChild(addComment($dbconn, $xmlDoc, $_REQUEST['user_id'], $_REQUEST['post_id'], $_REQUEST['comment']));
     break;
 case "getComments":
     $xmlRoot->appendChild(getComments($dbconn, $xmlDoc, $_REQUEST['post_id']));
     break;
 case "addNewUser":
     $xmlRoot->appendChild(addNewUser($dbconn, $xmlDoc, $_REQUEST['username'], $_REQUEST['password'], $_REQUEST['email']));
     break;
 case "signIn":
     $xmlRoot->appendChild(signIn($dbconn, $xmlDoc, $_REQUEST['username'], $_REQUEST['password']));
     break;
 case "getConnections":
     $xmlRoot->appendChild(getConnections($dbconn, $xmlDoc, $_REQUEST['user_id'], $_REQUEST['module_type']));
     break;
 case "logs":
     $xmlRoot->appendChild(getLogs($dbconn, $xmlDoc, $_REQUEST['user_id']));
     break;
 case "getPlayerData":
     $xmlRoot->appendChild(getPlayerData($dbconn, $xmlDoc, $_REQUEST['ign'], $_REQUEST['token']));
示例#24
0
                    <li><a href="songs.php">SONGS</a></li>
                    <li><a href="playlists.php">PLAYLISTS</a></li>
                    <li><a href="contacts.php">CONTACTS</a></li>
                </ul>
            </nav>
        </section>

        <section id="content-wrapper">
            <?php 
if (isset($_GET['song'])) {
    getSong($_GET['song']);
    getComments($_GET['song'], 'song');
} else {
    if (isset($_GET['playlist'])) {
        getPlaylist($_GET['playlist']);
        getComments($_GET['playlist'], 'playlist');
    } else {
        searchResult();
    }
}
?>
    </div>
    <div id="playlist-msg">
        <p id="msg"></p>
    </div>

    <script>
        var textarea = document.getElementById("textarea");
        var limit = 200;

        document.getElementById('background').style.height = window.innerHeight;
示例#25
0
        $result = selectSql('users', 'user_name,user_avatar', 'user_id=' . $authorId);
        if ($result['state'] == 1) {
            $rows = mysql_fetch_assoc($result['msg']);
            $smarty->assign('authorName', $rows['user_name']);
            $smarty->assign('authorAvatar', $rows['user_avatar'] == '' ? $defaultAvatar : $avatarPath . $rows['user_avatar']);
        }
    }
    //输出照片信息
    if (!empty($albumId)) {
        $result = selectSql('photos', 'photo_id,photo_name,photo_desc', 'album_id=' . $albumId);
        if ($result['state'] === 1) {
            $photoInfoArr = array();
            while ($rows = mysql_fetch_assoc($result['msg'])) {
                $pattern = "/(.+).(jpg|JPG|jpeg|JPEG|png|PNG|gif|GIF)\$/";
                preg_match($pattern, $rows['photo_name'], $matches);
                $photoInfoArr[] = array('id' => $rows['photo_id'], 'name' => $matches[1], 'path' => $thumImgPath . '200_' . $matches[0], 'description' => $rows['photo_desc'], 'photoComments' => getComments($rows['photo_id'], $defaultAvatar, $avatarPath));
                //新上传的图片生成缩略图
                $srcFile = iconv('utf-8', 'gb2312', $uploadImgPath . $matches[0]);
                $dstFile = iconv('utf-8', 'gb2312', $thumImgPath . '200_' . $matches[0]);
                thumbnails($srcFile, $dstFile, 200, '');
            }
        }
        $smarty->assign('photoInfoArr', $photoInfoArr);
    }
    $smarty->assign('userId', $userId);
    $smarty->assign('userName', $userName);
    $smarty->assign('albumId', $albumId);
    $smarty->assign('albumCover', $albumCover);
    $smarty->assign('cssFileName', 'photoList');
    $smarty->display('photoList.tpl');
}
示例#26
0
$session = new gemSession();
$level = $session->getLevel($session->data[0]['objectguid'], 'elm');
*/
if (is_ajax()) {
    $config = parse_ini_file('../config.ini');
    $dbname = $config['dbname'];
    try {
        $db = new PDO("mysql:host=localhost;dbname={$dbname};charset=utf8", $config['username'], $config['password']);
    } catch (PDOException $ex) {
        print "No db connection";
    }
    if (isset($_GET['name']) && !empty($_GET['name'])) {
        get($db);
    } else {
        if (isset($_GET['employeeComments'])) {
            getComments($db);
        } else {
            if (isset($_GET['loadforms'])) {
                loadForms($db);
            } else {
                if (isset($_GET['employee']) && !empty($_GET['employee'])) {
                    getEmployee($db);
                } else {
                    if (isset($_GET['e']) && !empty($_GET['e'])) {
                        getEmployeeStatus($db);
                    } else {
                        if (isset($_GET['ename']) && !empty($_GET['ename'])) {
                            getEId($db);
                        } else {
                            if (isset($_GET['commentSubmit']) && !empty($_GET['commentSubmit'])) {
                                insertComment($db);
示例#27
0
function GetComments($row, $ThisID, $Thiskey)
{
    global $DBConn;
    echo '<li class="comment" id="comment_' . $row['ID'] . '">';
    echo '<div class="comment-body" id="comment_body_' . $row['ID'] . '">' . $row['Comment_Text'] . '</div>';
    echo "<div class='aut'>" . $row['User_Name'] . "</div>";
    echo "<div class='timestamp'>" . $row['Comment_Date'] . "</div>";
    echo '<a href="#commentspop' . $Thiskey . '_' . $ThisID . '" class="reply" id="' . $row['ID'] . '">Reply</a>';
    /* The following sql checks to see if there are any replies for the comment */
    $q = "SELECT * FROM comment WHERE Parent_ID = " . $row['ID'];
    $r = mysqli_query($DBConn, $q);
    if (mysqli_num_rows($r) > 0) {
        echo '<ul id="commentreply_' . $row['ID'] . '">';
        while ($row = mysqli_fetch_assoc($r)) {
            getComments($row, $ThisID, $Thiskey);
        }
        echo "</ul>";
    } else {
        // can only delete your own comments id there are no replies
        if ($row['User_Name'] == $_SESSION['Name']) {
            echo '<a class="deletecomment" id="deletecomment' . $Thiskey . '_' . $row['ID'] . '" href="" onclick="javascript: return false;" title="Delete comment"><img src="images/delete-small.png"></a> &nbsp;';
        }
        echo '<ul id="commentreply_' . $row['ID'] . '"></ul>';
    }
    echo "</li>";
}
示例#28
0
function html_catalog_reviews()
{
    $getReviews = getComments();
    ?>
	<style>
		html.wp-toolbar {
			padding:0px !important;
		}
		#wpadminbar,#adminmenuback,#screen-meta, .update-nag,#dolly {
			display:none;
		}
		#wpbody-content {
			padding-bottom:30px;
		}
		#adminmenuwrap {display:none !important;}
		.auto-fold #wpcontent, .auto-fold #wpfooter {
			margin-left: 0px;
		}
		#wpfooter {display:none;}
		iframe {height:250px !important;}
		#TB_window {height:250px !important;}
	</style>
	<script type="text/javascript">
		jQuery(document).ready(function() {
		                
                    jQuery('#check_all_reviews').click(function() {
                        if(jQuery("#check_all_reviews").is(':checked'))
                                jQuery(".del_one_review").each(function(){
                                    jQuery(this).attr('checked',true);
                                });
                        else
                            jQuery(".del_one_review").each(function(){
                            jQuery(this).attr('checked',false);
                        });
                    });

                    jQuery(".del_one_review").click(function() {
                        if(jQuery("#check_all_reviews").is(':checked')) {
                            jQuery("#check_all_reviews").attr('checked',false);
                        }
                    });
                
                        
                    jQuery('.del_few_reviews').on('click',function(){
                            del_few_reviews();
                    });

                    function del_few_reviews() {
                        var reviews_for_delete = [];
                        jQuery(".del_one_review").each(function(){
                            if(jQuery(this).is(':checked')) {
                                reviews_for_delete.push(jQuery(this).val());
                            }
    //                                alert(jQuery(this).val());
                        });
    //                                alert(reviews_for_delete);
                        var data = {
                            action: 'my_action',
                            post: 'delanyreviews',
                            reviews_for_delete: reviews_for_delete
                        };

                        jQuery.post(ajaxurl, data, function(response) {    //      alert(response);
                            if(response == 1) {                            //      alert(reviews_for_delete);
                                var forEach = Function.prototype.call.bind( Array.prototype.forEach );
                                forEach( reviews_for_delete, function( node ) {       //      alert( node );
                                      var class_for_delete = "." + node;              //      alert(jQuery(class_for_delete).val());
                                      jQuery(class_for_delete).parent().parent().remove();
                                });
                            }
                        });
                    }
                    
                    jQuery('.edit_com_name').on('change',function(){
                        var com_new_id = jQuery(this).parent().siblings(':first-child').find("input[name='values_for_delete']").val();  //  alert(com_id);
                        var com_new_name = jQuery(this).val();  //  alert(com_new_name);
                        
                        var data = {
                            action: 'my_action',
                            post: 'editreviewname',
                            com_new_name: com_new_name,
                            com_new_id: com_new_id
                        };

                        jQuery.post(ajaxurl, data, function(response) {     //    alert(response);
                            if(response == 1) {                            //      alert(reviews_for_delete);
                                jQuery('input').blur();
                            }
                            else {
//                                alert("Ajax Error.");
                            }
                        });
                    });
                    
                    jQuery('.edit_com_content').on('change',function(){
                        var com_new_id = jQuery(this).parent().siblings(':first-child').find("input[name='values_for_delete']").val();  //  alert(com_new_id);
                        var com_new_name = jQuery(this).val();   //    alert(com_new_name);
                        
                        var data = {
                            action: 'my_action',
                            post: 'editreviewcontent',
                            com_new_name: com_new_name,
                            com_new_id: com_new_id
                        };

                        jQuery.post(ajaxurl, data, function(response) {     //    alert(response);
                            if(response == 1) {                            //      alert(reviews_for_delete);
                                jQuery('input').blur();
                            }
                            else {
//                                alert("Ajax Error.");
                            }
                        });
                    });
                    
            jQuery("#huge_it_view_reviews_wrap .manager-link").click(function(){
            self.parent.tb_remove();
            self.parent.location.assign('admin.php?page=huge_it_catalog_reviews_page');
        });
                    
    });
	</script>
	 <div id="huge_it_view_reviews">
		<div id="huge_it_view_reviews_wrap">
			<h2><?php 
    echo __("Product", "product-catalog");
    ?>
</h2>
                        <a class="manager-link button view_all_reviews"><?php 
    echo __("All Comments Manager", "product-catalog");
    ?>
</a>
                            <div class="huge_it_prod_reviews_container">
                                <table>
                                    <tr><th><input type="checkbox" id="check_all_reviews"/></th><th><?php 
    echo __("Name", "product-catalog");
    ?>
</th><th><?php 
    echo __("Comment", "product-catalog");
    ?>
</th><th class="del_few_reviews"><a class=""></a></th></tr>
                                </table>
                                <table style="border-collapse: collapse;">
                                        <?php 
    foreach ($getReviews as $reviews) {
        ?>
                                                <tr style="border-bottom: 1pt solid #eee;">
                                                    <td><input type="checkbox" class="del_one_review <?php 
        echo $reviews->id;
        ?>
" value="<?php 
        echo $reviews->id;
        ?>
" name="values_for_delete" /></td>
                                                    <td><input type="text" value="<?php 
        echo $reviews->name;
        ?>
" style="text-align: center; border: none;" class="edit_com_name" /></td>
                                                    <td><input type="text" value="<?php 
        echo $reviews->content;
        ?>
" style="text-align: center; border: none;" class="edit_com_content" /></td>
                                                    <td class="del_review"><a href="admin.php?page=catalogs_huge_it_catalog&id=<?php 
        echo $_GET['id'];
        ?>
&task=reviews&prod_id=<?php 
        echo $reviews->product_id;
        ?>
&del_id=<?php 
        echo $reviews->id;
        ?>
"><?php 
        echo __("Delete", "product-catalog");
        ?>
</a></td>
                                                </tr>
                                        <?php 
    }
    ?>
                                </table>
                            </div>
		</div>	
	</div> 
<?php 
}
示例#29
0
session_start();
include 'connect.php';
include 'scripts/functions.php';
$errors = '';
$success = '';
if (isset($_SESSION['isloggedin'])) {
    $username = $_SESSION['username'];
    $id = $_SESSION['id'];
    list($username, $fname, $lname, $email, $profilepic, $address, $phone, $isAdmin, $registered, $institution, $bio, $fb, $twitter, $gplus, $updates, $password) = getUserInfo($id);
    // $inbox = $handle->prepare("SELECT * FROM pm WHERE to_id=:id AND recipientDelete='0' ORDER BY sent DESC");
    // $inbox->execute(array( ':id' => $id ));
    // $inboxfetch = $inbox->fetchAll();
    // $inboxcount = count($inboxfetch);
    $inboxcount = inboxCount($id);
    $comments = getComments($id);
    $outboxcount = outboxCount($id);
    $num_rec_per_page = 10;
    if (isset($_GET["page"])) {
        if ($_GET["page"] == 0) {
            $page = 1;
        } else {
            $page = $_GET["page"];
        }
    } else {
        $page = 1;
    }
    $start_from = ($page - 1) * $num_rec_per_page;
    $sql = "SELECT * FROM pm WHERE from_id=:id AND senderDelete='0' ORDER BY sent DESC LIMIT {$start_from}, {$num_rec_per_page}";
    $query = $handle->prepare($sql);
    $query->execute(array(':id' => $id));
示例#30
0
<div class="wrap">
    <link rel="stylesheet" type="text/css" href="/phase5/css/sports.css">
    <div class="dropdown">
        <script src="/phase5/js/sports.js"></script>
    </div>
    <div class="row">
        <div class="col-md-6" id="sportsBox">
        </div>
        <div class="col-xs-6 col-md-6">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h4>SportsChat</h4>
                </div>
             <div class="panel-body" id="comments" style = "overflow: scroll;height: 500px; overflow-x: hidden;";>
                    <?php 
buildCommentSection(getComments());
?>
             </div>
                 <div class="panel-footer">
                    <?php 
if (isset($_SESSION['loggedin'])) {
    ?>
                        <div class="form-group">
                            <textarea id="comment" name="comment" cols="75" rows="3" maxlength="150"></textarea>
                            <input class="btn btn-lg pull-right" id="post" type="submit" value="Post Comment">
                        </div>
                    <?php 
} else {
    ?>
                        <div class="center-block">
                            <p> You must be <a href="login.php">logged in</a> to post comments. </p>