Hier mal der ganze Code:
Code: Alles auswählen
########################################################
## Mod Title: Recent posts on any page of your server
## Mod Version: phpBB 2.0
## Author: LiLCoolboy (M@urice Cheung) (originally made by ?)
## Description: Shows the recent topics or posts on any page of your server
##
## DeMo: http://www.xptweakers.cjb.net
## Installation Level: Easy
## Installation Time: 5 minutes
## Files To Edit: 0
## Included Files: (if necessary)
########################################################
##
## Installation Notes:
##
## just put the code in a php file, edit the $serverpath and the $urlpath
## upload the file and you're all done!!
##
########################################################
#
#-----[place the code in a php file]------------------------------------------
#
<?
$ServerPath = "Your_Server_Path/config.php"; //- Not Not Include Closing \ Mark!
$urlPath = "http://Your_Url_Path"; //- Not Not Include Closing \ Mark!
$PostNumber = "10"; // How Many "X" Posts To Display
$type = "topics"; // Display "posts" or "topics"
//-----------------[ DO NOT EDIT BELOW HERE ]-------------------------
include_once("$ServerPath");
$db = @mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("here we die at connection");
@mysql_select_db("$dbname",$db) or die("here we die");
if($type == "phpbb_posts")
$sql = "SELECT t.topic_title, t.topic_id, f.forum_id FROM topics t, forums f, posts p WHERE t.topic_id = p.topic_id AND f.forum_id = t.forum_id ORDER BY post_id DESC LIMIT $PostNumber";
else
$sql = "SELECT t.topic_title, t.topic_id, f.forum_id FROM topics t, forums f WHERE f.forum_id = t.forum_id ORDER BY topic_time DESC LIMIT $PostNumber";
if($r = mysql_query($sql, $db)) {
while($m = mysql_fetch_array($r)) {
$j = stripslashes($m[topic_title]);
$k = substr($j, 0, 20) . "...";
echo "-<a title=\"$m[topic_title]\" href=\"$urlpath/viewtopic.php?t=$m[topic_id]&sid=$m[forum_id]\">$k</a><br>";
}
}
?>
#
#-----------------------------------------------
#