Welcome to Geeklog, Anonymous Wednesday, February 05 2025 @ 05:46 pm EST
Geeklog Forums
adding a function to static pages
Theophile
Anonymous
Hey all.
A year ago, a friend of mine wrote a text replacement function for me for the articles on my GL site. Now I want to implement the same function for the static pages but am having a hard time. The function, which resides in lib-common.php is this:
function scripture_quote($text,$just_strip=false)
{
if($just_strip)
{
$text=str_replace("%SC1","n",$text);
$text=str_replace("%SC2","",$text);
$text=str_replace("%SC3","",$text);
}
else
{
$text=str_replace("%SC1","<div class='sc'><div class='scr1'><div class='scr2'><div class='scr3'>",$text);
$text=str_replace("%SC2","</div></div></div><div class='sct'>",$text);
$text=str_replace("%SC3","</div></div>",$text);
}
return $text;
}
The function is then called by, say, article.php with this:
echo $display;
My question is, where do I have to call the fucntion in the staticpages/index.php? I'm a little lost... thanks!
A year ago, a friend of mine wrote a text replacement function for me for the articles on my GL site. Now I want to implement the same function for the static pages but am having a hard time. The function, which resides in lib-common.php is this:
Text Formatted Code
/* ddurham 12/10/2005 */function scripture_quote($text,$just_strip=false)
{
if($just_strip)
{
$text=str_replace("%SC1","n",$text);
$text=str_replace("%SC2","",$text);
$text=str_replace("%SC3","",$text);
}
else
{
$text=str_replace("%SC1","<div class='sc'><div class='scr1'><div class='scr2'><div class='scr3'>",$text);
$text=str_replace("%SC2","</div></div></div><div class='sct'>",$text);
$text=str_replace("%SC3","</div></div>",$text);
}
return $text;
}
The function is then called by, say, article.php with this:
Text Formatted Code
$display = scripture_quote($display);echo $display;
My question is, where do I have to call the fucntion in the staticpages/index.php? I'm a little lost... thanks!
6
11
Quote
Status: offline
jmucchiello
Forum User
Full Member
Registered: 08/29/05
Posts: 985
Probably in the function render_content(). At the end where is says "return $retval;" you could put a line above it that says "$retval = scripture_quote($retval);"
Not sure how well that will work as the function is rather odd. But see if it works for you.
Not sure how well that will work as the function is rather odd. But see if it works for you.
9
10
Quote
Theophile
Anonymous
That was it, thanks!
10
9
Quote
All times are EST. The time is now 05:46 pm.
- 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