Seite 1 von 3
Easy Subforum-Mod und last Topic Title im Index?
Verfasst: 13.07.2006 15:14
von darkon
Der Titel sagt eigentlich alles...
Ich habe in einem Board den Easy Subforums-Mod eingebaut und würde auch gerne die Titel der Foren angezeigt bekommen.
Leider ist es mir nicht gelungen die verschiedenen Mods die es da gibt an den Easy Subforums Mod anzupassen.
Hat hier jemand einen Tipp wie man das hinkriegt?
Verfasst: 13.07.2006 16:15
von Mahony
Hallo
Meinst du das so wie hier?--->
http://www.terraristikecke.de/index.php
Dann mach das folgende:
Code: Alles auswählen
#-----[ FINDE in der index.php ]------------------------------------------
#
$last_post = '' . $last_post_time . '' . '<br />';
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> <a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
#-----[ REPLACE WITH - Ersetze mit]------------------------------------------
#
$last_post = '' . $last_post_time . '' . '<br />';
//-- MOD BEGIN: Last Topic Title on Index -------------------
$ltid = $forum_data[$j]['topic_id'];
$lttitle = $forum_data[$j]['topic_title'];
//
// Censor topic title
//
if ( count($orig_word) )
{
$lttitle = preg_replace($orig_word, $replacement_word, $lttitle);
}
$altlttitle = $lttitle;
$lang_in = $lang['in'];
// undo_htmlspecialchars();
$lttitle = preg_replace("/>/i", ">", $lttitle);
$lttitle = preg_replace("/</i", "<", $lttitle);
$lttitle = preg_replace("/"/i", "\"", $lttitle);
$lttitle = preg_replace("/&/i", "&", $lttitle);
//
// Filter topic_title if not allowed to read
//
if (!$auth_read_ary[$forum_data[$j]['forum_id']]['auth_read'])
{
$lttitle = '';
$lang_in = '';
}
// append first 25 characters of topic title to last topic data
$lttitle = (strlen($lttitle) > 25) ? substr($lttitle,0,25) . '...' : $lttitle;
$last_post .= $lang_in . ' ' . '<a title="' . $altlttitle . '" alt="' . $altlttitle . '" href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$ltid") . '">' . $lttitle . '</a><br />';
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? $lang['by'] . ' ' . ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : $lang['by'] . ' ' . '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> <a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
//-- MOD END: Last Topic Title on Index -------------------
Alles andere solltest du so wie in der Installations-Anleitung zum Last Topic Title on Index MOD machen.
In der originalen Installations-Anleitung heisst es an diese Stelle:
Code: Alles auswählen
#-----[ FIND ]------------------------------------------
#
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
#
Also das oben gepostete statt dem im Original.
Grüße: Mahony
Verfasst: 13.07.2006 16:29
von darkon
Genau sowas

Verfasst: 25.07.2006 23:37
von darkon
Hmmm...
eben stelle ich da einen Fehler fest.
Wenn der letzte Beitrag in einem Subforum ist, wird die Topic-ID nicht in die URL übernommen.
Zu bewundern auf:
www.feindsender.net/phpBB2/index.php
Bei den normalen Foren ist alles korrekt, nur in dem Forum mit den Unterforen führt der Topic-Title mangels Topic ID ins Leere...
Verfasst: 27.07.2006 08:55
von darkon
*Schubs
Weiß echt niemand rat???
Verfasst: 27.07.2006 12:44
von Mahony
Hallo
Verlinke mal bitte deine index.php als Text-Datei, damit man sich das mal ansehen kann.
Grüße: Mahony
Verfasst: 28.07.2006 00:36
von darkon
www.feindsender.net/index.txt
Schonmal besten Dank im Vorraus..

Verfasst: 28.07.2006 02:04
von Mahony
Hallo
Ersetze mal
Code: Alles auswählen
// Modified by Easy Sub-Forums MOD
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id, t.topic_id, t.topic_title, t.topic_last_post_id
FROM ((( " . FORUMS_TABLE . " f
LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
LEFT JOIN " . TOPICS_TABLE . " t ON t.topic_last_post_id = f.forum_last_post_id)
GROUP BY f.forum_id ORDER BY f.cat_id, f.forum_order";
// END Modified by Easy Sub-Forums MOD
mit dem hier:
Code: Alles auswählen
// Modified by Easy Sub-Forums MOD
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id, t.topic_id, t.topic_title, t.topic_last_post_id
FROM ((( " . FORUMS_TABLE . " f
LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
LEFT JOIN " . TOPICS_TABLE . " t ON t.topic_last_post_id = p.post_id )
GROUP BY f.forum_id ORDER BY f.cat_id, f.forum_order";
//-- MOD END: Last Topic Title on Index -------------------
// END Modified by Easy Sub-Forums MOD
Grüße: Mahony
Verfasst: 28.07.2006 03:36
von darkon
Ne, das hat leider keine Änderung gebracht, es wird immer noch keine Thread-ID übermittelt.
Bei den Subforen gibt es nach wie vor nur:
http://www.feindsender.net/phpBB2/viewtopic.php?t=
statt
http://www.feindsender.net/phpBB2/viewtopic.php?t=XXX
Verfasst: 28.07.2006 15:55
von Mahony
Hallo
Ich habe mal deine index.php bearbeitet. Schau mal, ob es damit funktioniert.
index.txt
Wie immer - herunterladen, umbenennen und auf deinen Webspace hochladen.
Grüße: Mahony