function replaceLinks($content) { // -- preg match REX_LINK_INTERN[ARTICLEID] -- preg_match_all("/REX_LINK_INTERN\\[([0-9]*)\\]/im", $content, $matches); if ($matches[0][0] != '') { for ($m = 0; $m < count($matches[0]); $m++) { $url = getURLbyID($matches[1][$m]); $content = str_replace($matches[0][$m], $url, $content); } } // -- preg match redaxo://[ARTICLEID] -- preg_match_all("/redaxo:\\/\\/([0-9]*)\\/?/im", $content, $matches); if ($matches[0][0] != '') { for ($m = 0; $m < count($matches[0]); $m++) { $url = getURLbyID($matches[1][$m]); $content = str_replace($matches[0][$m], $url, $content); } } return $content; }
function generateLink($id) { global $REX; if ($this->mode == "edit") { return $id; } else { if ($REX[GG]) { return "aid{$id}" . ".php"; } else { return getURLbyID($id); } } }