Could you please help me with the new version 1.0.4? The code changed a bit. I also moved the date below the topic:
- Code: Select all
//-- 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'];
//
// Filter topic_title if not allowed to read
//
if (!$auth_read_ary[$forum_data[$j]['forum_id']]['auth_read'])
{
$lttitle = '';
$lang_in = '';
}
// undo_htmlspecialchars();
$lttitle = preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, $lttitle);
// do_htmlspecialchars();
// set length of topic title to 25 characters
$lttitle = preg_replace($html_entities_match, $html_entities_replace, (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 .= $lang['on'] . ' ' . $last_post_time . '<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> ';
//-- MOD END: Last Topic Title on Index -------------------
[e] Guess I've just figured it out by myself; is that code correct?
- Code: Select all
//-- 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'];
//
// Filter topic_title if not allowed to read
//
if ($auth_read_ary[$forum_data[$j]['forum_id']]['auth_read'])
{
if (!isset($phpbb_seo->seo_url['topic'][$ltid]) ) {
$phpbb_seo->seo_url['topic'][$ltid] = $phpbb_seo->format_url($lttitle);
}
// undo_htmlspecialchars();
$lttitle = preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, $lttitle);
// do_htmlspecialchars();
// set length of topic title to 25 characters
$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 .= $lang['on'] . ' ' . $last_post_time . '<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> ';
//-- MOD END: Last Topic Title on Index -------------------
The only problem is that it doesn't show the correct link according to the avanced rewrite mod in "jump to last post", i.e.
domain.de/post38205.html#23493
instead of
domain.de/[post-title]38205.html#23493