| |
| |
|
|
|
|
| |
|
| |
|
| :: |
| Author |
Message |
Alermorg
Joined: 27 Oct 2008 Posts: 1
|
Posted: Mon Oct 27, 2008 11:32 pm Post subject: Rewrite url outside forum |
|
|
I have recently installed phpbb_seo advanced, wohooo!
Since I have my main page (/) a bit integrated with my forum I would like to convert my "/forum/viewtopic?f=##&t=33" url-links to corresponding links in the forum:
"/forum/forum_name/topic_name-t#.html".
How do I accomplish this?
I have begun looking at the phpbb_seo class and the url_rewrite function, but my lack of php-class competence stops me there.
Please help me! |
|
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15414
|
Posted: Sun Nov 02, 2008 12:30 pm Post subject: Re: Rewrite url outside forum |
|
|
It's not very easy to do it in the general case if the site does not share phpBB's code, if it does, eg if it's including phpBB's common.php, then you'll be able to do as within phpBB.
In such case, what needs to get done in order to url rewrite the urls is to properly store the topic and forum titles in the phpbb_seo class before the append_sid() function is called to build the link.
You have a pretty good example of this in viewtopic.php :
| Code: | // 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 |
For what you want, you'd probably need to adapt the code a bit and use it in the link creation loop, but it should not be difficult, please post here the involved code if you need more help.
Or, you could as well parse GYM rss feeds to display the rewritten links, it's very easy if the code is sharing phpBB's code. Examples :
http://phpbb3.phpbb-seo.net/demo/rss-links.php
http://phpbb3.phpbb-seo.net/demo/rss-messages.php
and can be done anywhere in phpBB.
If your code does not share phpBB4s one, you could still use magpie to display GYM's feed (more on this post).
++ |
_________________ 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 |
|
 |
|
| Navigation |
Similar Topics |
|
|
|
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |