Custom Block Activation in ACP
Custom Block Activation in ACP
Would this be an undertaking to create an option in the ACP to turn on and off a custom block? Would it require database entries?
-
- Site Admin
- Posts: 2989
- Joined: 7. January 2006 20:11
- phpBB.de User: Saint
- phpBB.com User: Saint_hh
- Location: Hamburg
- Contact:
Re: Custom Block Activation in ACP
Yes and yes.
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~
Kein Support per PN / No support via PM!
Kein Support per PN / No support via PM!
Re: Custom Block Activation in ACP
Hahaha thanks, Kevin ... html it is then!
-
- Site Admin
- Posts: 2989
- Joined: 7. January 2006 20:11
- phpBB.de User: Saint
- phpBB.com User: Saint_hh
- Location: Hamburg
- Contact:
Re: Custom Block Activation in ACP
Hehe.
Create an DB entry in the portal table, named something like "portal_my_block", create a new language variable named something like "PORTAL_MY_BLOCK" in the \language\en\mods\lang_portal_acp.php and add to the acp_portal.php something like:
In portal.php
In my_block.php:
In portal_body.html:
All names and variables are just examples.
As a quick version what your route should be.
Create an DB entry in the portal table, named something like "portal_my_block", create a new language variable named something like "PORTAL_MY_BLOCK" in the \language\en\mods\lang_portal_acp.php and add to the acp_portal.php something like:
Code: Select all
'portal_my_block' => array('lang' => 'PORTAL_MY_BLOCK' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
Code: Select all
if ($portal_config['portal_my_block'])
{
include($phpbb_root_path . 'portal/block/my_block.'.$phpEx);
}
Code: Select all
$template->assign_vars(array(
'S_MY_BLOCK' => true,
));
Code: Select all
<!-- IF S_MY_BLOCK -->
<!-- INCLUDE portal/block/my_block.html -->
<!-- ENDIF -->
As a quick version what your route should be.
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~
Kein Support per PN / No support via PM!
Kein Support per PN / No support via PM!