Adding event for news edition with BBCodeGeShi

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
dtamajon
Posts: 15
Joined: 13 Jun 2013, 23:08

Adding event for news edition with BBCodeGeShi

Post by dtamajon »

Hi,

I have installed BBCodeGeShi (for me it's better than just BBCode), but I wanted support for news too.

I've seen news doesn't provides a EVENT, so I added. To do so, I have added the following lines to core/events_inc.php:

Code: Select all

	# News events
	'EVENT_NEWS_UPDATE' => EVENT_TYPE_EXECUTE,
Now, you can invoke whatever you want, so I have added just after the textarea tags in news_edit_page.php and news_menu_page.php:

Code: Select all

<?php event_signal( 'EVENT_NEWS_UPDATE' ); ?> 

Finally, to get the plugin responding the event signal, I just added a new hook on the hooks array:

Code: Select all

'EVENT_NEWS_UPDATE'            => 'add_bbcode_toolbars',
Could be this event included in future versions??

Thanks and enjoy!!
atrol
Site Admin
Posts: 8553
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Adding event for news edition with BBCodeGeShi

Post by atrol »

You can enter an issue at www.mantisbt.org/bugs

After that submit a patch as it increases the chances of improvement eventually making it into MantisBT core. All contributions are welcome and greatly appreciated.

Patch submissions can be made in several ways. In the order of preference:

1. Send us a Pull Request on our Github repository [1]
2. Attach a GIT patch to the issue
3. Attach a Unified Diff, clearly specifying the patch's base release

Kindly avoid to upload entire modified PHP files.

Please make sure that your submissions adhere to our Coding Guidelines [2], if they don't your patch might be rejected.

[1] https://github.com/mantisbt/mantisbt
[2] http://www.mantisbt.org/wiki/doku.php/m ... guidelines
Please use Search before posting and read the Manual
Post Reply