 |
|
|
|

| Autor |
Nachricht |
SpiderM
phpBB2.de User

Anmeldungsdatum: 14.08.2002
Beiträge: 1
|
Verfasst am:
Mi 14 Aug, 2002 12:26 |
  |
Möchte die letzten Topics auf meiner HP anzeigen und hab dazu untenstehendes Script verwendet. Die Anzeige funktioniert soweit auch, nur stört es mich, daß auch die passwortgeschützten Topics, nochmehr auch die privaten Topics in der Anzeige mit erscheinen. Gibt es da eine Möglichkeit? Oder gibt es dazu einen anderen Script?
| Zitat: |
<?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
***************************************************************************/
$css ="http://www.crankhole.com/gallery/css/standalone_style.css.default"; //path and name to your css_sheet - optional
$limit = "5"; // how many topics?
$phpbb_root_path = "forums/"; //path to below files
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
echo "<link rel=\"stylesheet\" href=\"$css\" type=\"text/css\">"; // - optional
$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=\"80%\" align=\"left\"><tr><td colspan=\"4\" align=\"left\"><span class=\"gen\"><b>Recent Topics:</b></span></td></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']);
$lastpost=mysql_fetch_array($lastpost_array);
$lastpost=$lastpost['post_time'];
$lastpost=create_date($board_config['default_dateformat'], $lastpost, $board_config['board_timezone']);
$j = stripslashes($line['topic_title']);
$k = substr($j, 0, 25) . "...";
echo "<tr><td align=\"left\"><span class=\"gensmall\">»» </span> <a href=\"$phpbb_root_path/viewtopic.php?t=" . $line['topic_id'] . "\" class=\"genmed\">" . $k . "</a></td>";
echo "<td align=\"left\" width=\"50%\"><span class=\"genmed\">$lastpost</span></td></tr>";
}};
echo "</table>";
?> |
|
|
|
   |
 |
Google
|
Verfasst am:
|
 |
|
|
 |
|
|
|
|
|
Nächstes Thema anzeigen
Vorheriges Thema anzeigen
Du kannst keine Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum nicht antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
|
|
| |