Orstio,
1. Is there a function in your bridge that we can call to convert URLs from SMF to J/M?
2. I tried to re-use some code from your bridge, and added this function in the SMF modules:
function sefUrl($url, $sef=0)
{
// string sefUrl( string $url, int $sef )
$nqsefurl = substr($url, 0, strpos($url, 'option')) . str_replace("?", "", substr($url, strpos($url, 'option')));
$nqsefurl = substr($nqsefurl, 0, strpos($nqsefurl, 'option')) . preg_replace('/(\;)([^=#]*)([\;#"])/', '$1$2=$2$3', substr($nqsefurl, strpos($nqsefurl, 'option'), strlen($nqsefurl)));
if ($sef == '0') {
// return non-SEF URL
return $nqsefurl;
} else {
$sefurl = sefReltoAbs(substr($nqsefurl,strpos($nqsefurl, 'index')));
$sefurl = str_replace(";", "/", $sefurl);
$sefurl = str_replace("/#", "#", $sefurl);
return $sefurl;
}
}
However, this is obviously going to give me a "cannot redeclare function" error message if I have multiple modules calling this same function. This error makes sense to me, but my question is this:
3. What is the best practice with regards to handling a function that multiple modules might use? Should I move it into its own file and call it through a require_once?