MyBB Community Forums

Full Version: Adding MyCode as a plugin.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
My requests get harder....

Can you make an image appear above the post that adds the MyCode, I know how do this by editing core files but.....
I thought this was a request to make simple mycode additions easy without manual edition. Not complex ones. If I make that it would mean I made it all. You should look at plug-in hooks.

And I don't understand what you mean.
All I mean is to add the little images above th post bit that when you click, it puts [spoiler]and[/spoiler[ in. And you're right, you did all I requested, and all I need.

I thank you for that too,

BP
You're talking about adding a MyCode button, right? I don't know that that can be done via plugin.
this is the easiest way todo that as of now.
Ahh, I just though of something else that ws staring me in the face lol.

Thanks, I know exactly how to do all that in a plugin now
Something is wrong with this code, on Notepad++ the
$mycode['bounce"]['replacement'] = <<<END
['replacement'] doesn't highlight, nor does the comment in description

// This is the Regular expression. DO NOT REMOVE <<<END and END; Or you'll break it. Only change "name_of_plugin" to the name of the mycode, and the code of course.
$mycode['spoiler']['regexp'] = <<<END
[code]\[spoiler\](.*?)\[/spoiler\][/code]
END;

// This is the replacement. DO NOT REMOVE <<<END and END; Or you'll break it. Only change "name_of_plugin" to the name of the mycode, and the code of course.
$mycode['spoiler']['replacement'] = <<<END
 <small>    <b>Spoiler:</b></small><br /> <div style="border: inset 1px gray; padding: 1px;"><div><button type="button" class="button" onclick="if (this.innerHTML == 'Hide Spoiler'){this.parentNode.parentNode.childNodes[1].style.display = 'none'; this.innerHTML = 'Show Spoiler';}else{this.parentNode.parentNode.childNodes[1].style.display = 'inline'; this.innerHTML = 'Hide Spoiler';};"><font color="#000000" size="1"><b>Show Spoiler</b></font></button></div><div id="spoiler" style="display: none;"> $1 </div>
END;

// Description of your mycode. DO NOT REMOVE <<<END and END; Or you'll break it. Only change "name_of_plugin" to the name of the mycode, and the code of course.
$mycode['spoiler']['description'] = <<<END
Hides text between [spoiler] tags
END;

// This is the Regular expression. DO NOT REMOVE <<<END and END; Or you'll break it. Only change "name_of_plugin" to the name of the mycode, and the code of course.
$mycode['bounce']['regexp'] = <<<END
[code]\[bounce\](.*?)\[/bounce\][/code]
END;

// This is the replacement. DO NOT REMOVE <<<END and END; Or you'll break it. Only change "name_of_plugin" to the name of the mycode, and the code of course.
$mycode['bounce"]['replacement'] = <<<END
<div id="bounce"><marquee behavior="alternate" direction="up" height="60" scrolldelay="100">$1</marquee></div>
END;

// Description of your mycode. DO NOT REMOVE <<<END and END; Or you'll break it. Only change "name_of_plugin" to the name of the mycode, and the code of course.
$mycode['bounce']['description'] = <<<END
Makes text bounce up and down
END;



Thanks,

BP[/php]
blueparukia Wrote:Something is wrong with this code, on Notepad++ the
$mycode['bounce"]['replacement'] = <<<END
['replacement'] doesn't highlight, nor does the comment in description
Try this instead:
$mycode['bounce']['replacement'] = <<<END
Now its not showing up in the plugin manager Sad
And that's why I'm not a developer. Big Grin

Sorry.
Pages: 1 2 3