PDO::ERRMODE_EXCEPTION
));
}catch (Exception $e){
die("Error : ".$e->getMessage());
}
if (isset($_GET['topic'])){
$topic_id = $_GET['topic'];
$req = $db->prepare('SELECT topic_subject FROM topics WHERE id=:id');
$req->execute(array(
"id"=>$topic_id
));
if ($data = $req->fetch())
{
$subject = $data['topic_subject'];
}
$req = $db->prepare('SELECT * FROM replies WHERE reply_topic=:id_topic');
$req->execute(array(
"id_topic"=>$topic_id
));
try {
$rows = $req->fetchAll(PDO::FETCH_ASSOC);
?>
=$subject?>
=_('Author')?> |
=_('Reply')?> |
=_('Date')?> |
prepare('SELECT firstname, lastname, username FROM `authors` WHERE id=:user_id');
$req->execute(array(
"user_id"=>$reply_by
));
if ($data = $req->fetch())
{
$username = $data['username'];
$firstname = $data['firstname'];
$lastname = $data['lastname'];
}
?>
="$firstname $lastname ($username)"?> |
=$Parsedown->text($row['reply_content'])?> |
=$row['reply_date']?> |
=_('Your Reply')?>
getMessage());
echo _("Can't fetch topic data.") .'\n';
}
}
else {
$req = $db->prepare('SELECT * FROM `topics`');
$req->execute();
$rows = $req->fetchAll(PDO::FETCH_ASSOC);
?>
Topics
=_('Subjects')?> |
=_('Answers')?> |
=_('Author')?> |
=_('Creation date')?> |
prepare('SELECT firstname, lastname, username FROM `authors` WHERE id=:user_id');
$req->execute(array(
"user_id"=>$topic_by
));
if ($data = $req->fetch())
{
$username = $data['username'];
$firstname = $data['firstname'];
$lastname = $data['lastname'];
}
$req = $db->prepare('SELECT COUNT(*) AS counter FROM replies WHERE reply_topic=:reply_topic');
$req->execute(array(
"reply_topic"=>$row['id']
));
if ($data = $req->fetch()) {
$n_messages = $data['counter'];
}
?>
">=$row['topic_subject']?> |
=isset($n_messages) ? $n_messages : _("No reply")?> |
="$firstname $lastname ($username)"?> |
=$row['topic_date']?> |