Quote:
Originally Posted by nerbert
Here are some button plugins for one of my projects. The title is "Editor" and the tagname is "editor". It puts a code editor in posts. I wrote these plugins a long time ago so I'm not sure why and how they work. Try altering them for your project.
In editor_toolbar_start
Code:
$do_cache_editor = true;
foreach($vbulletin->bbcodecache AS $cache)
{
if($cache['title'] == 'Editor')
{
$do_cache_editor = false;
}
}
if($do_cache_editor)
{
$vbulletin->bbcodecache[] = array(
bbcodeid => 200,
bbcodetag => 'editor',
title => 'Editor',
buttonimage => 'clientscript/codemirror-3.0/images/editor.png'
);
}
in editor_custom_toolbar_loop
Code:
if($title == 'Editor')
{
$handled = true;
}
in editor_toolbar_set
Code:
if($this->editor_type == 'fe')
{
if($iespell)
{
$this->config['toolbar'][12][] = 'Editor';
}
else
{
$this->config['toolbar'][11][] = 'Editor';
}
}
|
That looks cool nerbert, but the issue was solved already. But it is good reference for anyone else wanting to add bbcodes via a mod.