Hi,
I have had this issue for over 3 years, and never thought to ask anyone about it... what I am trying to do is convert internal links found in the text of my CMS system.
To create a link I use the code:
<link=1>this is a link</link>
which created a link to page with the id 1.
E.g. index.php?id=1
This works well using the little function I wrote:
function convert_Links($content) {
$pattern='(<link=)([0-9]{0,5})(>)';
$replacement='<a href="/index.php?id=\2">';
$pattern2='</link>';
$replacement2='</a>';
$content=eregi_replace($pattern2, $replacement2,eregi_replace($pattern, $replacement, $content));
return $content;
}
However, recently I upgraded my menu and url links to a cleaner format using mod-rewrite, to that the links show as directories.
E.g. /cms/home/1
with the 1 being the page id number.
Is there anyway to get the id number as I go and use it to get the page id's name and url for the link (as a separate function maybe)?
I hope I have explained this well enough, please ask if I need to clarify anything.
Thanks guy!