[geeklog-cvs] geeklog-1.3/system lib-plugins.php,1.44,1.45
dhaun at iowaoutdoors.org
dhaun at iowaoutdoors.org
Wed Sep 29 06:36:31 EDT 2004
Update of /var/cvs/geeklog-1.3/system
In directory www:/tmp/cvs-serv7804/system
Modified Files:
lib-plugins.php
Log Message:
Introduced new plugin API functions plugin_user_changed_xxx and plugin_group_changed_xxx to inform plugins of user / group changes.
Index: lib-plugins.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/system/lib-plugins.php,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** lib-plugins.php 29 Sep 2004 08:04:43 -0000 1.44
--- lib-plugins.php 29 Sep 2004 10:36:28 -0000 1.45
***************
*** 66,70 ****
function PLG_callFunctionForAllPlugins($function_name)
{
! global $_TABLES, $_PLUGINS;
foreach ($_PLUGINS as $pi_name) {
--- 66,70 ----
function PLG_callFunctionForAllPlugins($function_name)
{
! global $_PLUGINS;
foreach ($_PLUGINS as $pi_name) {
***************
*** 203,207 ****
function PLG_getMenuItems()
{
! global $_TABLES, $_PLUGINS;
$menu = array();
--- 203,207 ----
function PLG_getMenuItems()
{
! global $_PLUGINS;
$menu = array();
***************
*** 316,320 ****
function PLG_getPluginStats($showsitestats)
{
! global $_TABLES, $_PLUGINS;
$retval = '';
--- 316,320 ----
function PLG_getPluginStats($showsitestats)
{
! global $_PLUGINS;
$retval = '';
***************
*** 341,345 ****
function PLG_getSearchTypes()
{
! global $_TABLES, $_PLUGINS;
$types = array();
--- 341,345 ----
function PLG_getSearchTypes()
{
! global $_PLUGINS;
$types = array();
***************
*** 397,401 ****
function PLG_doSearch($query, $datestart, $dateend, $topic, $type, $author, $keyType = 'all')
{
! global $_TABLES, $_CONF, $_PLUGINS;
$search_results = array();
--- 397,401 ----
function PLG_doSearch($query, $datestart, $dateend, $topic, $type, $author, $keyType = 'all')
{
! global $_CONF, $_PLUGINS;
$search_results = array();
***************
*** 425,429 ****
function PLG_getSubmissionCount()
{
! global $_TABLES, $_PLUGINS;
$num = 0;
--- 425,429 ----
function PLG_getSubmissionCount()
{
! global $_PLUGINS;
$num = 0;
***************
*** 447,451 ****
function PLG_getUserOptions()
{
! global $_TABLES, $_PLUGINS;
$plgresults = array ();
--- 447,451 ----
function PLG_getUserOptions()
{
! global $_PLUGINS;
$plgresults = array ();
***************
*** 479,483 ****
function PLG_getAdminOptions()
{
! global $_TABLES, $_PLUGINS;
$counter = 0;
--- 479,483 ----
function PLG_getAdminOptions()
{
! global $_PLUGINS;
$counter = 0;
***************
*** 552,556 ****
function PLG_getCCOptions()
{
! global $_TABLES, $_CONF, $_PLUGINS;
require_once($_CONF['path_system'] . 'classes/plugin.class.php');
--- 552,556 ----
function PLG_getCCOptions()
{
! global $_CONF, $_PLUGINS;
require_once($_CONF['path_system'] . 'classes/plugin.class.php');
***************
*** 583,587 ****
function PLG_showModerationList()
{
! global $_TABLES, $_CONF, $_PLUGINS;
$retval = '';
--- 583,587 ----
function PLG_showModerationList()
{
! global $_PLUGINS;
$retval = '';
***************
*** 633,637 ****
function PLG_showCenterblock($where = 1, $page = 1, $topic = '')
{
! global $_TABLES, $PLG_bufferCenterAPI, $PLG_buffered, $_PLUGINS;
$retval = '';
--- 633,637 ----
function PLG_showCenterblock($where = 1, $page = 1, $topic = '')
{
! global $PLG_bufferCenterAPI, $PLG_buffered, $_PLUGINS;
$retval = '';
***************
*** 668,672 ****
function PLG_createUser ($uid)
{
! global $_TABLES, $_PLUGINS;
foreach ($_PLUGINS as $pi_name) {
--- 668,672 ----
function PLG_createUser ($uid)
{
! global $_PLUGINS;
foreach ($_PLUGINS as $pi_name) {
***************
*** 686,690 ****
function PLG_deleteUser ($uid)
{
! global $_TABLES, $_PLUGINS;
foreach ($_PLUGINS as $pi_name) {
--- 686,690 ----
function PLG_deleteUser ($uid)
{
! global $_PLUGINS;
foreach ($_PLUGINS as $pi_name) {
***************
*** 708,712 ****
function PLG_loginUser ($uid)
{
! global $_TABLES, $_PLUGINS;
foreach ($_PLUGINS as $pi_name) {
--- 708,712 ----
function PLG_loginUser ($uid)
{
! global $_PLUGINS;
foreach ($_PLUGINS as $pi_name) {
***************
*** 728,732 ****
function PLG_logoutUser ($uid)
{
! global $_TABLES, $_PLUGINS;
foreach ($_PLUGINS as $pi_name) {
--- 728,732 ----
function PLG_logoutUser ($uid)
{
! global $_PLUGINS;
foreach ($_PLUGINS as $pi_name) {
***************
*** 739,742 ****
--- 739,781 ----
/**
+ * This functions is called to inform plugins when a user's information
+ * (profile or preferences) has changed.
+ *
+ * @param int $uid User ID
+ *
+ */
+ function PLG_userInfoChanged ($uid)
+ {
+ global $_PLUGINS;
+
+ foreach ($_PLUGINS as $pi_name) {
+ $function = 'plugin_user_changed_' . $pi_name;
+ if (function_exists ($function)) {
+ $function ($uid);
+ }
+ }
+ }
+
+ /**
+ * This functions is called to inform plugins when a group's information has
+ * changed or a new group has been created.
+ *
+ * @param int $grp_id Group ID
+ * @param string $mode type of change: 'new', 'edit', or 'delete'
+ *
+ */
+ function PLG_groupChanged ($grp_id, $mode)
+ {
+ global $_PLUGINS;
+
+ foreach ($_PLUGINS as $pi_name) {
+ $function = 'plugin_group_changed_' . $pi_name;
+ if (function_exists ($function)) {
+ $function ($grp_id, $mode);
+ }
+ }
+ }
+
+ /**
* 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.
***************
*** 748,752 ****
function PLG_profileVariablesEdit ($uid, &$template)
{
! global $_TABLES, $_PLUGINS;
foreach ($_PLUGINS as $pi_name) {
--- 787,791 ----
function PLG_profileVariablesEdit ($uid, &$template)
{
! global $_PLUGINS;
foreach ($_PLUGINS as $pi_name) {
***************
*** 768,772 ****
function PLG_profileBlocksEdit ($uid)
{
! global $_TABLES, $_PLUGINS;
$retval = '';
--- 807,811 ----
function PLG_profileBlocksEdit ($uid)
{
! global $_PLUGINS;
$retval = '';
***************
*** 792,796 ****
function PLG_profileVariablesDisplay ($uid, &$template)
{
! global $_TABLES, $_PLUGINS;
foreach ($_PLUGINS as $pi_name) {
--- 831,835 ----
function PLG_profileVariablesDisplay ($uid, &$template)
{
! global $_PLUGINS;
foreach ($_PLUGINS as $pi_name) {
***************
*** 812,816 ****
function PLG_profileBlocksDisplay ($uid)
{
! global $_TABLES, $_PLUGINS;
$retval = '';
--- 851,855 ----
function PLG_profileBlocksDisplay ($uid)
{
! global $_PLUGINS;
$retval = '';
***************
*** 856,860 ****
function PLG_templateSetVars ($templatename, &$template)
{
! global $_TABLES, $_PLUGINS;
foreach ($_PLUGINS as $pi_name) {
--- 895,899 ----
function PLG_templateSetVars ($templatename, &$template)
{
! global $_PLUGINS;
foreach ($_PLUGINS as $pi_name) {
***************
*** 874,878 ****
function PLG_getHeaderCode()
{
! global $_TABLES, $_PLUGINS;
$headercode = '';
--- 913,917 ----
function PLG_getHeaderCode()
{
! global $_PLUGINS;
$headercode = '';
***************
*** 934,938 ****
function PLG_replaceTags ($content)
{
! global $_CONF, $_TABLES, $_PLUGINS, $LANG32;
$autolinkModules = PLG_collectTags ();
--- 973,977 ----
function PLG_replaceTags ($content)
{
! global $_CONF, $_PLUGINS, $LANG32;
$autolinkModules = PLG_collectTags ();
***************
*** 1021,1025 ****
function PLG_supportingFeeds ()
{
! global $_TABLES, $_PLUGINS;
$plugins = array ();
--- 1060,1064 ----
function PLG_supportingFeeds ()
{
! global $_PLUGINS;
$plugins = array ();
***************
*** 1049,1057 ****
function PLG_getFeedNames ($plugin)
{
! global $_TABLES;
$feeds = array ();
! if (DB_getItem ($_TABLES['plugins'], 'pi_enabled', "pi_name = '$plugin'") == 1) {
$function = 'plugin_getfeednames_' . $plugin;
if (function_exists ($function)) {
--- 1088,1096 ----
function PLG_getFeedNames ($plugin)
{
! global $_PLUGINS;
$feeds = array ();
! if (in_array ($plugin, $_PLUGINS)) {
$function = 'plugin_getfeednames_' . $plugin;
if (function_exists ($function)) {
***************
*** 1079,1087 ****
function PLG_getFeedContent ($plugin, $feed, &$link, &$update_data)
{
! global $_TABLES;
$content = array ();
! if (DB_getItem ($_TABLES['plugins'], 'pi_enabled', "pi_name = '$plugin'") == 1) {
$function = 'plugin_getfeedcontent_' . $plugin;
if (function_exists ($function)) {
--- 1118,1126 ----
function PLG_getFeedContent ($plugin, $feed, &$link, &$update_data)
{
! global $_PLUGINS;
$content = array ();
! if (in_array ($plugin, $_PLUGINS)) {
$function = 'plugin_getfeedcontent_' . $plugin;
if (function_exists ($function)) {
***************
*** 1107,1115 ****
function PLG_feedUpdateCheck ($plugin, $feed, $topic, $update_data, $limit)
{
! global $_TABLES;
$is_current = true;
! if (DB_getItem ($_TABLES['plugins'], 'pi_enabled', "pi_name = '$plugin'") == 1) {
$function = 'plugin_feedupdatecheck_' . $plugin;
if (function_exists ($function)) {
--- 1146,1154 ----
function PLG_feedUpdateCheck ($plugin, $feed, $topic, $update_data, $limit)
{
! global $_PLUGINS;
$is_current = true;
! if (in_array ($plugin, $_PLUGINS)) {
$function = 'plugin_feedupdatecheck_' . $plugin;
if (function_exists ($function)) {
***************
*** 1129,1133 ****
function PLG_getWhatsNew ()
{
! global $_TABLES, $_PLUGINS;
$newheadlines = array ();
--- 1168,1172 ----
function PLG_getWhatsNew ()
{
! global $_PLUGINS;
$newheadlines = array ();
More information about the geeklog-cvs
mailing list