--- lib-plugins.php 2004-06-01 22:17:54.000000000 +1000 +++ /var/www/html/geeklog/system/lib-plugins.php 2004-10-04 16:32:13.000000000 +1000 @@ -60,7 +60,6 @@ function PLG_callFunctionForAllPlugins($function_name) { global $_TABLES; - $result = DB_query("SELECT pi_name FROM {$_TABLES['plugins']} WHERE pi_enabled = 1"); $nrows = DB_numRows($result); for ($i = 1; $i <= $nrows; $i++) { @@ -684,6 +683,49 @@ } /** +* Geeklog is about to display the edit form for a story. Plugins +* now get a chance to add their own variables and input fields to the form. +* +* @param int $sid story id of the story to be edited +* @param ref $template reference of the Template for the story edit form +* +* NOTE: new function +*/ +function PLG_storyVariablesEdit($sid, &$template) +{ + global $_TABLES; + + $result = DB_query("SELECT pi_name FROM {$_TABLES['plugins']} WHERE pi_enabled = 1"); + $nrows = DB_numRows($result); + for ($i = 1; $i <= $nrows; $i++) { + $A = DB_fetchArray($result); + $function = 'plugin_storyvariablesedit_' . $A['pi_name']; + if (function_exists($function)) { + $function ($sid, $template); + } + } + +} + +/** +* When a story is saved by the admin this function fires to allow plgins to +* receive and manipulate the form data +* Plugins will have to refer to the global $HTTP_POST_VARS array to get the +* actual data. +* +* @param string $plugin name of a specific plugin or empty (all plugins) +* +*/ +function PLG_storyExtrasSave ($plugin = '') +{ + if (empty ($plugin)) { + PLG_callFunctionForAllPlugins ('plugin_storyextrassave_'); + } else { + PLG_callFunctionForOnePlugin ('plugin_storyextrassave_' . $plugin); + } +} + +/** * Geeklog is about to display the edit form for the user's profile. Plugins * now get a chance to add their own variables and input fields to the form. *