Currently haveing an issue where the urls are nor being preg_replace for output. The following are exerpts from page_header.php and page_tail.php
I have had experience from other rewrite mods, ie google rewrite mod for phpNuke, but I can't seem to put my finger on why they are not being parsed :S
page_header.php
Code:if (!$userdata['session_logged_in'])
{
ob_start();
function replace_for_mod_rewrite(&$s)
{
$urlin = array(
"'(?<!/)index.php\?f=([0-9]*)&topicdays=([0-9]*)&start=([0-9]*)'",
"'(?<!/)index.php\?f=([0-9]*)&mark=topics'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&watch=topic*'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&unwatch=topic*'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&highlight=*'",
"'(?<!/)index.php\?f=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&view=previous'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&view=next'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&vote=viewresult'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&highlight=([a-zA-Z0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)'",
"'(?<!/)viewtopic.php&p=([0-9]*)'",
"'(?<!/)viewtopic.php\?p=([0-9]*)'"
);
$urlout = array(
"topic-\\1-\\2-\\3.html",
"mark-forum\\1.html",
"updates-topic\\1.html",
"stop-updates-topic\\1.html",
"about\\1.html&highlight=\\2",
"forum-\\1.html",
"ptopic\\1.html",
"ntopic\\1.html",
"view-poll\\1-\\2-\\3.html",
"about\\1-\\2-\\3-\\4.html",
"about\\1.html",
"about\\1-\\2.html",
"about\\1.html",
"post-\\1.html",
"post-\\1.html"
);
$s = preg_replace($urlin, $urlout, $s);
return $s;
}
}
page_tail.php
Code:if (function_exists(ob_gzhandler) && $board_config['gzip_compress'] == 1)
{
$gzip_contents = ob_get_contents();
ob_end_clean();
ob_start('ob_gzhandler');
global $dbg_starttime;
echo replace_for_mod_rewrite($gzip_contents);
Header('Vary: Accept-Encoding');
Header('X-Content-Encoded-By: webmedic page zipper');
ob_end_flush();
}
else
{
$contents = ob_get_contents();
ob_end_clean();
echo replace_for_mod_rewrite($contents);
global $dbg_starttime;
}
-PK
ps-the index replaceing viewforum is not a mistake, it is to do with one of the mods I have on my board.