Custom Block Activation in ACP

Post Reply

Topic author
the.ronin
Valued Contributor
Posts: 64
Joined: 30. October 2008 16:20

Custom Block Activation in ACP

Post by the.ronin »

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?
User avatar

Kevin
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

Post by Kevin »

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!

Topic author
the.ronin
Valued Contributor
Posts: 64
Joined: 30. October 2008 16:20

Re: Custom Block Activation in ACP

Post by the.ronin »

Hahaha thanks, Kevin ... html it is then! :lol:
User avatar

Kevin
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

Post by Kevin »

Hehe. :mrgreen:
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), 
In portal.php

Code: Select all

    if ($portal_config['portal_my_block'])
    {
        include($phpbb_root_path . 'portal/block/my_block.'.$phpEx);
    } 
In my_block.php:

Code: Select all

      $template->assign_vars(array(
        'S_MY_BLOCK' => true,
       )); 
In portal_body.html:

Code: Select all

        <!-- IF S_MY_BLOCK -->
            <!-- INCLUDE portal/block/my_block.html -->
        <!-- ENDIF --> 
All names and variables are just examples.
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!
Post Reply

Return to “Modifications Support”