Thread: Plugin System
View Single Post
Old 03-21-2008, 01:20 PM   #3 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

I think probably the best way to go about a plugin system is via hooks. But the plugin should work via a class file which is placed in a special pool folder for plugins. You would do something then like the following:


php Code:
class My_Plugin extends Plugin_Interface
{
    public $m_szHook = 'comment-post';
}

Then in your code you would initiate this class if the hook is valid. All the comment data would then be forwarded to the construct in an array. You would then feed back the data as an array -- and all would be well, the comment would be posted!
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote