1
loukaum
PHP code in blocks
  • 2017/7/18 14:03

  • loukaum

  • Just popping in

  • Posts: 93

  • Since: 2003/11/2


Hello all,

I want to execute an PHP code inside a block, it is possible? Is there any smarty tag for this?

Thank you in advance for the attention :)

2
zyspec
Re: PHP code in blocks
  • 2017/7/18 14:27

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Yes, you can do this. Just create a custom block (go to Admin->Modules->System->Blocks in the admin control panel). Select 'Add Block' button. Near the bottom of the page just change Content Type to PHP Script. You can enter your PHP script in the Content field.

3
loukaum
Re: PHP code in blocks
  • 2017/7/18 15:40

  • loukaum

  • Just popping in

  • Posts: 93

  • Since: 2003/11/2


The content type option isn't visible when I add a custom block...

4
zyspec
Re: PHP code in blocks
  • 2017/7/18 16:32

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Which version of XOOPS are you using?

If you're using XOOPS 2.5.8 or 2.5.9 you should be able to go to:
http:///modules/system/admin.php?fct=blocksadmin&op=add
and see the following fields: Block Type, Weight,, Visible, Visible in, Title, Content, Content Type, Cache lifetime, and Groups.

5
loukaum
Re: PHP code in blocks
  • 2017/7/18 16:42

  • loukaum

  • Just popping in

  • Posts: 93

  • Since: 2003/11/2


Thanks for the help! :)

I'm using version 2.5.8.1 with Transition theme at admin side:

Resized Image

6
loukaum
Re: PHP code in blocks
  • 2017/7/18 16:45

  • loukaum

  • Just popping in

  • Posts: 93

  • Since: 2003/11/2


Just did a fresh installation on a test ambient and the custom blocks worked smooth, I gonna have to figure out what happened to my production site... =\

Login

Who's Online

266 user(s) are online (98 user(s) are browsing Support Forums)


Members: 0


Guests: 266


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits