Ejemplo n.º 1
0
function getComment($type)
{
    $array_comments = getAllComments($type);
    if ($type == "song") {
        foreach ($array_comments as $comment) {
            $id = $comment["id"];
            $commentBody = $comment["text"];
            $username = $comment["username"];
            $songName = $comment["artist"] . ' - ' . $comment["title"];
            echo "<tr><td>{$id}</td><td>{$commentBody}</td><td>{$username}</td><td>{$songName}</td><td><a href='App_Code/cmsView.php?type=comment&delete={$id}'>DELETE</a></td></tr>";
        }
    } else {
        foreach ($array_comments as $comment) {
            $id = $comment["id"];
            $commentBody = $comment["text"];
            $username = $comment["username"];
            $playlist = $comment["PlaylistUser"];
            echo "<tr><td>{$id}</td><td>{$commentBody}</td><td>{$username}</td><td>{$playlist}</td><td><a href='App_Code/cmsView.php?type=comment&delete={$id}'>DELETE</a></td></tr>";
        }
    }
}
Ejemplo n.º 2
0
<?php

include 'db-connection.php';
require 'posts.php';
session_start();
$post_id = filter_input(INPUT_POST, 'postId');
$comments = getAllComments($post_id);
echo json_encode($comments);
Ejemplo n.º 3
0
                   
                    <table class="table table-bordered table-hover">
                        <thead>
                            <tr>
                                <th class="hide">ID</th>
                                <th>Author</th>
                                <th class="col-xs-3">Comment</th>
                                <th class="col-xs-1">Status</th>
                                <th class="col-xs-3">In response to</th>
                                <th>Email</th>
                                <th>Date</th>
                            </tr>
                        </thead> 
                        <tbody>
                            <?php 
$comments = getAllComments();
foreach ($comments as $comment) {
    $comment_post = findPostById($comment['post_id']);
    ?>
                                <tr>
                                    <td class="hide"><?php 
    echo $comment['id'];
    ?>
</td>
                                    <td><?php 
    echo $comment['author'];
    ?>
</td>
                                    <td>
                                        <?php 
    echo $comment['content'];
Ejemplo n.º 4
0
    ?>
" type="text" />
										 	</div>
											<div class="form-group">
												<button class="btn btn-success" id="edit-post-btn-<?php 
    echo $post["item_id"];
    ?>
">Edit</button>
											</div>
	                                    </div>
                                        <ul class="commentList" id="commentList-<?php 
    echo $post["item_id"];
    ?>
">
                                        	<?php 
    $comments = getAllComments($post["item_id"]);
    foreach ($comments as $comment) {
        ?>
	                                            <li id="commentLi-<?php 
        echo $comment["comment_id"];
        ?>
">
	                                                <div class="commentText" id="commentText-<?php 
        echo $comment["comment_id"];
        ?>
">
	                                                    <p class=""><?php 
        echo $comment["comment_text"];
        ?>
</p> 
	                                                    <div class="pull-right action-buttons">
Ejemplo n.º 5
0
        if ($replaced) {
            // the record has been deprecated
            $record = array();
            $record["replacedBy"] = $rec_id;
        } else {
            $record = getBaseProperties($rec_id, $bkm_ID);
            /*****DEBUG****/
            //error_log("base Properties".print_r($record,true));
            if (@$record["workgroupID"] && $record["workgroupID"] != get_user_id() && $record[@"visibility"] == "hidden" && !$_SESSION[HEURIST_SESSION_DB_PREFIX . 'heurist']["user_access"][$record["workgroupID"]]) {
                // record is hidden and user is not the owner or a member of owning workgroup
                $record = array();
                $record["denied"] = true;
            } else {
                $record["bdValuesByType"] = getAllRecordDetails($rec_id);
                $record["reminders"] = getAllReminders($rec_id);
                $record["comments"] = getAllComments($rec_id);
                $record["workgroupTags"] = getAllworkgroupTags($rec_id);
                $record["relatedRecords"] = getAllRelatedRecords($rec_id);
                $record["rtConstraints"] = getRectypeConstraints($record['rectypeID']);
                $record["retrieved"] = date('Y-m-d H:i:s');
                // the current time according to the server
            }
        }
    }
    if (!defined("JSON_RESPONSE")) {
        if ($isPopup) {
            ?>
if (! window.HEURIST) window.HEURIST = {};
if (! window.HEURIST.edit) window.HEURIST.edit = {};
window.HEURIST.edit.record = <?php 
            echo json_format($record);
Ejemplo n.º 6
0
function print_text_details($bib)
{
    $cmts = getAllComments($bib["rec_ID"]);
    $result = loadWoot(array("title" => "record:" . $bib["rec_ID"]));
    if (!$result["success"] && count($cmts) == 0) {
        return;
    }
    ?>
    </div>
    <div class=detailRowHeader>Text

        <?php 
    print_woot_precis($result["woot"], $bib);
    print_threaded_comments($cmts);
    print '<br>&nbsp;';
    // avoid ugly spacing
}
Ejemplo n.º 7
0
<?php

require_once '../phpInclude/dbconn.php';
require_once '../phpInclude/AdminClass.php';
$token = $_REQUEST['token'];
$share_id = $_REQUEST['share_id'];
$data = array();
if (!empty($token) && !empty($share_id)) {
    $users_id = getUsersId($token);
    if (!empty($users_id)) {
        $result = getAllComments($share_id, $users_id);
        if (!empty($result)) {
            $success = "1";
            $msg = "Following are the comments";
            $data = $result;
        } else {
            $success = "1";
            $msg = "No comments to this post";
        }
    } else {
        $success = "0";
        $msg = "No such user exist!";
    }
} else {
    $success = "0";
    $msg = "Incomplete Parameters";
}
echo json_encode(array("success" => $success, "msg" => $msg, "data" => $data));
Ejemplo n.º 8
0
<?php

session_start();
if (!isset($_GET['id'])) {
    die('No id');
}
include_once 'database/connection.php';
include_once 'database/events.php';
include_once 'database/comments.php';
include_once 'database/users.php';
try {
    $event = getEventByID($_GET['id']);
    if ($event === false) {
        die("Yo mate no such post.");
    }
    $paragraphs = explode("\n", $event['fulltext']);
    $comments = getAllComments($_GET['id']);
    $attendings = getAllAttendances_Event($_GET['id']);
} catch (PDOException $e) {
    die($e->getMessage());
}
include_once 'templates/header.php';
include_once 'templates/event.php';
include_once 'templates/footer.php';