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  
 
   
Making URL compatible with advanced-phpbb-seo

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB3 mod Rewrite
::  
Author Message
WhoSayIn



Joined: 22 Aug 2008
Posts: 10

Making URL compatible with advanced-phpbb-seoPosted: Sun Sep 14, 2008 2:34 pm    Post subject: Making URL compatible with advanced-phpbb-seo

hi, i'm using this code to show recent topics on mkportal, it works fine, but urls are like "http://cepworld.net/mobil/viewtopic.php?f=16&t=188" i want them like "http://cepworld.net/mobil/anti-virus-guvenlik-f16/mumsms-v4-16-t188.html"

thanx in advance

Code:
<?php
$prefix        = "phpbb_";   // Database prefix
$limit         = 10;       // Number of forum posts to show in block
$cutoff        = 40;       // Number of characters to display in title
$startformat   = "long";      // Formats the start date.
                              //Options are short, time, small, normal, long or leave blank for default.
$lastformat    = "short";     // Formats the last post date.
                              //Options are short, time, small, normal, long or leave blank for default.
/*------------------------------------------------------------------------
Forum images Config:
--------------------------------------------------------------------------*/
$img_first_topic    ="<img src=\"$mkportals->forum_url/styles/subsilver2/imageset/topic_read.gif\" boder=\"0\">";
$img_last_topic     ="<img src=\"$mkportals->forum_url/styles/subsilver2/imageset/icon_topic_latest.gif\" boder=\"0\">";
                              //images are from phpbb3 default template subsilver2 you also can use your own template images
                              //empty images canbe used by "" eg: $img_first_topic ="";
/*-------------------------------------------------------------------------
Language Setting:
--------------------------------------------------------------------------*/
$lang_topic_title        ="Konu Basligi";
$lang_last_post          ="Son Mesaj";
$lang_last_post_date     ="Son Mesaj Tarihi";
$lang_views              ="Hit";
$lang_replies            ="Cevaplar";
$lang_go_to_last_post    ="Son mesaja git...";
$lang_topic_started_by   ="Konuyu baslatan:";
$lang_on                 ="-";
$lang_by                 ="-";
$lang_last_poster        ="Son Cevap:";
/*------------------------------------------------------------------------*/

$content = "
<tr>
  <td>

    <table class=\"moduleborder\" cellspacing=\"1\" width=\"100%\">
      <tr>
   <th class=\"modulex\" width=\"35%\" style=\"padding-left: 10px;\">$lang_topic_title</th>
   <th class=\"modulex\" width=\"30%\" style=\"padding-left: 10px;\">$lang_last_post</th>
   <th class=\"modulex\" width=\"25%\" style=\"padding-left: 10px;\">$lang_last_post_date</th>
   <th class=\"modulex\" width=\"5%\" style=\"text-align: center;\">$lang_views</th>
   <th class=\"modulex\" width=\"5%\">$lang_replies</th>
      </tr>
