no mam tam
Kód:
$topics .= "<tr><td><a class='topic' href='view_topic.php?cid=".$cid."&tid=".$tid."'><strong><i>".$title."</i></strong></a><br /><span class='post_info'>Pridal: <font color='#106CB5'>".$creator."</font> dna <font color='#009933'>".date("d.m.Y / H:i:s", strtotime($date))."</font></span></td><td align='center'>0</td><td align='center'>".$views."x</td></tr>";
$views zobrazuje pocet zobrazeni a predtim 0 nusim nahradit ale neviem cim cely script je
Kód:
<?php
include_once("connect.php");
$cid = $_GET['cid'];
if (isset($_SESSION['uid'])) {
$logged = " | <a href='create.php?cid=".$cid."' class='button'>Vytvorit temu</a>";
} else {
$logged = " | Na vytvorenie temy je potrebne sa <font color='#106CB5'><b>Prihlasit</b></font>!";
}
$sql = "SELECT id FROM categories WHERE id='".$cid."' LIMIT 1";
$res = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($res) == 1) {
$sql2 = "SELECT t.id, t.topic_title, t.topic_views, t.topic_date, u.username as topic_creator FROM topics t JOIN users u ON t.topic_creator= u.id WHERE category_id='".$cid."' ORDER BY topic_reply_date DESC";
$res2 = mysql_query($sql2) or die(mysql_error());
if (mysql_num_rows($res2) > 0) {
$topics .= "<table width='100%' style='border-collapse: collapse;'>";
$topics .= "<tr><td colspan='3'><a href='index.php' class='button'>Navrat do fora</a>".$logged."<hr /></td></tr>";
$topics .= "<tr style='background-color: #106CB5';><td> <font color='#FFF'>Nazov temy</font></td><td width='100' align='center'><font color='#FFF'>Odpovedi</font></td><td width='100' align='center'><font color='#FFF'>Zobrazene</font></td></tr>";
$topic .= "<tr><td colspan='3'><hr /></td><tr>";
while ($row = mysql_fetch_assoc($res2)) {
$tid = $row['id'];
$title = $row['topic_title'];
$views = $row['topic_views'];
$date = $row['topic_date'];
$creator = $row['topic_creator'];
$topics .= "<tr><td><a class='topic' href='view_topic.php?cid=".$cid."&tid=".$tid."'><strong><i>".$title."</i></strong></a><br /><span class='post_info'>Pridal: <font color='#106CB5'>".$creator."</font> dna <font color='#009933'>".date("d.m.Y / H:i:s", strtotime($date))."</font></span></td><td align='center'>0</td><td align='center'>".$views."x</td></tr>";
$topics .= "<tr><td colspan='3'><hr /></td></tr>";
}
$topics .= "</table>";
echo $topics;
} else {
echo "<a href='index.php' class='button'>Navrat do fora</a><hr />";
echo "<p>V tejto kategorii nie su k dispozicii ziadne temy.".$logged."</p>";
}
} else {
echo "<a href='index.php' class='button'>Navrat do fora</a><hr />";
echo "<p>Pokusate sa zobrazit kategoriu, ktora este neexistuje.";
}
?>