MKportal with Advanced mod Rewrite

phpBB2 SEO Advanced mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting categories, forums and topic titles in their URLs.

Moderator: Moderators

MKportal with Advanced mod Rewrite

Postby emielvenlo » Sat Feb 24, 2007 1:19 pm

Hello,

I have started to build my new forum/portal with phpbb/mkportal. The advances mod rewrite is one of the most importand mods i need because it has such pretty urls and it will lead a lot of people to my forum from google.

Right now i have the able2know mod installed and it allsow works verry good, it gave me 3 pageranks higher. But the pretty urls and the active community have convinced me to transfer to the phpbb-seo Advanced mod Rewrite.

But i have the following problem:
on http://testforum.brandpreventieforum.nl/ you can see i have a testforum with phpbb and mkportal. I allsow have installed the Advanced mod Rewrite on the forum. As you can see in the forum the mod rewrite works perfectly, but as expected the links from the portal to the forum give ugly urls.

Luckely there are not many links from the portal tot the forum, only the latest posts in the side menu online members and latest member.

The last posts on the portal page is a seperate module and can be seperated from the rest: http://testforum.brandpreventieforum.nl/forum/topic.php
The exact content of this module is:
Code: Select all
<?php

// Amount of active topics to show
define("TOPIC_COUNT", 8);

// Path to the phpBB 2.0 root directory
define("PHPBB_PATH", "/home/sites/webhosting/bureauvanrossum/brandpreventieforum/testforum/forum/");

// URL to the phpBB 2.0 installation
define("PHPBB_LOCATION", "http://testforum.brandpreventieforum.nl/forum/");

// Time format to output the date/time (for format see PHP manual)
define("TIME_FORMAT", "d/m/Y");

// Includes of phpBB scripts
$phpbb_root_path = PHPBB_PATH;
if ( !defined('IN_PHPBB') )
{
  define('IN_PHPBB', true);
  include(PHPBB_PATH . 'extension.inc');
  include(PHPBB_PATH . 'config.'.$phpEx);
  include(PHPBB_PATH . 'includes/constants.'.$phpEx);
  include(PHPBB_PATH . 'includes/db.'.$phpEx);
}

// HTML header start

?>
<style>
a:link,
a:visited {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   color: #496c9f;   
   text-decoration: none;   
}

a:hover {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   color: #496c9f;   
   text-decoration: underline;
}

a:active {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   color: #496c9f;   
   text-decoration: none;    
}
</style>
<table border="0" cellpadding="2" cellspacing="1" width="100%">
<tr>
<th align="center" bgcolor="#DFE6EF"><font color="#615F5F" size="2">Onderwerp</font></th>
<th align="center" bgcolor="#DFE6EF"><font color="#615F5F" size="2">Bekeken</font></th>
<th align="center" bgcolor="#DFE6EF"><font color="#615F5F" size="2">Antwoorden</font></th>
<th align="center" bgcolor="#DFE6EF"><font color="#615F5F" size="2">Laatste reactie door</font></th>
<th align="center" bgcolor="#DFE6EF"><font color="#615F5F" size="2">Datum</font></th>
</tr>
<?php

// HTML header end

$sql = "SELECT DISTINCT t.topic_title, t.topic_id,t.topic_views,t.topic_replies, t.topic_last_post_id, p.post_time,p.poster_id, f.forum_name, u.user_id, u.username
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . FORUMS_TABLE . " AS f, " . USERS_TABLE . " AS u
WHERE
t.forum_id = f.forum_id
AND f.auth_view = " . AUTH_ALL . "
AND p.topic_id = t.topic_id
AND p.poster_id = u.user_id
AND p.post_id = t.topic_last_post_id
ORDER BY p.post_time DESC LIMIT " . TOPIC_COUNT;
$nt_result = $db->sql_query($sql);

if(!$nt_result)
{
die("Failed obtaining list of active topics".mysql_error());
}
else
{
$nt_data = $db->sql_fetchrowset();
}
if ( count($nt_data) == 0 )
{
die("No topics found");
}
else
{
$cq = 1;
$cc = FFFFFF;
// $nt_data contains all interesting data
for ($i = 0; $i < count($nt_data); $i++)
{
$title = $nt_data[$i]['topic_title'];
$Turl = PHPBB_LOCATION . 'viewtopic.' . $phpEx . "?t=" . $nt_data[$i]['topic_id'];
$LPurl = PHPBB_LOCATION . 'viewtopic.' . $phpEx . "?" . POST_POST_URL . "=" . $nt_data[$i]['topic_last_post_id'] . "#" . $nt_data[$i]['topic_last_post_id'];
$on_forum = 'Forum ' . $nt_data[$i]['forum_name'];
$post_time = date(TIME_FORMAT, $nt_data[$i]['post_time']);
//Profile profile.php?mode=viewprofile&u=23
$profile = PHPBB_LOCATION . 'profile.' . $phpEx . "?mode=viewprofile&u=" . $nt_data[$i]['poster_id'] ;
$usrname = $nt_data[$i]['username'];
// Item HTML start
if($cq%2 == 0){$cc = DFE6EF;$cq++;} else{$cc = E8EFF4;$cq++;}?>
<tr>
<td bgcolor="#<?php echo $cc;?>" align="left"><a href="<?php echo $LPurl; ?>" title="<?php echo $on_forum; ?>" target="_parent"><font face="verdana" color="#496C9F" size="1"><B><?php echo $title; ?></B></font></a></td>
<td bgcolor="#<?php echo $cc;?>" align="left"><div align="center"><font face="verdana" color="#615F5F" size="1"><?php echo $nt_data[$i]['topic_views'] ?></div></td>
<td bgcolor="#<?php echo $cc;?>" align="left"><font face="verdana" color="#615F5F" size="1"><div align="center"><?php echo $nt_data[$i]['topic_replies'] ?></div></td>
<td align="center" bgcolor="#<?php echo $cc;?>" align="left"><font face="verdana" color="#666666" size="1"><a href="<?php echo $profile; ?>" target="_parent"><font face="verdana" color="#496C9F" size="1"><B><?php echo $usrname?></B></a></td>
<td bgcolor="#<?php echo $cc;?>" align="left"><font face="verdana" color="#615F5F" size="1"><div align="center"><?php echo $post_time ?></div></td>
</tr>
<?php
// Item HTML end
}
}
// Footer HTML start
?>
</table>


I was not able to find the logic in the mod sow that i could make the changes myself :(

Here are the parts of the block on the right:
Site stats:
Code: Select all
<?php
/*
+--------------------------------------------------------------------------
|   MkPortal
|   ========================================
|   by Meo aka Luponero <Amedeo de longis>
|      Don K. Colburn <visiblesoul.net>
|
|   Copyright (c) 2004-2006 mkportal.it
|   http://www.mkportal.it
|   Email: luponero@mclink.it
|
+---------------------------------------------------------------------------
|
|   > MKPortal
|   > Written By Amedeo de longis
|   > Date started: 9.2.2004
|
+--------------------------------------------------------------------------
*/
if (!defined("IN_MKP")) {
    die ("Sorry !! You cannot access this file directly.");
}

$content = "";
   $link_user = $mklib_board->forum_link("profile");
   $counter = $this->config['counter'];
   $stat = $mklib_board->get_site_stat();
   $count_holder = sprintf ("%07d", "$counter");

   
   $countgal = $this->stats['tot_gallery'];
   $countdown = $this->stats['tot_download'];
   $countblog = $this->stats['tot_blog'];
   $countsite = $this->stats['tot_topsite'];
   $countrev = $this->stats['tot_reviews'];

for ($n = 0; $n < strlen($count_holder); $n++) ($nbhits .= "<img src=\"$this->images/led/{$count_holder[$n]}.gif\" style=\"border: solid 1px #ffffff;\" alt=\"\" />");

$content .= "
            <tr>
              <td class=\"tdblock\">
              <span class=\"mktxtcontr\">{$stat['total_posts']}</span> {$this->lang['posts']}:
              </td>
            </tr>
            <tr>
              <td class=\"tdglobal\">
              {$stat['topics']} {$this->lang['topics']}
              </td>
            </tr>
            <tr>
              <td class=\"tdglobal\">
              {$stat['replies']} {$this->lang['replies']}<br />
              </td>
            </tr>";

if (!$this->config['mod_blog']) {      
   $content .= "            
            <tr>
              <td class=\"tdblock\">
              <span class=\"mktxtcontr\">$countblog</span> {$this->lang['blog']}:
              </td>
            </tr>
            <tr>
              <td class=\"tdglobal\">
              {$this->lang['user_created']}<br />
              </td>
            </tr>";
}            
if (!$this->config['mod_gallery']) {            
   $content .= "
            <tr>
              <td class=\"tdblock\">
              <span class=\"mktxtcontr\">$countgal</span> {$this->lang['images']}:
              </td>
            </tr>
            <tr>
              <td class=\"tdglobal\">
              {$this->lang['in_gallery']}<br />
              </td>
            </tr>";
}
if (!$this->config['mod_downloads']) {            
   $content .= "
            <tr>
              <td class=\"tdblock\">
              <span class=\"mktxtcontr\">$countdown</span> {$this->lang['files']}:
              </td>
            </tr>
            <tr>
              <td class=\"tdglobal\">
              {$this->lang['in_download']}<br />
              </td>
            </tr>";
}
if (!$this->config['mod_topsite']) {            
   $content .= "            
            <tr>
              <td class=\"tdblock\">
              <span class=\"mktxtcontr\">$countsite</span> {$this->lang['sites']}:
              </td>
            </tr>
            <tr>
              <td class=\"tdglobal\">
              {$this->lang['in_topsite']}<br />
              </td>
            </tr>";
}
if (!$this->config['mod_reviews']) {            
   $content .= "            
            <tr>
              <td class=\"tdblock\">
              <span class=\"mktxtcontr\">$countrev</span> {$this->lang['reviews']}:
              </td>
            </tr>
            <tr>
              <td class=\"tdglobal\">
              {$this->lang['in_reviews']}<br />
              </td>
            </tr>";
}

$content .= "            
            <tr>
              <td class=\"tdblock\">
              <span class=\"mktxtcontr\">{$stat['members']}</span> {$this->lang['u_registered']}:
              </td>
            </tr>
            <tr>
              <td class=\"tdglobal\">
              {$this->lang['last']}: <a class=\"uno\" href=\"$link_user={$stat['last_member']}\">{$stat['last_member_name']}</a>
              </td>
            </tr>
            <tr>
              <td class=\"tdblock\">
              {$this->lang['access_counter']}:
              </td>
            </tr>
            <tr>
              <td class=\"tdglobal\">
              <center>$nbhits</center>
              </td>
            </tr>
";

   unset($link_user);
   unset($counter);
   unset($stat);
   unset($count_holder);
   unset($query);
   unset($countgal);
   unset($countdown);
   unset($countblog);
   unset($countsite);
   unset($countrev);


?>


and online people:
Code: Select all
<?php
/*
+--------------------------------------------------------------------------
|   MkPortal
|   ========================================
|   by Meo aka Luponero <Amedeo de longis>
|      Don K. Colburn <visiblesoul.net>
|
|   Copyright (c) 2004-2006 mkportal.it
|   http://www.mkportal.it
|   Email: luponero@mclink.it
|
+---------------------------------------------------------------------------
|
|   > MKPortal
|   > Written By Amedeo de longis
|   > Date started: 9.2.2004
|
+--------------------------------------------------------------------------
*/
if (!defined("IN_MKP")) {
    die ("Sorry !! You cannot access this file directly.");
}

   $lonlinelist= $mklib_board->forum_link("onlinelist");
   $users= $mklib_board->get_onlineblock();

   $logged_visible_online = $users[0];
   $logged_hidden_online = $users[1];
   $guests_online = $users[2];
   $online_userlist = $users[3];
   unset ($users);


   $total_online_users = $logged_visible_online + $logged_hidden_online + $guests_online;

         $content = "
            <tr>
              <td width=\"100%\">
                <table border=\"0\" width=\"100%\" cellpadding=\"1\" cellspacing=\"1\">
                  <tr>
               <td class=\"tdblock\">
               <span class=\"mktxtcontr\">$total_online_users</span> {$this->lang['onlineusers']}:
               </td>
                  </tr>
                  <tr>
               <td class=\"tdglobal\">
               <b>$guests_online</b> &nbsp;{$this->lang['guests']}<br /><b>$logged_hidden_online</b> &nbsp;{$this->lang['anons']}<br /><b>$logged_visible_online</b> &nbsp;{$this->lang['noanons']}:<br /> $online_userlist
               </td>
                  </tr>
                </table>
              </td>
            </tr>
            <tr>
              <td class=\"tdblock\">
              <img src=\"$this->images/atb_members.gif\" align=\"left\" alt=\"\" />&nbsp;<a class=\"uno\" href=\"$lonlinelist\">{$this->lang['lastclick']}</a>
              </td>
            </tr>   
            ";

      unset($lonlinelist);
      unset($logged_visible_online);
      unset($logged_hidden_online);
      unset($guests_online);
      unset($online);
      unset($total_online_users);

?>


Could someone help me rewrite these urls? Than the mod rewrite would work perfectly!

Greets Emiel
User avatar
emielvenlo
PR0
PR0
 
Posts: 82
Joined: Sun Jan 21, 2007 10:01 am

Advertisement

Postby dcz » Mon Feb 26, 2007 3:18 pm

Interesting ;)

It looks like we're going to solve this easy thanks to your test server :D

The topic.php script :

First, we need to restore topic title censoring in the script, if we want ot fully comply with phpBB. I don't know if mkportal is reusing phpBB censoring, but I doubt it, as it's mainly a stand alone portal.

Then, we need to start the phpbb_seo class, as the script does not includes common.php. This can cause us a little trouble is mkportal is not including it by itself, or did not populate the board_config array.
It's simple to fix if necessary, the board_config data are only used to build up the phpBB URL, you could just hard code it in phpbb_seo_class.php in case it's needed.

So, you need to add :
Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if (!isset($orig_word)) {
   // Define censored word matches
   $orig_word = array();
   $replacement_word = array();
   obtain_word_list($orig_word, $replacement_word);
}
if (!is_object($phpbb_seo)) {
   include(PHPBB_PATH . 'phpbb_seo/phpbb_seo_class.'.$phpEx);
   $phpbb_seo = new phpbb_seo();
}
// www.phpBB-SEO.com SEO TOOLKIT END

Before :

Code: Select all
// HTML header start



Then, you'd need to replace :

Code: Select all
$title = $nt_data[$i]['topic_title'];
$title = $nt_data[$i]['topic_title'];
$Turl = PHPBB_LOCATION . 'viewtopic.' . $phpEx . "?t=" . $nt_data[$i]['topic_id'];
$LPurl = PHPBB_LOCATION . 'viewtopic.' . $phpEx . "?" . POST_POST_URL . "=" . $nt_data[$i]['topic_last_post_id'] . "#" . $nt_data[$i]['topic_last_post_id'];
$on_forum = 'Forum ' . $nt_data[$i]['forum_name'];
$post_time = date(TIME_FORMAT, $nt_data[$i]['post_time']);
//Profile profile.php?mode=viewprofile&u=23
$profile = PHPBB_LOCATION . 'profile.' . $phpEx . "?mode=viewprofile&u=" . $nt_data[$i]['poster_id'] ; 


with :
Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $nt_data[$i]['topic_title']) : $nt_data[$i]['topic_title'];
if (!isset($phpbb_seo->seo_url['topic'][$nt_data[$i]['topic_id']])) {
   $phpbb_seo->seo_url['topic'][$nt_data[$i]['topic_id']] = $phpbb_seo->format_url($title);
}
$Turl = PHPBB_LOCATION . append_sid('viewtopic.' . $phpEx . "?t=" . $nt_data[$i]['topic_id']);
$LPurl = PHPBB_LOCATION . append_sid('viewtopic.' . $phpEx . "?" . POST_POST_URL . "=" . $nt_data[$i]['topic_last_post_id']) . "#" . $nt_data[$i]['topic_last_post_id'];
$on_forum = 'Forum ' . $nt_data[$i]['forum_name'];
$post_time = date(TIME_FORMAT, $nt_data[$i]['post_time']);
//Profile profile.php?mode=viewprofile&u=23
$profile = PHPBB_LOCATION . append_sid('profile.' . $phpEx . "?mode=viewprofile&u=" . $nt_data[$i]['poster_id']);
// www.phpBB-SEO.com SEO TOOLKIT END


To and up with all links properly rewritten.

Will see for the block after we'll have this one up and running.
It looks like they only output profile links, should only be really difficult, we'll see ;)

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21383
Joined: Fri Apr 28, 2006 9:03 pm

Postby emielvenlo » Mon Feb 26, 2007 3:31 pm

dcz wrote:To and up with all links properly rewritten.

Will see for the block after we'll have this one up and running.
It looks like they only output profile links, should only be really difficult, we'll see ;)

++


Thanks, i will try this tonight and will post the result here!

For the blocks with links to profiles i am thinking about just unlinking them. (the easy way out ;) )
User avatar
emielvenlo
PR0
PR0
 
Posts: 82
Joined: Sun Jan 21, 2007 10:01 am

Postby emielvenlo » Mon Feb 26, 2007 5:33 pm

This is how i made topic.php:

Code: Select all
<?php

// Amount of active topics to show
define("TOPIC_COUNT", 8);

// Path to the phpBB 2.0 root directory
define("PHPBB_PATH", "/home/sites/webhosting/bureauvanrossum/brandpreventieforum/testforum/forum/");

// URL to the phpBB 2.0 installation
define("PHPBB_LOCATION", "http://testforum.brandpreventieforum.nl/forum/");

// Time format to output the date/time (for format see PHP manual)
define("TIME_FORMAT", "d/m/Y");

// Includes of phpBB scripts
$phpbb_root_path = PHPBB_PATH;
if ( !defined('IN_PHPBB') )
{
  define('IN_PHPBB', true);
  include(PHPBB_PATH . 'extension.inc');
  include(PHPBB_PATH . 'config.'.$phpEx);
  include(PHPBB_PATH . 'includes/constants.'.$phpEx);
  include(PHPBB_PATH . 'includes/db.'.$phpEx);
}

// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if (!isset($orig_word)) {
   // Define censored word matches
   $orig_word = array();
   $replacement_word = array();
   obtain_word_list($orig_word, $replacement_word);
}
if (!is_object($phpbb_seo)) {
   include(PHPBB_PATH . 'phpbb_seo/phpbb_seo_class.'.$phpEx);
   $phpbb_seo = new phpbb_seo();
}
// www.phpBB-SEO.com SEO TOOLKIT END


// HTML header start

?>
<style>
a:link,
a:visited {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   color: #496c9f;   
   text-decoration: none;
   font-size: 13px;   
}

a:hover {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   color: #496c9f;   
   text-decoration: underline;
   font-size: 13px;
}

a:active {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   color: #496c9f;   
   text-decoration: none;
   font-size: 13px;
}
</style>
<table border="0" cellpadding="2" cellspacing="1" width="100%">
<tr>
<th align="center" bgcolor="#DFE6EF"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="2">Onderwerp</font></th>
<th align="center" bgcolor="#DFE6EF"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="2">Bekeken</font></th>
<th align="center" bgcolor="#DFE6EF"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="2">Antwoorden</font></th>
<th align="center" bgcolor="#DFE6EF"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="2">Laatste reactie door</font></th>
<th align="center" bgcolor="#DFE6EF"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="2">Datum</font></th>
</tr>
<?php

// HTML header end

$sql = "SELECT DISTINCT t.topic_title, t.topic_id,t.topic_views,t.topic_replies, t.topic_last_post_id, p.post_time,p.poster_id, f.forum_name, u.user_id, u.username
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . FORUMS_TABLE . " AS f, " . USERS_TABLE . " AS u
WHERE
t.forum_id = f.forum_id
AND f.auth_view = " . AUTH_ALL . "
AND p.topic_id = t.topic_id
AND p.poster_id = u.user_id
AND p.post_id = t.topic_last_post_id
ORDER BY p.post_time DESC LIMIT " . TOPIC_COUNT;
$nt_result = $db->sql_query($sql);

if(!$nt_result)
{
die("Failed obtaining list of active topics".mysql_error());
}
else
{
$nt_data = $db->sql_fetchrowset();
}
if ( count($nt_data) == 0 )
{
die("No topics found");
}
else
{
$cq = 1;
$cc = FFFFFF;
// $nt_data contains all interesting data
for ($i = 0; $i < count($nt_data); $i++)
{
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $nt_data[$i]['topic_title']) : $nt_data[$i]['topic_title'];
if (!isset($phpbb_seo->seo_url['topic'][$nt_data[$i]['topic_id']])) {
   $phpbb_seo->seo_url['topic'][$nt_data[$i]['topic_id']] = $phpbb_seo->format_url($title);
}
$Turl = PHPBB_LOCATION . append_sid('viewtopic.' . $phpEx . "?t=" . $nt_data[$i]['topic_id']);
$LPurl = PHPBB_LOCATION . append_sid('viewtopic.' . $phpEx . "?" . POST_POST_URL . "=" . $nt_data[$i]['topic_last_post_id']) . "#" . $nt_data[$i]['topic_last_post_id'];
$on_forum = 'Forum ' . $nt_data[$i]['forum_name'];
$post_time = date(TIME_FORMAT, $nt_data[$i]['post_time']);
//Profile profile.php?mode=viewprofile&u=23
$profile = PHPBB_LOCATION . append_sid('profile.' . $phpEx . "?mode=viewprofile&u=" . $nt_data[$i]['poster_id']);
// www.phpBB-SEO.com SEO TOOLKIT END
$usrname = $nt_data[$i]['username'];
// Item HTML start
if($cq%2 == 0){$cc = DFE6EF;$cq++;} else{$cc = E8EFF4;$cq++;}?>
<tr>
<td bgcolor="#<?php echo $cc;?>" align="left"><a href="<?php echo $LPurl; ?>" title="<?php echo $on_forum; ?>" target="_parent"><font size="2" face="verdana" color="#496C9F" ><B><?php echo $title; ?></B></font></a></td>
<td bgcolor="#<?php echo $cc;?>" align="left"><div align="center"><font  size="2" face="verdana" color="#000000" size="1"><?php echo $nt_data[$i]['topic_views'] ?></div></td>
<td bgcolor="#<?php echo $cc;?>" align="left"><font face="verdana" color="#000000" size="2"><div align="center"><?php echo $nt_data[$i]['topic_replies'] ?></div></td>
<td align="center" bgcolor="#<?php echo $cc;?>" align="left"><font  size="2" face="verdana" color="#000000" ><a href="<?php echo $profile; ?>" target="_parent"><font face="verdana" color="#496C9F" size="2"><B><?php echo $usrname?></B></a></td>
<td bgcolor="#<?php echo $cc;?>" align="left"><font face="verdana" color="#000000" size="2"><div align="center"><?php echo $post_time ?></div></td>
</tr>
<?php
// Item HTML end
}
}
// Footer HTML start
?>
</table>


But it does not work:
Code: Select all
Fatal error: Call to undefined function: obtain_word_list() in /home/sites/webhosting/bureauvanrossum/brandpreventieforum/testforum/forum/topic.php on line 31


see: http://testforum.brandpreventieforum.nl/forum/topic.php

Lin 31 is:
Code: Select all
   obtain_word_list($orig_word, $replacement_word);


It apears, it can nog find the word list..
User avatar
emielvenlo
PR0
PR0
 
Posts: 82
Joined: Sun Jan 21, 2007 10:01 am

Postby dcz » Mon Feb 26, 2007 5:36 pm

Oh, this means phpbb function aren't included at this stage, you can add :

Code: Select all
  include(PHPBB_PATH . 'includes/functions.'.$phpEx);


after :

Code: Select all
  include(PHPBB_PATH . 'includes/constants.'.$phpEx);


++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21383
Joined: Fri Apr 28, 2006 9:03 pm

Postby emielvenlo » Mon Feb 26, 2007 6:27 pm

The followiong error occurs now:
Code: Select all
Fatal error: Call to undefined function: append_sid() in /home/sites/webhosting/bureauvanrossum/brandpreventieforum/testforum/forum/topic.php on line 114


This is line 114:
Code: Select all
$Turl = PHPBB_LOCATION . append_sid('viewtopic.' . $phpEx . "?t=" . $nt_data[$i]['topic_id']);
User avatar
emielvenlo
PR0
PR0
 
