| |
| |
|
|
|
|
| |
|
| |
|
| :: |
| Author |
Message |
ASLAN PR0

Joined: 19 Nov 2007 Posts: 58 Location: Chile
|
Posted: Wed Jun 25, 2008 7:03 pm Post subject: SEO URL Functions |
|
|
Hi
I wanna thanks first for the great job what you're doing with this SEO tools
They are very useful
Thanks a lot
I want to know if there are available funtions to make the SEO URLs
Examples:
I wanna give the topic id and the forum id to this function and get the SEO URL of the topic
Or give the forum id to another function and get the SEO URL of the forum
There are available this functions ???
I want this functions to make my custom pages
Thanks |
|
|
| Back to top |
|
 |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3477
|
Posted: Thu Jun 26, 2008 8:05 am Post subject: Re: SEO URL Functions |
|
|
In viewtopic.php there is a pretty universal example :
| 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 |
As soon as you have enough info, you need to grab it like that, then, building your topic and forum urls with append_sid() (the regular way) will rewrite with all options  |
_________________ phpBB SEO || SEO Forum || Forum Référencement
GYM Sitemap & RSS for phpBB3 has been released ! || GYM Sitemap & RSS for phpBB3 est disponible ! |
|
| Back to top |
|
 |
ASLAN PR0

Joined: 19 Nov 2007 Posts: 58 Location: Chile
|
Posted: Thu Jun 26, 2008 2:38 pm Post subject: Re: SEO URL Functions |
|
|
I don't know much about OOP PHP, but I will try
I usually work with simple functions
Thanks for your help ... as always |
|
|
| Back to top |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3477
|
|
| Back to top |
|
 |
ASLAN PR0

Joined: 19 Nov 2007 Posts: 58 Location: Chile
|
Posted: Thu Jun 26, 2008 3:24 pm Post subject: Re: SEO URL Functions |
|
|
OK I will try and let you know if it works
Thanks again |
|
|
| Back to top |
|
 |
ASLAN PR0

Joined: 19 Nov 2007 Posts: 58 Location: Chile
|
Posted: Sat Aug 16, 2008 12:41 am Post subject: Re: SEO URL Functions |
|
|
I tryed but I have the next problem
Some topic urls return "topic"
See my example on http://www.comunidadholistica.org/test.php
Thats the code:
| Code: | $query = "select * from hol_topics where topic_status<2 and topic_id>2870 and topic_id<2880";
$result = mysql_query($query, $link);
while ($topic_data = mysql_fetch_assoc($result)) {
$forum_id = $topic_data['forum_id'];
$topic_id = $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_url['topic'][$topic_id] = $phpbb_seo->format_url($topic_data['topic_title']);
}
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
$forum_url = $phpbb_seo->seo_url['forum'][$topic_data['forum_id']];
$topic_url = $phpbb_seo->seo_url['topic'][$topic_id];
if ($topic_url == "topic") {
$url = "viewtopic.php?t=" . $topic_data['topic_id'];
} else {
$url = $forum_url . "/" . $topic_url . "-" . $topic_data['topic_id'] . ".html";
}
$viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id");
echo '<b><a href="' . $url . '">' . $topic_data['topic_title'] . '</a></b>';
echo "<br />";
echo "Foro: " . $forum_url;
echo "<br />";
echo "Tema: " . $topic_url;
echo "<br />";
echo "URL: " . $viewtopic_url;
echo "<br /><br />";
} |
|
|
|
| Back to top |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3477
|
|
| Back to top |
|
 |
|
|
| Navigation |
Similar Topics |
|
|
|
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |