mehdi plugins logo
Archived Stuff ...
Free Photoshop Stuff...ContactFAQ (Misc)
 
Related to
Joom 1.5 - Cpg 1.5 bridge:
Drupal bridge
Related to
Joom1.5-Phbb3 bridge :
Related to
Both Joomla bridges:
Popup effect &
bot for thumbnails:
 

updated: 16 may 2009

The purpose of this section is to describe hacks/modifications required for the Joom1.5-Phpbb3 bridge. Please read the main section first, because it might not be necessary to apply any of the hacks below.

Warning: we only hack Phpbb. No hack in Joomla's side.

Concept of Substitute and inc_ file.

To prevent any confusion , I'll define what I call a "substitute file" (and inc_ file).
Example : Let's say you have the Phpbb file faq.php . When you install the bridge, you replace it by a substitute.

  • What is the particularity of the subsitute file ? :
  • It has same name as the original Phpbb file.
  • The content has no relation with the original file.
  • It contains only 3 or 4 lines, and does not change each time you update your Phpbb install.
  • Since subsitutes do not change, you can re-use the ones in provided hacked files.
  • Every substitute is associated with a file of the same name, but with the inc_ prefix (the associated file to faq.php is then inc_faq.php )
  • What is the particularity of the inc_ file ?
  • It is basically the original Phpbb file, that was renamed with the inc_ prefix.
  • Some minimal hacks might be necessary for each inc_ files.

The logic would be that you first rename the original phpbb file with inc_ prefix, and then replace it by substitute.

Subsitutes in the root

The creation of substitutes/ inc_ files in the root of Phbb can be automated (see after). But let's see example for faq.php . Subsitute for the file faq.php contain these lines:

<?php
define("JOOM15_PHPBB3", true);
$phpbbCurPage="faq";
$phpbbCurFolder="root";
require("./joomphpbb_engine2.php");

While inc_faq.php , will have the following code appended at begin:

<?php
if ( !defined('JOOM15_PHPBB3') )
{
die("Hacking attempt");
}
?>

For all substitutes in the root of Phpbb, the only thing that changes is value of the parameter $phpbbCurPage. It's basically name of the file without the php extension. All inc_ files at the root are the original phpbb files renamed, but with the previous mentionned code appended at begin.

In the root of Phpbb, You'll have to create substitutes/inc_ for 11 files: faq.php, index.php, mcp.php, memberlist.php, posting.php, report.php, search.php, ucp.php, viewforum.php, viewtopic.php, viewonline.php. Here's how this can be automated. Copy these 11 files in a folder. Now in the same folder copy provided files quickprocess2.bat and begin2.txt (available in the "others" folder ). Execute the script quickprocess2.bat.

Notes: The script quickprocess2.bat only work under Windows, and only process by default the 11 previously mentionned files. If your Phpbb install is modded, and introduce new files at root, they might need to be processed too.

Substitutes in adm & download folders

In your Phhbb install, file index.php of subfolder adm , and file file.php of subfolder download need to be processed in similar way as files at root. However in the new substitutes , the parameter $phpbbCurFolder correspond now to the name of the subfolder. Also in the last require instruction there is now two dots. Hence the subsitute for download/file.php have the content:

<?php
define("JOOM15_PHPBB3", true);
$phpbbCurPage="file";
$phpbbCurFolder="download";
require("../joomphpbb_engine2.php");

Same logic for file adm/index.php .

Subsitute for file utf_tools.php

Unfortunately Phpbb & Joomla use functions that have same name. To avoid conflicts, we create again a substitute for the file utf_tools.php located in includes/utf (inside Phpbb).

The substitute of utf_tools.php have the code (it's easier to just use the already provided substitute ).

<?php
if (!defined('IN_PHPBB') && !defined('JOOM15_PHPBB3'))
{
exit;
}
//---- don't let the script be loaded more than once -----------
if(!function_exists('utf8_substr')) {
$script_cur_path=dirname(__FILE__) . DIRECTORY_SEPARATOR;
require($script_cur_path. "inc_utf_tools.php");
}

Now here's how we hack the inc_utf_tools.php file. Just at the begin of the file , look for the line:

if (!defined('IN_PHPBB'))

replace it by this code :

if (!defined('IN_PHPBB') && !defined('JOOM15_PHPBB3'))

Hacking the template .

As soon as you integrate Phpbb visually inside Joomla, CSS conflicts occurs. Most CSS problems can be solved by processing all the css of your Phpbb theme with the CSS integrator.

Also the login form you see in the home page of Phpbb doesn't work with user integration enabled. Since version 1.03 of bridge (16 may 2009) , the bridge will try to remove it automatically. However, if that's not enough (you see it on other pages etc..), you can still use "template condition" JOOM_USER_INTEG to completly get rid of it.

Example , in the template of prosilver, file index_body.html , I replace line

<!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->

by line :

<!-- IF not S_USER_LOGGED_IN and not S_IS_BOT and not JOOM_USER_INTEG -->

 
 
  Copyright © 2004-2017 Mehdi - All rights reserved