Sida 1 av 1

Senaste trådarna!

Postat: 2006-01-08 18:08
av Dan
Ja har hittat en mod som skulle vara perfekt, ifall jag kunde få den och funka. :cry:

Jag vill visa dom senaste trådarna på min index sida.

Index-sidan är en html sida och ligger inte i samma katalog som phpBB.

Den här modden vill jag använda.
http://www.phpbbhacks.com/download/3090

Så här har jag lagt in koden i min index sida, men ingen ändring sker.



<script type="text/php">
<?
/**
* Mod Title: Latest Topics
* Mod Version: phpBB 2.0.4
* Author: Charlie Page
* Description: Shows latest topics on any page
* Release: v1.0, 05.30.2004
***
* Demo: http://www.xboxassassin.com/e3
* Installation Level: Easy
* Installation Time: 1 minute
* Files To Edit: This one
* Included Files: php-latest.php
***
* Installation Notes:
* Upload this file and set $ppath and $url,
* Include this into a page and your done!
*/
$url = "/php/phpBB2"; // If url is - http://www.yourforums.com/forums , then enter in "/forums"
$ppath = "/home/user/public_html/php/phpBB2/config.php"; // Physical path to the config.php file
if(empty($count))
$count = "5"; // How many topics to link to

//-----------------[ DO NOT EDIT BELOW HERE ]-------------------------
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>";

}
?>
</script>

Nån som vet va som kan va fel.
OBS! sökvägarna ska stämma.

Postat: 2006-01-08 18:59
av Holger
Jag tror inte att du kan lägga in PHP i en vanlig HTML-sida.
Filen måste ha ändelsen .php för att php-parsern ska köra igång.

Prova modden Topics Anywhere istället. Den infogar bara ett JavaScript och funkar utmärkt.