Seite 1 von 1

Mit recent.php spezielle Rubrik ausschliessen

Verfasst: 09.06.2006 13:10
von darkeyeX
Hallo,

ich benutze die recent.php aus dem norecent.zip. Grade habe ich ein spezielles Forum nur für Moderatoren erstellt und möchte nicht, dass Topics in dieser Forenrubrik auf meiner Startseite in der recent.php auftauchen. Wie kann ich dies verhindern? Ich benutze die recent.php nur auf der Startseite meiner Domain (nicht die Startseite des Forums!)

In der recent-Datei steht zwar folgendes:
## Wie oben beschrieben, kann man spezielle Foren angeben, so das dann nur Themen aus
## diesen Foren angezeigt werden.
## Will man diese speziellen Foren von der Anzeige ausschliessen, macht man folgende
## Änderung an der recent.php:
#
#-----[ FINDE ]----------------------------------------------------
#
$where_forums = ( $special_forums == '0' ) ? 't.forum_id NOT IN ('. $except_forums .')' : 't.forum_id NOT IN ('. $except_forums .') AND t.forum_id IN ('. $forum_ids .')';
#
#-----[ FINDE in dieser Zeile ]----------------------------------------------------
#
t.forum_id IN

#
#-----[ MIT FOLGENDEM ERSETZEN ]----------------------------------------------------
#
# "IN" wurde mit "NOT IN" ersetzt

t.forum_id NOT IN
Doch diese Zeile
$where_forums = ( $special_forums == '0' ) ? 't.forum_id NOT IN ('. $except_forums .')' : 't.forum_id NOT IN ('. $except_forums .') AND t.forum_id IN ('. $forum_ids .')';
gibt es in der recent-Datei nicht. Diese Zeile gibt es nur in der normalen recent-Datei, doch nicht in der aus der NOrecent-Zip-Datei.

Ich habe schon alles Erdenkliche ausprobiert, doch es klappt einfach nicht. Kann mir da jemand weiterhelfen?

Verfasst: 09.06.2006 18:07
von SoLo1905
bei mir steht manchmal auch suche das : #####

wenn ich suche steht nicht gefunden

wenn ich bisschen weg mach findet er des

such nach $except_forums .') AND t.forum

vlt findest du es dann :D

Verfasst: 11.06.2006 14:07
von darkeyeX
Ich habe doch deutlich geschrieben dass dieser Code bei meiner recent.php nicht vorhanden ist, also was soll dein blöder Beitrag?!

Nochmal: So sieht die recent.php aus aus dem 'norecent'-Ordner aus:
<?php
// ############ Edit below ########################################
$topic_length = '40'; // length of topic title
$topic_limit = '5'; // limit of displayed topics
$special_forums = '0'; // specify forums ('0' = no; '1' = yes)
$forum_ids = '28'; // IDs of forums; separate them with a comma

$config_path = '/'; // path to config.php
$root_path = 'http://forum.domain.com/'; // link path
// ############ Edit above ########################################

$path = dirname(__FILE__);
include_once($path.$config_path .'config.php');
mysql_connect($dbhost, $dbuser, $dbpasswd) OR die('Unable to select server.');
mysql_select_db($dbname) OR die('Unable to select database.');

// ############## output ##############
echo '<table style="border: 1px solid #000000;" width="330" cellpadding="5" cellspacing="0" border="0">
<tr>
<th colspan="2">- Die '. $topic_limit .' letzten Beiträge aus dem Forum -</th>
</tr>';
// ############## output ##############

$where_forums = ( $special_forums == '0' ) ? '' : 't.forum_id NOT IN ('. $forum_ids .') AND ';
$sql = "SELECT t.*, f.forum_id, f.forum_name, u.username AS first_poster, u.user_id AS first_poster_id, u2.username AS last_poster, u2.user_id AS last_poster_id, p.post_username AS first_poster_name, p2.post_username AS last_poster_name, p2.post_time
FROM ". $table_prefix ."topics t, ". $table_prefix ."forums f, ". $table_prefix ."users u, ". $table_prefix ."posts p, ". $table_prefix ."posts p2, ". $table_prefix ."users u2
WHERE $where_forums t.topic_poster = u.user_id AND f.forum_id = t.forum_id AND p.post_id = t.topic_first_post_id AND p2.post_id = t.topic_last_post_id AND u2.user_id = p2.poster_id
ORDER BY t.topic_last_post_id DESC LIMIT $topic_limit";
$result = mysql_query($sql);
if( !$result )
{
die('SQL Statement Error: '. mysql_error());
exit();
}