Posts: 82
Joined: Sun Jan 21, 2007 10:01 am

Postby emielvenlo » Tue Feb 27, 2007 7:37 pm

I just can't figure out the problem. Becouse the error looks a bit like the one before i randomly try'd to ad include lines from other phpbb files, but that dit not work :(
User avatar
emielvenlo
PR0
PR0
 
Posts: 82
Joined: Sun Jan 21, 2007 10:01 am

Postby dcz » Wed Feb 28, 2007 3:46 pm

All, right, the problem is, mkportal does not includes sessions.php, where the append_sid function is.
My previous fix was not the good one it seems.

You can try including sessions.php instead of functions.php, but it's a bit to much in the end to include all this to only rewrite links.

So forget about the includes fix, and try the following :

find :
Code: Select all
$title = $nt_data[$i]['topic_title'];
$title = $nt_data[$i]['topic_title'];
$Turl = PHPBB_LOCATION . 'viewtopic.' . $phpEx . "?t=" . $nt_data[$i]['topic_id'];
$LPurl = PHPBB_LOCATION . 'viewtopic.' . $phpEx . "?" . POST_POST_URL . "=" . $nt_data[$i]['topic_last_post_id'] . "#" . $nt_data[$i]['topic_last_post_id'];
$on_forum = 'Forum ' . $nt_data[$i]['forum_name'];
$post_time = date(TIME_FORMAT, $nt_data[$i]['post_time']);
//Profile profile.php?mode=viewprofile&u=23
$profile = PHPBB_LOCATION . 'profile.' . $phpEx . "?mode=viewprofile&u=" . $nt_data[$i]['poster_id'] ;


Replace with :

Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $nt_data[$i]['topic_title']) : $nt_data[$i]['topic_title'];
if (!isset($phpbb_seo->seo_url['topic'][$nt_data[$i]['topic_id']])) {
   $phpbb_seo->seo_url['topic'][$nt_data[$i]['topic_id']] = $phpbb_seo->format_url($title);
}
$Turl = PHPBB_LOCATION . $phpbb_seo->seo_url['topic'][$nt_data[$i]['topic_id']] . $phpbb_seo->seo_delim['topic'] . $nt_data[$i]['topic_id'] . $phpbb_seo->seo_ext['topic'];
$LPurl = PHPBB_LOCATION . $phpbb_seo->seo_static['post'] . $nt_data[$i]['topic_last_post_id'] . $phpbb_seo->seo_ext['topic'] . "#" . $nt_data[$i]['topic_last_post_id'];
$on_forum = 'Forum ' . $nt_data[$i]['forum_name'];
$post_time = date(TIME_FORMAT, $nt_data[$i]['post_time']);
//Profile profile.php?mode=viewprofile&u=23
$profile = PHPBB_LOCATION . $phpbb_seo->seo_static['user'] . $nt_data[$i]['poster_id'] . $phpbb_seo->seo_ext['user'];
// www.phpBB-SEO.com SEO TOOLKIT END


instead, for topic.php ;)

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21383
Joined: Fri Apr 28, 2006 9:03 pm

Postby emielvenlo » Wed Feb 28, 2007 10:06 pm

Yes!!! Now it works perfectly.

I have unlinked the other links from the portal to the users so all my links are rewriten ;)
User avatar
emielvenlo
PR0
PR0
 
Posts: 82
Joined: Sun Jan 21, 2007 10:01 am

Postby dcz » Thu Mar 01, 2007 11:51 am

All right :D

For user's profiles, you can do similar changes as per the topic.php script.

we replaced :

Code: Select all
'profile.' . $phpEx . "?mode=viewprofile&u=" . $nt_data[$i]['poster_id'] ;


with :

Code: Select all
$phpbb_seo->seo_static['user'] . $nt_data[$i]['poster_id'] . $phpbb_seo->seo_ext['user'];


The same changes will work everywhere, as long as you do use the proper var for user id, here it was :

Code: Select all
$nt_data[$i]['poster_id']


which is the only part that could be different in other files ;)

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21383
Joined: Fri Apr 28, 2006 9:03 pm


Return to phpBB2 Advanced mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest