Welcome to Geeklog, Anonymous Monday, December 23 2024 @ 05:51 am EST

Geeklog Forums

php_function blocks


anonymouse

Anonymous
Im trying to create a php function function - and I seem to be chasing my own tail - from the blovk creation admin page if I fill in the section PHP Block Options Block Function:
I get the following error message

"Bad Block Title Your Title must not be empty and cannot contain HTML! "
If I try filling in the title I get an error saying the normal block contents must be filled in.

How do I create a php_function block?
Can I create the block at runtime with an api call?
can I have my own version of /path/to/geeklog/system/lib-custom.php

ie /path/to/geeklog/plugin/myplugin/lib-custom.php and store the functions there?

Thanks
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
Quote by: anonymouse

ie /path/to/geeklog/plugin/myplugin/lib-custom.php and store the functions there?

That is where they go. You create a function like phpblock_myblock() in lib-custom.php. Then you use that function name in the block form.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
For future reference: What are the different block types for?
 Quote

anonymouse

Anonymous
Sorry you have misunerstood I cant create one in the first place as if I fill in just the php function name for the block it insists on me giving it a title and if I give it a title it insists I then have to fill in the normal content block.

The reason I asked about lib-custom is Id prefer to have my plugin code self contained if thats possible.
 Quote

anonymouse

Anonymous
Apologies its my error I misunderstood the interface.
 Quote

Status: offline

Dirk

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

The reason I asked about lib-custom is Id prefer to have my plugin code self contained if thats possible.


It's perfectly okay for a plugin to have its phpblock_ functions in functions.inc since they will usually not work without the plugin anyway.

bye, Dirk
 Quote

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