I'm using PHP Version 4.4.1 and unfortunately do not have the option to upgrading to PHP 5. I'm also not very familiar with PHP yet.
Here's the error message I'm getting:
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /PageRestrictionHooks.php on line 328
Here's the piece of code where the error is (line 328 is in red):
function DescribeRestrictionsHook( &$parser, &$text ) {
global $wgTitle;
$page = $wgTitle->getPrefixedText();
$dbr =& wfGetDB( DB_SLAVE );
$res = $dbr->query( "
SELECT page_prefix
FROM page_prefixes
WHERE LOCATE(page_prefix, '$page')=1
ORDER BY LENGTH(page_prefix) DESC LIMIT 1
" );
if( $dbr->numRows( $res ) > 0 ) {
[COLOR="Red"]$prefix = ( $dbr->fetchObject( $res )->page_prefix[/COLOR]
if( strlen( trim( $prefix ) ) )
$text = " <pre><font color=\"red\">Access to this page is regulated with a prefix <b><a href=\"index.php?title=Special:PrefixAdministration&action=edit_prefixed_page&page_prefix=$prefix\">$prefix</a></b>.</font></pre>" . $text;
}
}
I've also attached the whole file in case that is needed.