Download configuration file Web.config.txt, rename it to Web.config,
and place it into the phpBB root directory.
Unfortunately, there are some bugs in phpBB which generate errors with Phalanger.
function sql_nextid($query_id = 0)
The method is declared twice in the class. Comment one of its versions (both are the same).
array_pop($category_rows); as follows:
$category_rows = array(); while( $category_rows[] = $db->sql_fetchrow($result) ); // removes the last item which is bool(false): array_pop($category_rows); $db->sql_freeresult($result); if( ( $total_categories = count($category_rows) ) )
$email specified twice. Rename the first e.g. to $_email:
function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current_email, &$coppa, &$username, &$email, &$new_password, &$cur_password, &$password_confirm, &$icq, &$aim, &$msn, &$yim, &$website, &$location, &$occupation, &$interests, &$signature, &$viewemail, &$notifypm, &$popup_pm, &$notifyreply, &$attachsig, &$allowhtml, &$allowbbcode, &$allowsmilies, &$hideonline, &$style, &$language, &$timezone, &$dateformat, &$session_id)
In file viewtopic.php, place the following code on the beginning (after inclusions):
/*
Phalanger: this function replaces regular expression matching HTML inner text '#(\>(((?>([^><]+|(?R)))*)\<))#se')
*/
function ReplaceHtmlText($str,$callback)
{
$tag = false;
$t = 0;
$result = "";
for ($i=0;$i<strlen($str);$i++)
{
if ($tag && $str[$i]=='>')
{
$tag = false;
$result .= substr($str,$t,$i - $t);
$result .= '>';
$t = $i+1;
}
elseif (!$tag && $str[$i]=='<')
{
$tag = true;
$result .= $callback(substr($str,$t,$i - $t));
$result .= '<';
$t = $i+1;
}
}
if (!$tag)
$result .= $callback(substr($str,$t,$i - $t));
return $result;
}
function WordsReplaceCallback($str)
{
return preg_replace($GLOBALS["orig_word"],$GLOBALS["replacement_word"],$str);
}
function HighlightCallback($str)
{
return preg_replace(
'#\b("' . $GLOBALS["highlight_match"] . '")\b#i',
'<span style="color:#' . $GLOBALS["theme"]["fontcolor3"] . '"><b>\1</b></span>',
$str);
}
And make changes in the following piece of code (around line 1103):
//
// Highlight active words (primarily for search)
//
if ($highlight_match)
{
// Phalanger replacement:
/* $message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace('#\b(" . $highlight_match . ")\b#i', '<span style=\"color:#" . $theme['fontcolor3'] . "\"><b>\\\\1</b></span>', '\\0')", '>' . $message . '<'), 1, -1)); */
$message = str_replace('\"', '"', ReplaceHtmlText($message,"HighlightCallback"));
}
//
// Replace naughty words
//
if (count($orig_word))
{
$post_subject = preg_replace($orig_word, $replacement_word, $post_subject);
if ($user_sig != '')
{
// Phalanger replacement:
/* $user_sig = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $user_sig . '<'), 1, -1));*/
$user_sig = str_replace('\"', '"', ReplaceHtmlText($message,"WordsReplaceCallback"));
}
// Phalanger replacement:
/* $message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $message . '<'), 1, -1));*/
$message = str_replace('\"', '"', ReplaceHtmlText($message,"WordsReplaceCallback"));
}