phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
SEO URL Functions

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    phpBB SEO » SEO Forum  » phpBB3 SEO TooLKit  » phpBB SEO Premod
::  
Author Message
ASLAN
PR0
PR0


Joined: 19 Nov 2007
Posts: 58
Location: Chile

SEO URL FunctionsPosted: 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
Visit poster's website
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 3477

SEO URL FunctionsPosted: 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 Wink

_________________
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
PR0


Joined: 19 Nov 2007
Posts: 58
Location: Chile

SEO URL FunctionsPosted: 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
Visit poster's website
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 3477

SEO URL FunctionsPosted: Thu Jun 26, 2008 2:55 pm    Post subject: Re: SEO URL Functions

You just need topic id, title and type and forum id and name.
In the example they are stored in the $topic_data array, you should be able to easily replace these by the var your script actually uses to provide with these basic data.

_________________
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
PR0


Joined: 19 Nov 2007
Posts: 58
Location: Chile

SEO URL FunctionsPosted: 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
Visit poster's website
ASLAN
PR0
PR0


Joined: 19 Nov 2007
Posts: 58
Location: Chile

SEO URL FunctionsPosted: 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&amp;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
Visit poster's website
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 3477

SEO URL FunctionsPosted: Sat Aug 16, 2008 9:19 am    Post subject: Re: SEO URL Functions

Looks like a duplicate post : http://www.phpbb-seo.com/boards/phpbb-seo-premod/discussions-vt3095.html#19517

_________________
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
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    phpBB SEO » SEO Forum  » phpBB3 SEO TooLKit  » phpBB SEO Premod
Page 1 of 1

Navigation Similar Topics

Jump to: