Esempio n. 1
0
				<div class="col-md-10">
					<div class="topic-content pull-right">
						<h3><a href="topic.html"><?php 
        echo $topic->title;
        ?>
</a></h3>
						<div class="topic-info">
							<a href="topics.php?category=<?php 
        echo urlFormat($topic->category_id);
        ?>
"><?php 
        echo $topic->name;
        ?>
</a> >> 
							<a href="topics.php?user=<?php 
        echo urlFormat($topic->user_id);
        ?>
"><?php 
        echo $topic->username;
        ?>
</a> >> 
							<?php 
        echo formatDate($topic->create_date);
        ?>
							<span class="badge pull-right"><?php 
        echo replyCount($topic->id);
        ?>
</span>
						</div>
					</div>
				</div>
Esempio n. 2
0
			<div class="content">
			<h2 style="padding-bottom:10px;">Answers</h2>
			<?php 
    if ($replies) {
        foreach ($replies as $reply) {
            ?>
				<div class="info" id="replyid<?php 
            echo $reply->id;
            ?>
">
			<img src="<?php 
            echo avatar . $reply->avatar;
            ?>
" />
			<a class="user" href="topics.php?user=<?php 
            echo urlFormat($reply->user_id);
            ?>
"><?php 
            echo $reply->username;
            ?>
</a>
			 Posted on <?php 
            echo formatDate($reply->create_date);
            ?>
<br>
			<a class="upvotes"><span id="replyUpCount-<?php 
            echo $reply->id;
            ?>
"><?php 
            $d = getUpVoteCount($reply->id);
            if ($d->countot == 0) {
Esempio n. 3
0
    ?>
" href="index.php">All Categories<span class="badge pull-right"><?php 
    echo topicsCount("all");
    ?>
</span></a>
							<?php 
    foreach (getCategories() as $category) {
        ?>
							
							<a class="list-group-item <?php 
        if (isset($_GET['category'])) {
            echo ' ' . is_active($category->id);
        }
        ?>
" href="topics.php?category=<?php 
        echo urlFormat($category->id);
        ?>
"><?php 
        echo strtolower($category->name);
        ?>
<span class="badge pull-right"><?php 
        echo topicsCount($category->id);
        ?>
</span></a>
							<?php 
    }
    ?>
							</div>
							</div>
							<?php 
}
Esempio n. 4
0
<?php

require 'core/init.php';
if (isLoggedIn()) {
    $topic = new Topic();
    $template = new Template("templates/searchResult.php");
    $topic_id = isset($_POST['search']) ? $_POST['search'] : null;
    //$template->topicSel=$topic->getTopicBySearch($topic_id);
    redirect("topic.php?topic=" . urlFormat($topic->getTopicBySearch($topic_id)->id));
} else {
    redirect("home.php");
}
Esempio n. 5
0
require 'core/init.php';
$topic = new Topic();
$user = new User();
$template = new Template("templates/topic.php");
$topic_id = isset($_GET['topic']) ? $_GET['topic'] : null;
$template->topicSel = $topic->getTopicById($topic_id);
$template->replies = $topic->getRepliesBytopic($topic_id);
$template->title = $topic->getTopicById($topic_id)->title;
$template->totUsers = totUsers();
$template->totTopics = topicsCount("all");
if (isLoggedIn()) {
    $template->user_id = $_SESSION['user_id'];
    $template->username = $_SESSION['username'];
    $template->email = $_SESSION['email'];
    $template->last_activity = $_SESSION['last_activity'];
    $template->avatar = $_SESSION['avatar'];
    $template->details = $_SESSION['details'];
    if (!empty($_POST['reply']) && isset($_POST['reply']) && $_POST['reply'] != '<br>') {
        $data['topic_id'] = $_GET['topic'];
        $data['user_id'] = $_SESSION['user_id'];
        $data['body'] = $_POST['reply'];
        $redirect = "topic.php?topic=" . urlFormat($_GET['topic']);
        if ($user->reply($data)) {
            add_notification($_SESSION['user_id'], " added an answer to a topic ", $_GET['topic'], $_POST['newAns'], followers_id($_SESSION['user_id']));
        }
        redirect($redirect);
    }
} else {
    redirect("home.php");
}
echo $template;
Esempio n. 6
0
?>
templates/avatars/<?php 
echo $avatar;
?>
" alt="profile pic" align="middle"/>
	<a href="#" class="name"><?php 
echo $username;
?>
</a>
	</div>
	</div>
	
		<ul id="pro-info">
			<li><a href="#" data-toggle="modal" data-target="#editPerInfo">Personal Info</a></li>
			<li><a href="topics.php?user=<?php 
echo urlFormat($user_id);
?>
">My Topics</a>
			<span class="badge pull-right"><?php 
echo getUserTopicCount($user_id, 'topic');
?>
</span></li>
			<li>Answered<span class="badge pull-right"><?php 
echo getUserTopicCount($user_id, 'replies');
?>
</span></li>
			<li><a href="#" onclick='getFollowers("Following");' data-toggle="modal" data-target="#followersListModal">Following</a><input type="hidden" name="following_count" value="<?php 
echo follow_no("following", $user_id);
?>
"><span id="followingc" class="badge pull-right"><?php 
echo follow_no("following", $user_id);
Esempio n. 7
0
        ?>
"><a id="downvote" <?php 
        if (!reported($topic->id)) {
            echo 'onclick="report(\'topic\',' . $topic->id . ',0);"';
        }
        ?>
 class="upvotes"><?php 
        if (reported($topic->id)) {
            echo 'Reported';
        } else {
            echo 'Report';
        }
        ?>
</a></span>
				<a id="answer" href="topic.php?topic=<?php 
        echo urlFormat($topic->id);
        ?>
" class="upvotes">Answer</a>				
				<a class="upvotes" ><?php 
        echo replyCount($topic->id);
        if (replyCount($topic->id) == 1) {
            echo ' Answer';
        } else {
            echo ' Answers';
        }
        ?>
 </a>
				
				
			</div>
			</div>
Esempio n. 8
0
<div class="title">	
<div class="content">
   <div class="info" style="@media (max-width:766px){margin-left:20px;}"><br><br>
   <img class="hidden-xs" style="float:left;margin-left:20px" src="<?php 
        echo avatar . $result->avatar;
        ?>
">
   <a style="padding-left:20px;" class="user" href="topics.php?user=<?php 
        echo urlFormat($result->id);
        ?>
"><?php 
        echo $result->name . '<br>';
        ?>
</a>
   <a style="padding-left:20px;" class="user" href="topics.php?user=<?php 
        echo urlFormat($result->id);
        ?>
"><?php 
        echo $result->result . ' Upvotes';
        ?>
</a>
		
   </div>
   </div>
   </div>
   </div>
<?php 
    }
} else {
    redirect("home.php");
}