XOOPS  2.6.0
install.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 */
11 
19 {
21  global $xoopsDB;
22  $sql = "SHOW COLUMNS FROM " . $xoopsDB->prefix("xoopsnotifications");
23  $result = $xoopsDB->queryF($sql);
24  if ($result && ($rows = $xoopsDB->getRowsNum($result)) == 7) {
25  $sql = "SELECT * FROM " . $xoopsDB->prefix("xoopsnotifications");
26  $result = $xoopsDB->query($sql);
27  while ($myrow = $xoopsDB->fetchArray($result)) {
28  $sql = "INSERT INTO `" . $xoopsDB->prefix("notifications") . "` (`id`, `modid`, `itemid`, `category`, `event`, `uid`, `mode`) VALUES (" . $myrow['not_id'] . ", " . $myrow['not_modid'] . ", " . $myrow['not_itemid'] . ", " . $myrow['not_category'] . ", " . $myrow['not_event'] . ", " . $myrow['not_uid'] . ", " . $myrow['not_mode'] . ")";
29  $xoopsDB->queryF($sql);
30  }
31  //Don't drop old table for now
32  //$sql = "DROP TABLE " . $xoopsDB->prefix("xoopsnotifications");
33  //$xoopsDB->queryF($sql);
34  }
35 
36  XoopsLoad::loadFile($xoops->path('modules/notifications/class/helper.php'));
38  $plugins = \Xoops\Module\Plugin::getPlugins('notifications');
39 
40  foreach (array_keys($plugins) as $dirname) {
41  $helper->insertModuleRelations($xoops->getModuleByDirname($dirname));
42  }
43 
44  return true;
45 }
46 
48 {
50  XoopsLoad::loadFile($xoops->path('modules/notifications/class/helper.php'));
52  $plugins = \Xoops\Module\Plugin::getPlugins('notifications');
53  foreach (array_keys($plugins) as $dirname) {
54  $helper->deleteModuleRelations($xoops->getModuleByDirname($dirname));
55  }
56 
57  return true;
58 }
xoops_module_install_notifications(&$module)
Definition: install.php:18
static getInstance()
Definition: Xoops.php:160
static getInstance()
Definition: helper.php:47
$result
Definition: pda.php:33
$xoops
Definition: admin.php:25
$module
Definition: main.php:52
global $xoopsDB
Definition: common.php:36
$sql
Definition: pda.php:32
$helper
$dirname
Definition: backend.php:38
static loadFile($file, $once=true)
Definition: xoopsload.php:454
xoops_module_pre_uninstall_notifications(&$module)
Definition: install.php:47