Mit recent.php spezielle Rubrik ausschliessen

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
darkeyeX
Mitglied
Beiträge: 476
Registriert: 31.10.2004 14:40

Mit recent.php spezielle Rubrik ausschliessen

Beitrag 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?
SoLo1905

Beitrag 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
darkeyeX
Mitglied
Beiträge: 476
Registriert: 31.10.2004 14:40

Beitrag 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();
?>
SoLo1905

Beitrag von SoLo1905 »

manchmal ist es so also sei du still

hast du vlt eine andere template anstadt SubSilver wo du des installieren willst?
darkeyeX
Mitglied
Beiträge: 476
Registriert: 31.10.2004 14:40

Beitrag 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?!
darkeyeX
Mitglied
Beiträge: 476
Registriert: 31.10.2004 14:40

Beitrag von darkeyeX »

Kann mir echt keiner helfen? :-?
Benutzeravatar
Markus67
Ehrenadmin
Beiträge: 28346
Registriert: 12.01.2004 16:02
Wohnort: Neuss
Kontaktdaten:

Beitrag 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
darkeyeX
Mitglied
Beiträge: 476
Registriert: 31.10.2004 14:40

Beitrag von darkeyeX »

Markus67, du bist mein phpBB-Held :grin:
Antworten

Zurück zu „phpBB 2.0: Mod Support“