2011-12-15, 01:01 AM
2011-12-15, 08:32 AM
I already blame plugin authors - it's already possible.
2011-12-16, 04:53 AM
(2011-12-15, 08:32 AM)Tomm M Wrote: [ -> ]I already blame plugin authors - it's already possible.
Always blame the plugin authors...
And this feature would be very useful - instead of having to reactivate about 20 plugins on some boards.
2011-12-16, 01:34 PM
No Tom has a good point. You wouldn't need to reactivate them if the plugins used the hook that's run when themes are added to redo the template edits. I hadn't thought of that and is probably a better solution.
2011-12-16, 01:47 PM
(2011-12-16, 01:34 PM)MattRogowski Wrote: [ -> ]No Tom has a good point. You wouldn't need to reactivate them if the plugins used the hook that's run when themes are added to redo the template edits. I hadn't thought of that and is probably a better solution.
This. I'm working on implementing it in all of my plugins. I had honestly never even looked for it before since no one else had ever done it that I've seen.
2011-12-16, 03:38 PM
I had never thought of it either.One issue I foresee is that if authors start using the find/replace function in these add/remove functions, they may end up with duplicate edits since the find/replace function is usually coded to insert content.
We'd have to rethink the implementation, perhaps add an optional parameter to specify "all" or a specific template set ID
We'd have to rethink the implementation, perhaps add an optional parameter to specify "all" or a specific template set ID
2011-12-17, 09:15 PM
(2011-12-16, 01:34 PM)MattRogowski Wrote: [ -> ]No Tom has a good point. You wouldn't need to reactivate them if the plugins used the hook that's run when themes are added to redo the template edits. I hadn't thought of that and is probably a better solution.
How many plugin authors know about that hook? I've been doing custom work on my own site for several years and this is news to me.
2011-12-18, 01:01 AM
It's news that there are hooks in the places where templates/themes are added and are able to be extended so that users don't have to deactivate your plugin to re-enable your edits?
Again, I blame the plugin author. Often than not, authors simply copy methods and techniques that others are using and as this method has never really caught on (or become popular) it became an accepted practice that re/deactivating plugins is the norm for theme edits.
Using the hook is the best solution. A function is a ludicrous idea when you consider that when a new theme or template set is added that we'll have to cycle through all the plugins to try a locate a function that may not well exist when if a well coded plugin requires edits the selected changes happen via the hook.
Again, I blame the plugin author. Often than not, authors simply copy methods and techniques that others are using and as this method has never really caught on (or become popular) it became an accepted practice that re/deactivating plugins is the norm for theme edits.
Using the hook is the best solution. A function is a ludicrous idea when you consider that when a new theme or template set is added that we'll have to cycle through all the plugins to try a locate a function that may not well exist when if a well coded plugin requires edits the selected changes happen via the hook.
2011-12-18, 03:11 AM
What about my concern about the duplication of content? since find_replace_templatesets() does not take a TID, any edit will repeat duplicate the edit twice in the existing templates
so thus we need to replicate the find_replace_templatesets() functionality in our plugins.
so thus we need to replicate the find_replace_templatesets() functionality in our plugins.
2011-12-18, 03:43 AM
(2011-12-18, 03:11 AM)pavemen Wrote: [ -> ]What about my concern about the duplication of content? since find_replace_templatesets() does not take a TID, any edit will repeat duplicate the edit twice in the existing templates
so thus we need to replicate the find_replace_templatesets() functionality in our plugins.
I guess the work-a-round there is to have the hook first call your removal code, then call your add code. But yes, that seems a bit... wrong.