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("xoopscomments");
23  $result = $xoopsDB->queryF($sql);
24  if ($result && ($rows = $xoopsDB->getRowsNum($result)) == 20) {
25  $sql = "SELECT * FROM " . $xoopsDB->prefix("xoopscomments");
26  $result = $xoopsDB->query($sql);
27  while ($myrow = $xoopsDB->fetchArray($result)) {
28  $sql = "INSERT INTO `" . $xoopsDB->prefix("comments") . "` (`id`, `pid`, `rootid`, `modid`, `itemid`, `icon`, `created`, `modified`, `uid`, `ip`, `title`, `text`, `sig`, `status`, `exparams`, `dohtml`, `domsiley`, `doxcode`, `doimage`, `dobr`) VALUES (" . $myrow['com_id'] . ", " . $myrow['com_pid'] . ", " . $myrow['com_rootid'] . ", " . $myrow['com_modid'] . ", " . $myrow['com_itemid'] . ", " . $myrow['com_icon'] . ", " . $myrow['com_created'] . ", " . $myrow['com_modified'] . ", " . $myrow['com_uid'] . ", " . $myrow['com_ip'] . ", " . $myrow['com_title'] . ", " . $myrow['com_text'] . ", " . $myrow['com_sig'] . ", " . $myrow['com_status'] . ", " . $myrow['com_exparams'] . ", " . $myrow['dohtml'] . ", " . $myrow['dosmiley'] . ", " . $myrow['doxcode'] . ", " . $myrow['doimage'] . ", " . $myrow['dobr'] . ")";
29  $xoopsDB->queryF($sql);
30  }
31  //Don't drop old table for now
32  //$sql = "DROP TABLE " . $xoopsDB->prefix("xoopscomments");
33  //$xoopsDB->queryF($sql);
34  }
35 
36  XoopsLoad::loadFile($xoops->path('modules/comments/class/helper.php'));
38  $plugins = \Xoops\Module\Plugin::getPlugins('comments');
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/comments/class/helper.php'));
52  $plugins = \Xoops\Module\Plugin::getPlugins('comments');
53  foreach (array_keys($plugins) as $dirname) {
54  $helper->deleteModuleRelations($xoops->getModuleByDirname($dirname));
55  }
56 
57  return true;
58 }
static getInstance()
Definition: Xoops.php:160
static getInstance()
Definition: helper.php:46
$result
Definition: pda.php:33
$xoops
Definition: admin.php:25
$module
Definition: main.php:52
global $xoopsDB
Definition: common.php:36
xoops_module_pre_uninstall_comments(&$module)
Definition: install.php:47
$sql
Definition: pda.php:32
$helper
$dirname
Definition: backend.php:38
static loadFile($file, $once=true)
Definition: xoopsload.php:454
xoops_module_install_comments(&$module)
Definition: install.php:18