|
Posted by Mohawk Mawk on 05/04/07 18:49
>But galery will recieve an array of matches, not just an id, so you'll maybe
>need to modify it a bit. Also I haven't tested this at all, the example is
>just to illustrate the idea...
thank you very much, I inserted a handling function:
function garray($input){
return gallery($input[1]); /* $input[0] is '[GID=X]' and $input[1]
is 'X' */
}
$news="See my galleries one [GID=1] and two [GID=2]";
echo preg_replace_callback('/\[GID=([\d]+)\]/', 'garray', $news);
it works like a charm, this is the beginning of a whole bunch of new
possibilities for the administrator to write news.
thank you very much
[Back to original message]
|