Administration des Mods geht nur via DB-Access [phpmyadmin]
Intention: Ich wollte einfach nur, dass meine Forumregeln, die in einem Posting verfasst sind, in allen Foren ganz oben stehen - keine Rechteverwaltung, keine neuen Icons, keine aufwändige MOD-Installation, ...
Das Ergebnis:
1 sql-befehl ist auszuführen
1 datei zu ändern [4 Änderungen]
Code: Alles auswählen
#
#-----[ SQL ]-------------------------------------------------
#
ALTER TABLE phpbb_topics ADD topic_is_global TINYINT( 1 ) DEFAULT '0' NOT NULL
#
#-----[ OPEN ]------------------------------------------------
#
viewforum.php
#
#-----[ FIND ]------------------------------------------------
#
//
// All announcement data, this keeps announcements
// on each viewforum page ...
//
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//
// All GLOBAL announcement data, this keeps GLOBAL announcements
// on each viewforum page ...
//
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username
FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . USERS_TABLE . " u2
WHERE t.topic_poster = u.user_id
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u2.user_id
AND t.topic_is_global = 1
ORDER BY t.topic_last_post_id DESC ";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql);
}
$topic_rowset = array();
$total_announcements = 0;
while( $row = $db->sql_fetchrow($result) )
{
$topic_rowset[] = $row;
$total_announcements++;
}
$db->sql_freeresult($result);
// End add - Global announcement MOD
#
#-----[ FIND ]------------------------------------------------
#
AND t.topic_type = " . POST_ANNOUNCE . "
#
#-----[ AFTER, ADD ]------------------------------------------
#
AND t.topic_is_global = 0
#
#-----[ FIND ]------------------------------------------------
#
$topic_rowset = array();
$total_announcements = 0;
#
#-----[ REPLACE WITH ]----------------------------------------
#
//$topic_rowset = array();
//$total_announcements = 0;
#
#-----[ FIND ]------------------------------------------------
#
AND t.topic_type <> " . POST_ANNOUNCE . "
#
#-----[ AFTER, ADD ]------------------------------------------
#
AND t.topic_is_global = 0
MOD wurde inspiriert von: Global Announcement Hack http://www.phpbbhacks.com/download/345
mfg