Welcome to Geeklog, Anonymous Tuesday, April 23 2024 @ 03:43 am EDT

Geeklog Forums

PHP in Template files


Status: offline

griffman

Forum User
Junior
Registered: 04/23/02
Posts: 28
Does Geeklog only parse php in certain .thtml files, such as header.thtml? I'm trying to modify the submission form (submitstory.thtml), but I need to be able to run some PHP code, calculate some values, then output those values onto the form. But any attempt to embed via <?php...?> tags fails -- nothing at all happens.

So a related question: what's the right way to modify submitstory.thtml such that it can display my custom stuff? I'm trying to stay away from hacking the core...

thx;
-rob.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Yes, PHP code is only allowed in header.thtml.

The proposed way to add your custom stuff is to define your own {variables} in function CUSTOM_templateSetVars() in lib-custom.php.

That only works for places which are calling PLG_templateSetVars. I see one such call in submit.php in 1.4.1. See if it helps as it is. Otherwise, feel free to submit a patch :wink:

bye, Dirk
 Quote

Status: offline

griffman

Forum User
Junior
Registered: 04/23/02
Posts: 28
Ah, seems that's in 1.4.1 only ... looks like it's time to go through the upgrade wars again Smile

thx;
-rob.
 Quote

All times are EDT. The time is now 03:43 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