Beispiel #1
0
" >
	<input type="hidden" name="feed_token" value="<?php 
    echo Token::generateToken();
    ?>
" >
	<button name="feed" class="ui blue submit icon button">Submit</button>
</form>
<br>
<div class="ui relaxed divided items" id="profile_feed_comments">
<?php 
}
if (empty($posts)) {
    echo "<p id='emptycmt'>There's nothing here!</p>";
} else {
    foreach ($posts as $post) {
        $votes_count = QNA::get_votes($post->id) ?: "0";
        $cCount = count($comments = Comment::get_comments($post->id));
        $post->img_path = $post->img_path ?: DEF_PIC;
        ?>

		<div class="item">
			<a href="/user/<?php 
        echo $post->uid;
        ?>
/" class="ui tiny image">
				<img src="<?php 
        echo $post->img_path;
        ?>
">
			</a>
			<div class="content">
Beispiel #2
0
            echo $p_count;
            echo $p_count > 1 ? " Likes" : $p_count == 0 ? " Likes" : " Like";
            ?>
							</a>
						</div>
					</div>
				</div>
			</div>
		<?php 
            break;
        case 'qs':
            $self = $value['uid'] === USER_ID ? true : false;
            $postID = $value['id'];
            $id = BASE_URL . "questions/question.php?id={$postID}";
            $uid = BASE_URL . "user/{$value['uid']}/";
            $p_count = QNA::get_votes($postID) ?: "0";
            $commentsCount = $QNA->get_Qcomments($postID) ? count($QNA->get_Qcomments($postID)) : "0";
            ?>
			<div class="ui segment question-view">
				<div class="header user-details">
					<div class="ui image mini">
						<a href="<?php 
            echo $uid;
            ?>
"><img src="<?php 
            echo $value['path'];
            ?>
"></a>
					</div>
					<div class="summary">
						<?php 
Beispiel #3
0
		<h3>Stories</h3>
		<?php 
echo $pag->display();
?>
		<div class="questions front-page" id="questions">
			<?php 
if (count($qs) < 1) {
    echo "There are no stories in this section yet.<br>";
} else {
    foreach ($qs as $q) {
        if ($q->status != 1 && $q->uid != USER_ID) {
            continue;
        }
        $self = $q->uid === USER_ID ?: false;
        $commentsCount = count(Comment::get_comments($q->id));
        $votes = QNA::get_votes($q->id);
        $votes = $votes ?: "0";
        $reports_count = QNA::get_reports_count($q->id) ?: null;
        $img_path = $q->img_path ?: DEF_PIC;
        $type = $q->fid == 5 ? 'Generated' : 'Written';
        ?>
				 	<div class="ui items">
				 		<div class="item">
				 			<div class="ui tiny image">
				 				<a href="/user/<?php 
        echo $q->uid;
        ?>
/"><img src="<?php 
        echo $img_path;
        ?>
"></a>
Beispiel #4
0
require_once $_SERVER["DOCUMENT_ROOT"] . "/src/init.php";
$PostID = sanitize_id($_GET['post_id']);
if (!$PostID) {
    Redirect::redirectTo();
}
$post = new Post();
$post = $post->get_post($PostID);
if (!is_object($post)) {
    Redirect::redirectTo();
}
$self_p = $post->user_id === $post->poster_id ? true : false;
$self = $post->user_id === USER_ID ? true : false;
if (USER_ID) {
    $voted = QNA::has_voted($PostID, USER_ID);
}
$votes_count = QNA::get_votes($PostID) ?: "0";
$comments = Comment::get_comments($post->id);
include ROOT_PATH . "inc/head.php";
?>

<body>
	<div class="user-feed post ui container section">
		<div class="feed-post ui segment" id="post-page" post-id="<?php 
echo $post->id;
?>
">
			<?php 
if ($self || $post->poster_id === USER_ID) {
    ?>
			<div title="Actions" class="ui pointing dropdown" id="post-actions">
				<i class="setting link large icon"></i>
Beispiel #5
0
        if ($q == $id) {
            Redirect::redirectTo('404');
        }
        Redirect::redirectTo(BASE_URL . "questions/question.php?id={$q}#{$id}");
    } else {
        Redirect::redirectTo('404');
    }
}
if ($q->status != 1 && !($session->adminCheck() || $session->userCheck($q->uid))) {
    Redirect::redirectTo('404');
}
$user = new User($q->uid);
$user = $user->user;
$self = $q->uid === USER_ID;
$voted = QNA::has_voted($id, USER_ID);
$votes_count = QNA::get_votes($id) ?: "0";
$post_date = $q->created;
$post_modified_date = $q->last_modified;
if ($q->last_modified > $q->created) {
    $edited = " (edited <span class='datetime' title=\"{$post_modified_date}\">{$post_modified_date}</span>)";
} else {
    $edited = "";
}
$rpsc = QNA::get_reports_count($id) ?: false;
if ($rpsc) {
    $reports_count = $rpsc == 1 ? "1 time" : "{$rpsc} times";
} else {
    $reports_count = false;
}
include ROOT_PATH . 'inc/head.php';
$name = $q->full_name;