Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Tested in the discussion forum. http://drupal.org/node/217369#comment-2338680
In phpbbforum.module
Add this inside _phpbbforum_set_globals()
global $_v_site_forum_url;
// Vorapoap
$clean_url = variable_get("clean_urls", 0);
$site_forum_url = $base_url .'/'. $site_phpbb_page;
if ($clean_url == 0) {
$vpatterns = array('/\//', '/\^/', '/\./', '/\$/', '/\|/',
'/\(/', '/\)/', '/\[/', '/\]/', '/\*/', '/\+/',
'/\?/', '/\{/', '/\}/', '/\,/');
$vreplace = array('\/', '\^', '\.', '\$', '\|', '\(', '\)',
'\[', '\]', '\*', '\+', '\?', '\{', '\}', '\,');
$_v_site_forum_url = array(
preg_replace($vpatterns, $vreplace, $site_forum_url.'/'),
$base_url .'/index.php?q='. $site_phpbb_page
);
}
// \Vorapoap
In phpbbforum.pages.inc
Add this function
//Vorapoap
function _v_phpbbforum_replace_url($output) {
global $_v_site_forum_url;
//http://xx.xx.com/phpbbforum/xxx.php?
return preg_replace('/'.$_v_site_forum_url[0].'(\w+)\.php\??/', $_v_site_forum_url[1].'/$1.php&', $output);
}
//\Vorapoap
And modify below functions
function _phpbbforum_replace_block_links($output) {
$output = _phpbbforum_replace_forum_url($output);
$output = _phpbbforum_restore_block_links($output);
//Vorapoap
if (!empty($GLOBALS['_v_site_forum_url'])) {
$output = _v_phpbbforum_replace_url($output);
}
//\Vorapoap
return $output;
}
function _phpbbforum_replace_block_links($output) {
$output = _phpbbforum_replace_forum_url($output);
$output = _phpbbforum_restore_block_links($output);
//Vorapoap
if (!empty($GLOBALS['_v_site_forum_url'])) {
$output = _v_phpbbforum_replace_url($output);
}
//\Vorapoap
return $output;
}
Next is the fix for "search"
You have to modify phpBB3/styles/...../templates/search_body.html
And put this
<input type="hidden" name="q" value="phpbbforum/search.php" />
You may have a better way to add this code for clean_url version.
Optional Fix
For people want to redirect all non-Drupal page to Drupal page only.
I added this at very top of phpBB3/common.php
//Vorapoap (Hacked (top of /phpBB3/common.php))
if (!defined("ADMIN_START") && !defined("IN_PHPBB_AJAX") && !defined("IN_PHPBB_NO_EMBED")) {
// Not in Drupal embedded page?
if ($_SERVER['PHP_SELF'] != '/index.php') {
$s = $_SERVER['REQUEST_URI'];
$s = str_replace(array('/phpBB3/','.php?'), array('','.php&'), $s);
header("Location: http://".$_SERVER['HTTP_HOST'].'/index.php?q=phpbbforum/'.$s);
exit();
}
}
//\Vorapoap
Comments
Comment #1
vorapoap CreditAttribution: vorapoap commentedThis patch still hasn't been applied in 6.x-2.0-beta9
Comment #2
vb CreditAttribution: vb commentedThanks for patch. In the next beta i will try to add.
Comment #3
phreadom CreditAttribution: phreadom commentedI'm running an embedded forum...
I tried the "Optional Fix" on my forum momentarily, but it ends up breaking pages like the "View More Smiley" link on the posting page. (which shows up as a fully styled fully embedded page instead of a simple, non-wrapped, page.)
Perhaps this wouldn't be an issue if the "View More Smileys" link pointed to the right URL to begin with.
This I think touches on another bug, but I'll post that separately.
Comment #4
vorapoap CreditAttribution: vorapoap commentedHi vb,
Anyone can apply this patch but s/he will also have to modify their "templates" for some Member Search and Post Search to work right... I believe that it also cause a similar GET/POST issue with other phpBB page and phpBB mod as well.
At least, you can give a user a note about this known issue.
I have abandoned to maintain this patch and head to enable ISAPI Rewrite module.
Thanks!
Comment #5
vb CreditAttribution: vb commentedI have tried to apply your patch but with i18n module it has some issues. And I have no time at the moment to fix it.
I have commented the lines in the code marked with your nick and if you want, you will be able to have a look at the code in the next release.
Comment #6
fizk CreditAttribution: fizk commentedPlease reopen if this is still an issue.