From a9050cc2a39e041fa6f3fecc22deb00e6a812712 Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Tue, 20 Oct 2009 03:58:47 +0000 Subject: [PATCH] Adding setup files --- e107_plugins/calendar_menu/calendar_setup.php | 82 +++++++++++++++++++ e107_plugins/download/download_setup.php | 53 ++++++++++++ e107_plugins/forum/forum_setup.php | 59 +++++++++++++ .../login_menu/login_menu_template.php | 7 +- e107_plugins/pm/pm_setup.php | 26 ++++++ 5 files changed, 224 insertions(+), 3 deletions(-) create mode 100644 e107_plugins/calendar_menu/calendar_setup.php create mode 100644 e107_plugins/download/download_setup.php create mode 100644 e107_plugins/forum/forum_setup.php create mode 100644 e107_plugins/pm/pm_setup.php diff --git a/e107_plugins/calendar_menu/calendar_setup.php b/e107_plugins/calendar_menu/calendar_setup.php new file mode 100644 index 000000000..aea4f4222 --- /dev/null +++ b/e107_plugins/calendar_menu/calendar_setup.php @@ -0,0 +1,82 @@ +_setup +{ + + function calendar_menu_install_post($param) + { + $mes = eMessage::getInstance(); + if($this->insertDefaultCategory(FALSE)) + { + $mes->add(EC_ADINST_LAN_06, E_MESSAGE_SUCCESS); + } + else + { + $mes->add(EC_ADINST_LAN_07, E_MESSAGE_ERROR); + } + + $mes->add(EC_ADINST_LAN_04, E_MESSAGE_SUCCESS); + + } + + + function calendar_menu_install_pre($param) + { + // echo "Calendar uninstall routine
"; + } + + + function calendar_menu_upgrade_post($param) + { + $mes = eMessage::getInstance(); + if($this->insertDefaultCategory(TRUE)) + { + $mes->add(EC_ADINST_LAN_06, E_MESSAGE_SUCCESS); + } + else + { + $mes->add(EC_ADINST_LAN_07, E_MESSAGE_ERROR); + } + } + + + function insertDefaultCategory($isUpgrade = FALSE) // Insert the text for the default category into the DB here + { + $sql = e107::getDb(); + + require_once('ecal_class.php'); // Gets the define for the 'Default' category + if ($isUpgrade && $sql->db_Select('event_cat','event_cat_name',"event_cat_name='".EC_DEFAULT_CATEGORY."' ", TRUE)) + { + return EC_ADINST_LAN_08.'
'; + } + $ec_insert_entries = "INSERT INTO `#event_cat` (event_cat_name, event_cat_description, event_cat_ahead, event_cat_msg1, event_cat_msg2, event_cat_lastupdate) + VALUES ('".EC_DEFAULT_CATEGORY."', '".EC_ADINST_LAN_03."', 5, + '".EC_ADINST_LAN_01."', '".EC_ADINST_LAN_02."', + '".intval(time())."') "; + + return $sql->db_Select_gen($ec_insert_entries); + } +} + +?> \ No newline at end of file diff --git a/e107_plugins/download/download_setup.php b/e107_plugins/download/download_setup.php new file mode 100644 index 000000000..a058ef7e7 --- /dev/null +++ b/e107_plugins/download/download_setup.php @@ -0,0 +1,53 @@ +add("custom install 'pre' function.", E_MESSAGE_SUCCESS); + } + + function download_install_post(&$var) + { + $sql = e107::getDb(); + $mes = eMessage::getInstance(); + // $mes->add("custom install 'post' function.", E_MESSAGE_SUCCESS); + } + + function download_uninstall_pre(&$var) + { + $sql = e107::getDb(); + $mes = eMessage::getInstance(); + // $mes->add("custom uninstall 'pre' function.", E_MESSAGE_SUCCESS); + } + + function download_upgrade_post(&$var) + { + $sql = e107::getDb(); + $mes = eMessage::getInstance(); + // $mes->add("custom upgrade 'post' function.", E_MESSAGE_SUCCESS); + + //if(version_compare($var['current_plug']['plugin_version'], "1.2", "<")) + //{ + // $qry = "ALTER TABLE #download ADD download_postclass TINYINT( 3 ) UNSIGNED DEFAULT '0' NOT NULL ;"; + // $sql->db_Select_gen($qry); + //} + } +} diff --git a/e107_plugins/forum/forum_setup.php b/e107_plugins/forum/forum_setup.php new file mode 100644 index 000000000..6b5499de7 --- /dev/null +++ b/e107_plugins/forum/forum_setup.php @@ -0,0 +1,59 @@ +
"; + } + + function forum_install_post(&$var) + { + $sql = e107::getDb(); + $mes = eMessage::getInstance(); + + if($sql -> db_Update("user", "user_forums='0'")) + { + $mes->add("Setting all user_forums to 0.", E_MESSAGE_SUCCESS); + } + } + + function forum_uninstall_post(&$var) + { + $sql = e107::getDb(); + $mes = eMessage::getInstance(); + + if($sql -> db_Update("user", "user_forums='0'")) + { + $mes->add("Setting all user_forums to 0.", E_MESSAGE_SUCCESS); + } + } + + function forum_upgrade_post(&$var) + { + $sql = e107::getDb(); + $mes = eMessage::getInstance(); + + if(version_compare($var['current_plug']['plugin_version'], "1.2", "<")) + { + $qry = "ALTER TABLE #forum ADD forum_postclass TINYINT( 3 ) UNSIGNED DEFAULT '0' NOT NULL ;"; + $sql->db_Select_gen($qry); + } + } +} diff --git a/e107_plugins/login_menu/login_menu_template.php b/e107_plugins/login_menu/login_menu_template.php index 017daba60..054a4cb89 100644 --- a/e107_plugins/login_menu/login_menu_template.php +++ b/e107_plugins/login_menu/login_menu_template.php @@ -9,9 +9,9 @@ * Login menu template * * $Source: /cvs_backup/e107_0.8/e107_plugins/login_menu/login_menu_template.php,v $ - * $Revision: 1.8 $ - * $Date: 2009-07-18 18:23:44 $ - * $Author: marj_nl_fr $ + * $Revision: 1.9 $ + * $Date: 2009-10-20 03:58:47 $ + * $Author: e107coders $ */ if ( ! isset($LOGIN_MENU_FORM)) @@ -79,6 +79,7 @@ if ( ! isset($LOGIN_MENU_FORM)) {LM_SIGNUP_LINK} {LM_FPW_LINK} {LM_RESEND_LINK} + {FB_LOGIN_BUTTON} "; } diff --git a/e107_plugins/pm/pm_setup.php b/e107_plugins/pm/pm_setup.php new file mode 100644 index 000000000..86543587a --- /dev/null +++ b/e107_plugins/pm/pm_setup.php @@ -0,0 +1,26 @@ +db_Delete("core", "e107_name = 'pm_prefs'"); + $sql->db_Delete("menus", "menu_name = 'private_msg_menu'"); + } + +}