// START SESSIONS // THIS IS FOR FOLLOWING MEMEBERS AUTHENTICATION session_start(); //error_reporting(E_ALL); //ini_set('display_errors', '1'); require_once('cmscnfg.php'); require_once('functn.php'); $theParent = gtParent($pageID); ?> // START CREATE LINKS IN CONTENT FOR INTERNAL LINKS function RewriteText($Match){ global $lang; $EntireSection = $Match[0]; $Key = $Match[1]; $Value = $Match[2]; $sql1 = "SELECT * FROM pages WHERE pageID = '$Key'"; $rows1 = $GLOBALS[db]->query($sql1); while ($record1 = $GLOBALS[db]->fetch($rows1)) { $url = "/pages/".$record1['pageID']."/".str_replace(" ", "-", $record1['pageName']); } // RETURN PROPERLY FORMATTED LINK IN CONTENT return '' . $url . '' . $Value; } $find_players = preg_match_all("/[{]([0-9]+)}([^\n\r]+)/i", $pageContent, $matches); foreach ($matches as $v) { $pageContent = preg_replace_callback('/[{]([0-9]+)}([^\n\r]+)/i', "RewriteText", $pageContent); } // END CREATE LINKS IN CONTENT FOR INTERNAL LINKS ?>