";

    $DB->query("SELECT forum_id, forum_password FROM ".$prefix."forums");
    while( $f = $DB->fetch_row() ) {
       if ($f['forum_password'] != "" ) {
                  $bad[] = $f['forum_id'];
           } else {
               $good[] = $f['forum_id'];
           }
       }

    if ( count($bad) > 0 ) {
           $qe = " AND forum_id NOT IN(".implode(',', $bad ).") ";
       }

      $DB->query("SELECT t.topic_last_post_id, t.topic_id, t.topic_title, t.topic_views, t.topic_replies, t.topic_time, t.topic_last_post_time, t.topic_first_poster_name, t.topic_last_poster_name, topic_poster, t.forum_id
      
             FROM ".$prefix."topics t
             LEFT JOIN ".$prefix."forums f ON (t.forum_id = f.forum_id)
             WHERE topic_approved != 0 AND topic_approved = 1 AND (topic_moved_id = 0 or topic_moved_id='') $qe
             GROUP BY t.topic_title
             ORDER BY t.topic_last_post_id DESC LIMIT 0,$limit");      

       while ( $post = $DB->fetch_row() ) {
      $post['title'] = strip_tags($post['title']);
      $post['topic_title'] = str_replace( "!" , "!" , $post['topic_title'] );
      $post['topic_title'] = str_replace( "&quot;", "\"", $post['topic_title'] );
         if (strlen($post['topic_title']) > $cutoff) {
            $post['topic_title'] = substr( $post['topic_title'],0,($cutoff - 3) ) . "...";
            $post['topic_title'] = preg_replace( '/&(#(\d+;?)?)?(\.\.\.)?$/', '...',$post['topic_title'] );
         }       

      $title = $post['topic_title'];
       $tid = $post['topic_id'];      
      $tlastid = $post['topic_last_post_id'];
          $views = $post['topic_views'];
      $posts = $post['topic_replies'];
      $starter = $post['topic_first_poster_name'];
      $lastname = $post['topic_last_poster_name'];
      $lastid = $post['topic_poster'];
      $forum_id = $post['forum_id'];
      $startdate  = $this->create_date($post['topic_time'], $startformat);
      $lastdate  = $this->create_date($post['topic_last_post_time'], $lastformat);

      $content .= "
<!-- topic begin -->
      <tr>
   <td class=\"modulecell\" style=\"padding-left: 10px; text-align: left;\">
     $img_first_topic <a style=\"text-decoration: none; font-weight: bold;\" rel=\"nofollow\" href=\"$mkportals->forum_url/viewtopic.php?f=$forum_id&t=$tid\" title=\"$lang_topic_started_by $starter $lang_on $startdate\">$title</a>
   </td>
   <td class=\"modulecell\" style=\"padding-left: 10px; text-align: left;\">
     <a rel=\"nofollow\" href=\"$mkportals->forum_url/viewtopic.php?f=$forum_id&t=$tid&p=$tlastid#p$tlastid\" title=\"$lang_go_to_last_post\">$img_last_topic $lang_last_post</a> $lang_by <a rel=\"nofollow\" href=\"$mkportals->forum_url/memberlist.php?mode=viewprofile&u=$lastid\" title=\"$lang_last_poster $lastname\"><b>$lastname</b></a>
   </td>
   <td class=\"modulecell\" style=\"padding-left: 10px; text-align: left;\">$lastdate</td>
   <td class=\"modulecell\" style=\"padding-right: 10px; text-align: right;\"> $views </td>
   <td class=\"modulecell\" style=\"padding-right: 10px; text-align: right;\"> $posts </td>             
   </td>
      </tr>
<!-- topic end -->   
      ";
}

$content .= "
    </table>

  </td>
</tr>
"; 

          unset($prefix);
          unset($limit);
          unset($cutoff);
          unset($startformat);
          unset($lastformat);
          unset($perms);
          unset($good);
          unset($bad);
          unset($qe);
          unset($post);
          unset($tid);
          unset($title);
          unset($views);
          unset($posts);
          unset($startdate);
          unset($lastdate);
          unset($starter);
          unset($lastname);
          unset($lastid);
          unset($tlastid);
          unset($forum_id);

          unset($img_last_topic);
          unset($img_first_topic);
         
          unset($lang_topic_title);
          unset($lang_last_post);
          unset($lang_last_post_date);
          unset($lang_views);
          unset($lang_replies);
          unset($lang_go_to_last_post);
          unset($lang_topic_started_by);
          unset($lang_on);
          unset($lang_by);
          unset($lang_last_poster);           

?>
Back to top
WhoSayIn



Joined: 22 Aug 2008
Posts: 10

Making URL compatible with advanced-phpbb-seoPosted: Thu Sep 18, 2008 11:41 am    Post subject: Re: Making URL compatible with advanced-phpbb-seo

please help me Sad
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 15133

Making URL compatible with advanced-phpbb-seoPosted: Sat Sep 20, 2008 9:26 am    Post subject: Re: Making URL compatible with advanced-phpbb-seo

The mkportal integration does not help in this case, but have you tried to search the forum about it, if I recall well, topics where already started about mkportal.

++

_________________
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
Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB3 mod Rewrite
Page 1 of 1

Navigation Similar Topics

Jump to: