Exemplo n.º 1
0
<?php

include 'models/database.php';
include 'models/posts.php';
$topics = GetTopics();
//count the number of posts inside a topic
$numberofreplies = array();
$metritis = 0;
foreach ($topics as $topic) {
    $posts = GetPosts($topic[4]);
    foreach ($posts as $post) {
        $metritis += 1;
    }
    $numberofreplies[$topic[4]][0] = $metritis;
    $metritis = 0;
}
//Get Last Post's Author
$lastposts = array();
$author = array();
foreach ($topics as $topic) {
    $lastposts = GetLastPost($topic[4]);
    foreach ($lastposts as $lastpost) {
        $author[$topic[4]][0] = $lastpost[0];
    }
}
include 'views/topiclist.php';
?>
 
Exemplo n.º 2
0
<?php

session_start();
header('Content-Type: text/html; charset=utf-8');
include 'models/database.php';
include 'models/posts.php';
$posts = GetPosts();
if (isset($_SESSION['userid'])) {
    $username = $_SESSION['username'];
}
include 'views/home.php';
Exemplo n.º 3
0
				<form action="">
				<table id="page">
				<tr>
					<th><a id="toggle-all" ></a> </th>
					<th><a href="">Ticket Subject</a>	</th>
					<th><a href="">Posted</a></th>			
					<th><a href="">Answers</a></th>
					<th><a href="">Status</a>
				</tr>
<?php
for($i = 0;$i<$num;$i++)
{
$subject = mysql_result($sql,$i,"subject");
$posted = mysql_result($sql,$i,"posted");
$id = mysql_result($sql,$i,"id");
$answers = GetPosts($id);
$opened = mysql_result($sql,$i,"opened");
if($opened == 1)
{
$open = "<b>Open</b>";
}
else
{
$open = "<b>Closed</b>";
}
?>
				<tr>
					<td><input  type="checkbox"/></td>
					<td><a href="index.php?page=viewticket&id=<?echo $id; ?>"><? echo $subject;?></a></td>
					<td><? echo $posted;?></td>
<td><? echo $answers;?></td>
Exemplo n.º 4
0
<?php

include 'models/database.php';
include 'models/posts.php';
include 'views/header.php';
$topicid = $_GET['topicid'];
$topicname = GetTopicName($topicid);
$posts = GetPosts($topicid);
include 'views/postlist.php';
include 'printfooter.php';
?>