PDA

View Full Version : How to create a new block type


conaero
04-28-2010, 09:56 AM
Hi All,

On my forum I've created several new sidebar blocks using the Custom HTML/PHP block type, but now I am needing to do something more advanced where I need access to the vBulletin functions.

My question is, I have duplicated the file /includes/block/html.php, renamed it and changed the information inside to what it needs to be, added an entry to the blocktype database table but I cannot get it to appear in the "Select Block Type" dropdown. I know I am missing something here, please can someone point out the steps for adding a new block type?

Many Thanks - Matt

Andreas
05-02-2010, 04:04 PM
Create an Add-on (for example with productid glossar)
Create a phrase blocktype_{blocktypename} (blocktype_glossarentries for example) in phrase group Forum Blocks
Create the class in includes/block and make sure that

The filename equals the blocktypename (eg. if your class is vB_Block_Glossarentries the filename must be glossarentries.php)
You are setting the productid correctly

protected $productid = 'glossar';


Reload the block types by accessing admincp/block.php?do=reload


That's it :)