Seite 1 von 1
Themen außerhalb des Forums anzeigen
Verfasst: 19.11.2005 11:21
von LordAvalon
Suche den Mod, mit dem ich eine Datei auf einer PHP Datei der Homepage includieren kann, die dann die neusten Eintröge im Forum anzeigt ...
Hatte das mal, finds aber einfach nicht wieder...
Verfasst: 19.11.2005 15:29
von nightevil
Probiers mal hiermit :
Code: Alles auswählen
<?php
define('IN_PHPBB', true);
/***************************************************************************
* Hack: Recent Topics
* Author: Acid (acid_junky@web.de)
***************************************************************************
* Description: This hack shows the last # topics on any page...
***************************************************************************
* Installation: You can write the whole code in a file (like index.php) or
* include this recent.php wherever you want...
* <?php include("path/recent.php");
* You have to edit $phpbb_root_path and $limit and $css
***************************************************************************/
$limit = "8"; // how many topics?
$phpbb_root_path = "forum/"; //path to below files
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$recent_sql = "SELECT topic_id,topic_title,topic_last_post_id,forum_id FROM " . TOPICS_TABLE . " WHERE forum_id !='14' ORDER BY topic_last_post_id DESC LIMIT $limit";
$recent = $db->sql_query($recent_sql);
echo "<table width=\"100%\"<tr></tr>";
while ($line = mysql_fetch_array($recent)) {
$security=FALSE;
if($forum_auth == 2 && $userdata['user_level'] == ADMIN) {
$security=TRUE;
}
if($forum_auth == 3 && ($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == 2)) {
$security=TRUE;
}
if($forum_auth == 0) {
$security=TRUE;
}
if($security == TRUE)
{
$lastpost_array=$db->sql_query("SELECT post_time FROM " . POSTS_TABLE . " WHERE post_id =" . $line['topic_last_post_id']);
$j = stripslashes($line['topic_title']);
$k = substr($j, 0, 30) . "..";
echo "<font size=1 face=\"verdana\"><left>
<img border=\"0\" src=\"news.gif\" width=\"8\" height=\"8\" cellpadding=\"0\" cellspacing=\"0\"><font color=\"#4c4c4c\">-</font></span><a href=\"$phpbb_root_path/viewtopic.php?t=" . $line['topic_id'] . "\" target=\"_blank\" class=\"genmed\">" . $k . "</a><br>";
}};
echo "</table>";
?>
Verfasst: 21.11.2005 14:59
von moritzd
Kann man den code auch auf eine bestimmte kategorie vom Forum llenken?? z.B: Schulisches oder Flirt ... ??
nightevil hat geschrieben:Probiers mal hiermit :
Code: Alles auswählen
<?php
define('IN_PHPBB', true);
/***************************************************************************
* Hack: Recent Topics
* Author: Acid (acid_junky@web.de)
***************************************************************************
* Description: This hack shows the last # topics on any page...
***************************************************************************
* Installation: You can write the whole code in a file (like index.php) or
* include this recent.php wherever you want...
* <?php include("path/recent.php");
* You have to edit $phpbb_root_path and $limit and $css
***************************************************************************/
$limit = "8"; // how many topics?
$phpbb_root_path = "forum/"; //path to below files
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$recent_sql = "SELECT topic_id,topic_title,topic_last_post_id,forum_id FROM " . TOPICS_TABLE . " WHERE forum_id !='14' ORDER BY topic_last_post_id DESC LIMIT $limit";
$recent = $db->sql_query($recent_sql);
echo "<table width="100%"<tr></tr>";
while ($line = mysql_fetch_array($recent)) {
$security=FALSE;
if($forum_auth == 2 && $userdata['user_level'] == ADMIN) {
$security=TRUE;
}
if($forum_auth == 3 && ($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == 2)) {
$security=TRUE;
}
if($forum_auth == 0) {
$security=TRUE;
}
if($security == TRUE)
{
$lastpost_array=$db->sql_query("SELECT post_time FROM " . POSTS_TABLE . " WHERE post_id =" . $line['topic_last_post_id']);
$j = stripslashes($line['topic_title']);
$k = substr($j, 0, 30) . "..";
echo "<font size=1 face="verdana"><left>
<img border="0" src="news.gif" width="8" height="8" cellpadding="0" cellspacing="0"><font color="#4c4c4c">-</font></span><a href="$phpbb_root_path/viewtopic.php?t=" . $line['topic_id'] . "" target="_blank" class="genmed">" . $k . "</a><br>";
}};
echo "</table>";
?>