Welcome to Geeklog, Anonymous Saturday, January 04 2025 @ 11:14 pm EST

Geeklog Forums

add link within php block?


Status: offline

frisco3

Forum User
Junior
Registered: 02/06/04
Posts: 23
Location:Burlington Vermont
confused
First off, I don't know the first thing about php code. With that said, I've put together a rather nice site at acttour.com for car racing in Vermont.

My question is: What exact code do I need to add a simple link at the bottom of a php block? I've tried to add the html tag in the lib-custom function and it produces an error so none of my page appears. Can someone help or do I need to go to php school?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
The PHP block function should have some string variable that it returns, say, return $retval; You will have to add your link to that string (before the return statement). Something like
Text Formatted Code
$retval .= '<a href="http://example.com">click here</a>';
 

bye, Dirk
 Quote

Status: offline

frisco3

Forum User
Junior
Registered: 02/06/04
Posts: 23
Location:Burlington Vermont
Thanks Dirk. I found another workaround by making the block a normal block and inserting the php command to call the function inside the block. For anyone interested, here's the code I used...

&lt;html&gt;
&lt;?php
require_once( '/mywebsiteinfo/geeklog/system/lib-custom.php' );
echo phpblock_galleryRandomPhoto();
?&gt;
&lt;br&gt;&lt;center&gt;&lt;a href=&quot;http://www.acttour.com/gallery/albums.php&quot;&gt;Photos Home&lt;/a&gt;&lt;/center&gt;
&lt;/html&gt;
 Quote

All times are EST. The time is now 11:14 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