<?php
echo '<div class="content_left">
<div id="breadcrumb">
<ul class="crumbs">
<li class="first"><a href="index.php" style="z-index:9;"><span></span>' . $lang['index'] . '</a></li>
<li><a href="discussions.php" style="z-index:8;">' . $lang['discussions'] . '</a></li>
</ul>
</div>
</div>
<div class="content_right">';
include('modules/search.inc.php');
echo '</div>
<div class="clear_long"></div>';
$ret = 1;
echo '<div class="main_menu">';
$ret = include 'framework/templates/'.$main_content['menu'];
echo '<div id="line"></div>';
$ret = include 'framework/templates/'.$main_content['infos'];
echo '</div>';
echo '<div class="main_content">';
echo '<h1 class="p_space">' . $lang['discussions'] . '</h1>';
echo '<p class="p_space"><a href="create.php" class="buttons">' . $lang['create_discussion'] . '</a></p>';
$path = $_SERVER["PHP_SELF"];
$query = mysql_query("SELECT id FROM topics");
$total = mysql_num_rows($query);
$allsites = ceil($total / $entries);
include('framework/functions/pagination.php');
$query = "SELECT * FROM topics ORDER BY id DESC LIMIT $start,$entries";
$result = mysql_query($query) OR die(mysql_error());
if(!$result) {
echo '<p class="false">' . $lang['no_topics'] . '</p>' . mysql_error();
}else{
if(intval(mysql_num_rows($result)) == 0) {
echo '<p class="false">' . $lang['no_topics'] . '</p>';
}else{
echo '<table width="100%" class="tables">
<tr>
<td align="left"><span class="blue_span">' . $lang['topics'] . '</span></td>
<td align="left"><span class="blue_span">' . $lang['date_views'] . '</span></td>
<td align="center"><span class="blue_span">' . $lang['posts'] . '</span></td>
</tr>';
while($row = mysql_fetch_assoc($result)) {
echo '<tr>';
if(strtotime($row['date']) >= time()-7200) {
echo '<td width="62%"><img src="style/icons/topic_new.png" width="16" height="16" border="0" alt="New"> <a href="read_discussion.php?id=' . (int)$row['id'] . '" class="cat">' . htmlentities($row['subject'], ENT_QUOTES) . '</a></td>';
}else{
echo '<td width="62%"><img src="style/icons/topic.png" width="16" height="16" border="0" alt="Standart"> <a href="read_discussion.php?id=' . (int)$row['id'] . '" class="cat">' . htmlentities($row['subject'], ENT_QUOTES) . '</a></td>';
}
echo '<td width="30%"><img src="style/images/clock.png" hspace="5" alt="Date">';
echo date('d.m.Y', strtotime($row['date']));
echo ' <img src="style/images/views.png" alt="Views"> <span class="text_tags">' . (int)$row['views'] . '</span></td>
<td width="8%" align="center">';
$count_posts = mysql_query("SELECT id FROM discussions WHERE topic = " . (int)$row['id'] . "");
$result_posts = intval(mysql_num_rows($count_posts));
echo '<div class="bubble"><span class="bubpoint"></span><span class="bubcon">' . (int)$result_posts . '</span></div></td></tr>';
}
echo '</table>';
echo '<div class="spacer"></div>';
echo '<span class="pages">Seite ' . $page . ' von ' . $allsites . '</span>';
echo $link_string;
echo '<div class="clear_pagination"></div>';
}
}
echo '<div id="pr_line"></div>';
echo '<p class="p_space" align="right"><a href="favorites.php" class="buttons">' . $lang['favorites'] . '</a>
<a href="search.php" class="buttons">' . $lang['search_function'] . '</a></p>';
?>