Ik wil dus de laatste topics zichtbaar maken op me index.php. Mijn forum (phpbb) zit in (/forum) wat klopt hieronder niet?
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| $url = "/forum";
$ppath = "/forum/config.php";
if(empty($count))
$count = "5";
include_once("$ppath");
$db = @mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("here we die at connection");
@mysql_select_db("$dbname",$db) or die("here we die");
$prefix = "$table_prefix";
$query="SELECT * FROM $prefix_topics ORDER BY `topic_id` DESC LIMIT 0, $count";
$result=mysql_query($query);
while($row = mysql_fetch_array($result)) {
$topicid = "$row[topic_id]";
$title = "$row[topic_title]";
$forumid = "$row[forum_id]";
$replies = "$row[topic_replies]";
echo "- <a title=\"$title\" href=\"$url/viewtopic.php?t=$topicid&sid=$forumid\">$title</a> (<i>$replies</i>)<br>";
}
?> |