| :: |
| Author |
Message |
zinnerz PR0

Joined: 08 Jun 2006 Posts: 75
|
Posted: Sat Jan 27, 2007 2:20 am Post subject: Topic on Index - rewrite |
|
|
Dear Dcz,
I'm using phpBB 2.0.22 with Last Topic Title on Index v1.0.1, but the topic title In: topic title link is not rewritten.
please help, thanks
topic on index mod: (I cannot search it on phpBB)
http://rapidshare.com/files/13566546/topic_on_index_101.mod.html |
|
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15242
|
Posted: Sat Jan 27, 2007 1:11 pm Post subject: Re: Topic on Index - rewrite |
|
|
So if it's this Last Topic Title on Index mod, then do the following (only required for the phpBB SEO advanced mod rewrite) :
Open :
Find :
| Code: | 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 />'; |
Replace with :
| Code: | // www.phpBB-SEO.com SEO TOOLKIT BEGIN
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);
}
// 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 />';
}
// www.phpBB-SEO.com SEO TOOLKIT END |
Updating from the 0.0.2 to 0.2.0 patched would just be to find in index.php :
| Code: | | $seo_topic_name = $lttitle; |
And replace with :
| Code: |
if (!isset($phpbb_seo->seo_url['topic'][$ltid]) ) {
$phpbb_seo->seo_url['topic'][$ltid] = $phpbb_seo->format_url($lttitle);
} |
 |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Last edited by dcz on Sat Jan 27, 2007 5:48 pm; edited 1 time in total |
|
| Back to top |
|
 |
zinnerz PR0

Joined: 08 Jun 2006 Posts: 75
|
Posted: Sat Jan 27, 2007 5:44 pm Post subject: Re: Topic on Index - rewrite |
|
|
I have tried it carefully, but it says:
| Code: | | Parse error: syntax error, unexpected '{' in D:\Project\htdocs\phpbb\index.php on line 463 |
|
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15242
|
|
| Back to top |
|
 |
zinnerz PR0

Joined: 08 Jun 2006 Posts: 75
|
Posted: Sat Jan 27, 2007 6:01 pm Post subject: Re: Topic on Index - rewrite |
|
|
You are GREAT
Thanks so much.. |
|
|
| Back to top |
|
 |
lavinya PR1


Joined: 24 Jul 2006 Posts: 161 Location: Turkey
|
Posted: Fri Feb 09, 2007 2:30 pm Post subject: Re: Topic on Index - rewrite |
|
|
hello.
dcz. I not find.
using "Last Topic Title on Index 1.0.4"
and phpBB SEO Advanced mod Rewrite 0.2.2
and
viewtopic.php?t=407
must be
topic-title-t407.html
please help me |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15242
|
|
| Back to top |
|
 |
lavinya PR1


Joined: 24 Jul 2006 Posts: 161 Location: Turkey
|
Posted: Fri Feb 09, 2007 3:33 pm Post subject: Re: Topic on Index - rewrite |
|
|
yes dcz.
but
| Code: | #
#-----[ 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> ';
#
#-----[ REPLACE WITH ]------------------------------------------
#
//-- 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 .= ( $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 ------------------- |
nof find.
NOTE: Problem solved. very thanks dcz.
please see www.lavinya.net/phpBB2/ |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15242
|
|
| Back to top |
|
 |
|
|