Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

How to modify an old plugin for 2.1

vrijvlindervrijvlinder Papillon-Sauvage MVP
edited December 2013 in Tutorials

So you found and old plugin but it does not work with your version of Vanilla....

There are some modifications you need to make. Some will work others will not due to major changes in framework. These 3 steps cover only the basic changes for a plugin that is 2.0 but 2.1 friendly . This means it requires only minor changes to work.

1.If your old plugin's definition has a lower version requirement. You must remove the entire requirement sentence from the list.

2.If your old plugin says: class OldPlugin implements Gdn_IPlugin you must change that to: class OldPlugin extends Gdn_Plugin

3.If your old plugin contains: &$Sender You must change it to this: $Sender

If these changes still don't make it work there are a couple other changes you can make to the Handlers that render the plugin. These simply tell where it will appear.

If these functions exist , example:

_BeforeDiscussionRender_Handler

or

_AfterDiscussionRender_Handler

or

_BeforeCommentDisplay_Handler

Not every plugin will work for 2.1 even given these changes, just as not every 2.1 plugin will work for 2.0.

Because of extensive changes in the framework and additions to it that do not exist in 2.0, those plugins will only work with their intended versions.

Before you test your fixed plugin, make sure you backed up all your plugins and files. Or test it under a test environment to minimize any potential risk.

UnderDogilovetechAviramhgtonightperegrinevisenselx

Comments

Sign In or Register to comment.