Inject nickname in profile URL in addons like portals

phpBB3 SEO Advanced mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting forums and topic titles in their URLs.

Moderator: Moderators


Inject nickname in profile URL in addons like portals

Postby Beagleman » Tue Apr 08, 2008 7:16 am

I have a portal (board3).
I know how to inject the forum title and topic title in the forum URL and topic URL. 8)
Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ( empty($phpbb_seo->seo_url['topic'][$topic_id]) ) {
   $phpbb_seo->seo_censored[$topic_id] = censor_text($topic_title);
   $phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($phpbb_seo->seo_censored[$topic_id]);
}
if ( empty($phpbb_seo->seo_url['forum'][$forum_id]) ) {
   $phpbb_seo->seo_url['forum'][$forum_id] = $phpbb_seo->set_url($forum_name,$topic_data['forum_id'], $phpbb_seo->seo_static['forum']);
}
// www.phpBB-SEO.com SEO TOOLKIT END



But I don't know how to inject the nickname in the profile URL. :oops:

Some profile URL in the portal are well modified with the nickname but most of them aren't. I can't find out why. :roll:
So what I have to do to inject the nickname in all profile URL?

Thank you! :)
Beagleman
 
Posts: 5
Joined: Wed Apr 02, 2008 5:26 pm

Advertisement

Postby SeO » Tue Apr 08, 2008 9:11 am

Great job :D

Maybe you should release some patch for the community ;)

For nicknames, it's pretty simpler actually.
All nicknames formatted using the get_username_string() functions properly (to be found in includes/functions_content.php) will have the proper rewriting directly.

If the url is build using another method, you need to grab the nickname the same way we need to for other title injected urls.

For nicknames, it is done using the phpbb_seo class set_user_url() method, like it is done in get_username_string() :
Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$phpbb_seo->set_user_url( strip_tags($username), $user_id );
// www.phpBB-SEO.com SEO TOOLKIT END


Here strip_tag() is used because at this stage, some <i> </i> tags could have been added to the nicknames by phpBB3, it's not necessarily required when building the url "by hand", but it's a costless precaution.

;)
SeO
Administrateur - Site Admin
Administrateur - Site Admin
 
Posts: 5527
Joined: Wed Mar 15, 2006 9:41 pm


Return to Advanced SEO URL




Who is online

Users browsing this forum: No registered users and 6 guests