MKPortal Rewriting custom portal modules help!

Discussions and support about the different URL Rewriting techniques for phpBB.

Moderator: Moderators

MKPortal Rewriting custom portal modules help!

Postby sypher » Mon May 26, 2008 6:49 pm

Can i know how would you do to translate this url (a portal URL) to the SEO url ?

viewtopic.php?f={$post['forum_id']}&t={$post['topic_id']}&p={$pid}#p{$pid}

Its a php string as u can see, variables are
$post['forum_id']
$post['topic_id']
$pid (post id) taken before with a query on the database.

I cant really sort it out,looked a little bit on the code but the portal just gets data from the posts table so i dont know how to do the seo url there.

I will post example code from mkportal get_last_posts function.
http://pastebin.com/m4f9c9b3d
Thanks in advance
sypher
 
Posts: 13
Joined: Mon Jul 23, 2007 1:46 pm

Advertisement

Postby dcz » Sat May 31, 2008 1:54 pm

Problem here is that the module does not query for topic titles, only post ones, so it's not patchable without rewriting most of it.

It would no necessarily be complicated, but I do not have any mkportal install right now.
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21383
Joined: Fri Apr 28, 2006 9:03 pm

Postby sypher » Sat May 31, 2008 4:10 pm

well, making a query is not a problem, just tell me what would you do if you had that data available; i'll try to sort out the rest.
sypher
 
Posts: 13
Joined: Mon Jul 23, 2007 1:46 pm

Postby dcz » Mon Jun 02, 2008 9:36 am

Basically, you just need to grab the title to inject before you build the link with append_sid, there is a complete example of this for the advanced mod rewrite in viewtopic.php :

Code: Select all
$forum_id = (int) $topic_data['forum_id'];
$topic_id = (int) $topic_data['topic_id'];
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ( empty($phpbb_seo->seo_url['topic'][$topic_id]) ) {
   if ($topic_data['topic_type'] == POST_GLOBAL) {
      $phpbb_seo->seo_opt['topic_type'][$topic_id] = POST_GLOBAL;
   }
   $phpbb_seo->seo_censored[$topic_id] = censor_text($topic_data['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'][$topic_data['forum_id']]) ) {
   $phpbb_seo->seo_url['forum'][$topic_data['forum_id']] = $phpbb_seo->set_url($topic_data['forum_name'],$topic_data['forum_id'], $phpbb_seo->seo_static['forum']);
}
// www.phpBB-SEO.com SEO TOOLKIT END


As soon as the data is available and before append_sid is used, titles are grabbed this way. With the mixed mod, you would not need to parse the topic title, only the forum one, to let the magic happen with all options available ;)
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21383
Joined: Fri Apr 28, 2006 9:03 pm


Return to phpBB mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 14 guests


 
cron