$line = array();
while( $row = mysql_fetch_array($result) )
{
$line[] = $row;
}

for( $i = 0; $i < count($line); $i++ )
{
$forum_id = $line[$i]['forum_id'];
$forum_url = $root_path.'forum'.$forum_id.'.html';
$topic_id = $line[$i]['topic_id'];
$topic_url = $root_path .'ftopic'. $topic_id.'.html';

$topic_title = ( strlen($line[$i]['topic_title']) < $topic_length ) ? $line[$i]['topic_title'] : substr(stripslashes($line[$i]['topic_title']), 0, $topic_length) .'...';

$topic_type = ( $line[$i]['topic_type'] == '2' ) ? 'Announcement ': '';
$topic_type .= ( $line[$i]['topic_type'] == '3' ) ? 'Global Announcement ': '';
$topic_type .= ( $line[$i]['topic_type'] == '1' ) ? 'Sticky ': '';
$topic_type .= ( $line[$i]['topic_vote'] ) ? 'Poll ': '';

$views = $line[$i]['topic_views'];
$replies = $line[$i]['topic_replies'];

$first_time = date('d.m.Y', $line[$i]['topic_time']);
$first_author = ( $line[$i]['first_poster_id'] != '-1' ) ? '<a href="'. $root_path .'profile.php?mode=viewprofile&u='. $line[$i]['first_poster_id'] .'">'. $line[$i]['first_poster'] .'</a>' : ( ($line[$i]['first_poster_name'] != '' ) ? $line[$i]['first_poster_name'] : 'guest' );
$last_time = date('d.m.Y', $line[$i]['post_time']);
$last_author = ( $line[$i]['last_poster_id'] != '-1' ) ? $line[$i]['last_poster'] : ( ($line[$i]['last_poster_name'] != '' ) ? $line[$i]['last_poster_name'] : 'guest' );
$last_url = '<a href="'. $root_path .'viewtopic.php?p='. $line[$i]['topic_last_post_id'] .'#'. $line[$i]['topic_last_post_id'] .'">'. $last_author .'</a>';

// ############## output ##############
echo '<tr bgcolor="#FFFFCC">
<td valign="top" nowrap="nowrap">'. $topic_type .'<a href="'. $topic_url .'" class="forenlinks">'. $topic_title .'</a></td>
</tr>
<tr>
<td><span class="recenttext">Beitrag von '. $last_author .' in <a href="'. $forum_url .'" class="forenlinks2">'. $line[$i]['forum_name'] .'</a> ('. $last_time .')</span></td>
</tr>';
// ############## output ##############
}

echo '</table>';
mysql_close();
?>

Verfasst: 12.06.2006 15:04
von SoLo1905
manchmal ist es so also sei du still

hast du vlt eine andere template anstadt SubSilver wo du des installieren willst?

Verfasst: 12.06.2006 15:16
von darkeyeX
Nein, ich benutze das Subsilver Template. Kann mir sonst keiner helfen? Wäre schon sehr dringend, ich möchte nämlich ein Forum nur für Modeatoren einrichten, und die Besucher sollen den Topic-Titel in der recent-Datei nicht lesen dürfen...

Nochmal: Ich benutze die recent.php auf einer nicht phpBB-Seite. Hat das vielleicht damit was zu tun?

Also ich habe wirklich schon alles versucht, aber es klappt einfach nicht. Vielleicht habe ich aber auch irgendeinen Denkfehler?!

Verfasst: 13.06.2006 12:37
von darkeyeX
Kann mir echt keiner helfen? :-?

Verfasst: 13.06.2006 13:16
von Markus67
Hi ...

Code: Alles auswählen

$special_forums = '0'; // specify forums ('0' = no; '1' = yes) 
Hier muss eine 1 rein :wink: dann sollte es eigentlich funktionieren.

Markus

Verfasst: 13.06.2006 13:44
von darkeyeX
Markus67, du bist mein phpBB-Held :grin: