Welcome to Geeklog, Anonymous Monday, November 25 2024 @ 09:41 pm EST
Geeklog Forums
function calls in static pages
amckay
function ParseForFunctionCalls($myStr)
{
$workStr = $myStr;
$newStr = "";
while( $callBegin = strpos( $workStr, "[call]" ) )
{
$newStr .= substr( $workStr, 0, $callBegin );
$callEnd = strpos( $workStr, "[/call]" );
$newWorkStr = substr( $workStr, $callEnd + 7 );
$funcname = trim(substr( $workStr, $callBegin + 6,$callEnd - $callBegin - 6 ));
$newStr .= $funcname();
$workStr = $newWorkStr;
}
return $newStr . $workStr;
}
And you insert the call just after line 100 right after the DB_fetchArray :
$A['sp_content'] = ParseForFunctionCalls($A['sp_content']);
And within your static pages you can insert any number of [call]someFunction[/call] statements that you like!
This is going to be a very huge improvement for my website - don't know why I didn't get around to it earlier.
cheers,
-Alan
Anonymous
amckay
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content