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:
12: /**
13: * Private Message
14: *
15: * @copyright XOOPS Project (http://xoops.org)
16: * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
17: * @package pm
18: * @since 2.3.0
19: * @author Taiwen Jiang <phppp@users.sourceforge.net>
20: * @version $Id$
21: */
22:
23: /**
24: * @param XoopsModule $module
25: * @return bool|void
26: * @todo this should be removed, it is now handled by schema
27: */
28: function xoops_module_install_pm($module)
29: {
30: $xoops = Xoops::getInstance();
31: $xoops->db();
32: global $xoopsDB;
33: // Check pm table version
34: $sql = "SHOW COLUMNS FROM " . $xoopsDB->prefix("system_privatemessage");
35: if (!$result = $xoopsDB->queryF($sql)) {
36: return false;
37: }
38: // Migrate from existent pm module
39: if (($rows = $xoopsDB->getRowsNum($result)) == 12) {
40: return true;
41: } elseif ($rows == 8) {
42: return $xoopsDB->queryFromFile(\XoopsBaseConfig::get('root-path') . "/modules/" . $module->getVar('dirname', 'n') . "/sql/mysql.upgrade.sql");
43: } else {
44: return false;
45: }
46: }
47: