Welcome to Geeklog, Anonymous Thursday, November 28 2024 @ 11:39 am EST

Geeklog Forums

Calling functions in static pages?


Status: offline

amckay

Forum User
Full Member
Registered: 03/23/02
Posts: 180
Folks,

I would like to be able to call PHP functions in a static page, and am wondering if this would be easy to hack, and if so where I should concentrate my efforts. I am thinking I could use [call] [/call] tags with the function in between, and when the page gets parsed away we go.

The reason I want to use this is that in many spots on my site I have tables listing things like for example varieties of hops. Rather than update the page manually every time I want to add hop varieties, I'd much rather just poke them into the DB and away we go!

thanks,
-Alan the Beer Geek

 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany

In other words: You would like to use PHP in static pages. So you need Tom's version of that plugin.

bye, Dirk

 Quote

Status: offline

amckay

Forum User
Full Member
Registered: 03/23/02
Posts: 180
Thanks, but I find that kind of clunky. I'm almost done of my hack to allow you to put [call]FunctionName[/call] blocks anywhere you want within staticpages to have that function called and the return value of it inserted inline. It's actually only about 10 lines of code or so (you really PHP hackers could probably do it in 5 ;-)) Now I just have to figure out where exactly to call my function "ParseForFunctionCalls". It looks to me like it should go right before this comment in index.php // Check for type (ie html or php) Which in my 1.3.6 is line 112. It's getting late so I may not finish tonight, but should have it done tomorrow. cheers, -Alan
 Quote

All times are EST. The time is now 11:39 am.

  • 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