Welcome to Geeklog, Anonymous Wednesday, May 01 2024 @ 08:18 am EDT

Geeklog Forums

Executing PHP script in a Block


Status: offline

johnjr

Forum User
Chatty
Registered: 02/08/04
Posts: 68
I'm trying to set up a banner-rotation script to work within Geeklog. This 'program' is a set of php scripts that use a MySQL database to maintain the ads. It's a simple set of scripts that seems to work pretty well. All I have to do is insert the following line in a web page, and the ads are shown and 'rotated'.

Text Formatted Code
<?PHP include "DisplayBanners.php"; ?>
 


Now, I'm trying to get this to work within a block. I'm not familiar enough with php or Geeklog to figure this out, so far. Can someone give me some 'hints' as to how to do this?

By the way, I inserted the above line into my theme header.thtml file, and it worked fine. So, I know this can work.

John
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
normal blocks wont parse php like what you want for a number of good reasons. You'll need to create a PHP block, call your script using a function placed in your lib-custom.php file.

see this: What are the different block types for?
 Quote

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