[geeklog-devel] Plugin Enhancements

Joe Mucchiello joe at throwingdice.com
Fri Mar 21 02:23:06 EDT 2008


I just had a thought and wanted to throw it out there. Obviously this 
would be a project for 1.5.1/1.6.

Why not add a field or two to the plugin table containing plugin 
generated groups and features ids. This serves two purposes.
First, the plugin's uninstall becomes trivial to write.
Second, the plugin can query this field to find it's own group ids. I 
know several plugins put this info in the vars table now. No need if 
there's a spot for it on the plugin table.

Typical format would be comma delimited list for easy insert into an 
"IN ($A['group_ids'])" where clause.

At the end of the install the plugin would gather up the ids and add 
them to its insert.

During an upgrade, the plugin can fetch these fields and use them as 
needed. (I'm assuming the plugin would know what order they were 
listed in so if it creates plugin.edit and plugin.moderate in that 
order, it would insert 45,46 to the feature_ids field. Later it would 
know 45 was plugin.edit and 46 was plugin.moderate.)

Another idea I had was to add directory info to the plugin table. 
This would simplify making the public directory of a plugin different 
from the plugin's name and give the admin a place where he could 
modify it easily. Making this a standard part of the plugin 
implementation would be great.

Finally, this project could also encompass the plugin ordering 
enhancement so that plugins can be ordered in the admin screen.

ALTER TABLE {$_TABLES['plugins']}
ADD COLUMN pi_group_ids VARCHAR(255) NOT NULL DEFAULT '',
ADD COLUMN pi_feature_ids VARCHAR(255) NOT NULL DEFAULT '',
ADD COLUMN pi_dir_name VARCHAR(32) NOT NULL DEFAULT '',
ADD COLUMN pi_order MEDIUMINT(5) NOT NULL DEFAULT '9999'

----
Joe Mucchiello
Throwing Dice Games
http://www.throwingdice.com 




More information about the geeklog-devel mailing list