Welcome to Geeklog, Anonymous Monday, February 16 2026 @ 10:22 pm EST
Geeklog Forums
trying to put php in GL 1.6.1 block
Mike gl nubie
Anonymous
How can I make this work in a block. what script would I use? All I want to do is pull a random image from the g2 albums with each reload of the page.
<?php @readfile('http://smithtownares.org/photos/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title'
; ?>
<?php @readfile('http://smithtownares.org/photos/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title'
15
12
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You can't enter the PHP code in the block editor. You need to create a function (e.g. in your lib-custom.php) and call it from the block. The function name must start with phpblock_.
See the description right there in the block editor ...
bye, Dirk
See the description right there in the block editor ...
bye, Dirk
12
12
Quote
All times are EST. The time is now 10:22 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