| :: |
| Author |
Message |
humble
Joined: 23 Mar 2008 Posts: 5
|
Posted: Sat May 03, 2008 10:01 pm Post subject: How do I use phpbb seo mod to get the url for a post? |
|
|
Hi
I have created rss for my forum, but it generated url is post url not the SEO url (eg., /viewtopic?t=xxx instead of /post-title.html. Is there any method available in phpbb seo where I can pass the title and get the url?
Thanks |
|
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
humble
Joined: 23 Mar 2008 Posts: 5
|
Posted: Tue May 06, 2008 1:25 pm Post subject: Re: How do I use phpbb seo mod to get the url for a post? |
|
|
yes, it was posted in phpbb forum and I did few changes, but this one (generating seo link) I couldn't find it in your code. I think it would be like a method which get post details and return the seo url, Am i right?
TIA |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Tue May 06, 2008 1:41 pm Post subject: Re: How do I use phpbb seo mod to get the url for a post? |
|
|
Well yes, the general principle is to grab titles as well as other info such as topic type (if global announcement) before the link is built with append_sid() and the phpbb_seo classe does the rest.
Example in viewtopic.php :
| Code: | $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 |
After forum and topic titles are known, all consecutive calls to append_sid() will successfully rewrite the urls
++ |
_________________ 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 |
|
| Back to top |
|
 |
humble
Joined: 23 Mar 2008 Posts: 5
|
Posted: Tue May 06, 2008 1:47 pm Post subject: Re: How do I use phpbb seo mod to get the url for a post? |
|
|
| Thanks for the prompt response. But I am afraid the RSS mod doesn't use append_url. Would appreciate if I can get a method if I pass the topic/title data and get the seo url. Sorry, I am not that good in php |
|
|
| Back to top |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3117
|
Posted: Tue May 06, 2008 1:50 pm Post subject: Re: How do I use phpbb seo mod to get the url for a post? |
|
|
Problem is, it's a lot easier to pass though the append_sid function to take all the settings into accounts (like virtual folder and so on) easily.
If your scrip is sharing phpBB's sessions and code it's easy, if not, it's more work, maybe you want to want until we release GYM 2.0
++ |
_________________
|
|
| Back to top |
|
 |
humble
Joined: 23 Mar 2008 Posts: 5
|
Posted: Tue May 06, 2008 1:57 pm Post subject: Re: How do I use phpbb seo mod to get the url for a post? |
|
|
ok, I will give it a try, Thanks. I will wait for GYM..  |
|
|
| Back to top |
|
 |
|
|