XOOPS
2.6.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
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
12
use
Xoops\Core\Yaml
;
13
20
function
xoops_module_install_userrank
(
$module
)
21
{
22
$xoops
=
Xoops::getInstance
();
23
$xoops
->header();
24
$lang_rank_titles = array(
25
'dummy'
,
26
_MI_RANK_TITLE_1
,
27
_MI_RANK_TITLE_2
,
28
_MI_RANK_TITLE_3
,
29
_MI_RANK_TITLE_4
,
30
_MI_RANK_TITLE_5
,
31
_MI_RANK_TITLE_6
,
32
_MI_RANK_TITLE_7
,
33
);
34
$filedata = <<<EOT
35
-
36
rank_id: 1
37
rank_title:
"{$lang_rank_titles[1]}"
38
rank_min: 0
39
rank_max: 20
40
rank_special: 0
41
rank_image:
"ranks/rank3e632f95e81ca.gif"
42
-
43
rank_id: 2
44
rank_title:
"{$lang_rank_titles[2]}"
45
rank_min: 21
46
rank_max: 40
47
rank_special: 0
48
rank_image:
"ranks/rank3dbf8e94a6f72.gif"
49
-
50
rank_id: 3
51
rank_title:
"{$lang_rank_titles[3]}"
52
rank_min: 41
53
rank_max: 70
54
rank_special: 0
55
rank_image:
"ranks/rank3dbf8e9e7d88d.gif"
56
-
57
rank_id: 4
58
rank_title:
"{$lang_rank_titles[4]}"
59
rank_min: 71
60
rank_max: 150
61
rank_special: 0
62
rank_image:
"ranks/rank3dbf8ea81e642.gif"
63
-
64
rank_id: 5
65
rank_title:
"{$lang_rank_titles[5]}"
66
rank_min: 151
67
rank_max: 10000
68
rank_special: 0
69
rank_image:
"ranks/rank3dbf8eb1a72e7.gif"
70
-
71
rank_id: 6
72
rank_title:
"{$lang_rank_titles[6]}"
73
rank_min: 0
74
rank_max: 0
75
rank_special: 1
76
rank_image:
"ranks/rank3dbf8edf15093.gif"
77
-
78
rank_id: 7
79
rank_title:
"{$lang_rank_titles[7]}"
80
rank_min: 0
81
rank_max: 0
82
rank_special: 1
83
rank_image:
"ranks/rank3dbf8ee8681cd.gif"
84
EOT;
85
86
$tablerows = Yaml::load($filedata);
87
88
$dbm
=
$xoops
->db();
89
$count
=
$dbm
->fetchColumn(
'SELECT COUNT(*) FROM '
.
$dbm
->prefix(
"ranks"
));
90
if
(
$count
<1) {
91
$dbm
->beginTransaction();
92
foreach
($tablerows as $row) {
93
$dbm
->insertPrefix(
'ranks'
, $row);
94
}
95
$dbm
->commit();
96
}
97
return
true
;
98
}
_MI_RANK_TITLE_5
const _MI_RANK_TITLE_5
Definition:
modinfo.php:37
$count
$count
Definition:
page_tablesfill.php:45
xoops_module_install_userrank
xoops_module_install_userrank($module)
Definition:
install.php:20
_MI_RANK_TITLE_7
const _MI_RANK_TITLE_7
Definition:
modinfo.php:39
_MI_RANK_TITLE_2
const _MI_RANK_TITLE_2
Definition:
modinfo.php:34
Xoops\getInstance
static getInstance()
Definition:
Xoops.php:160
_MI_RANK_TITLE_3
const _MI_RANK_TITLE_3
Definition:
modinfo.php:35
Yaml
$dbm
$dbm
Definition:
page_tablesfill.php:44
$xoops
$xoops
Definition:
admin.php:25
$module
$module
Definition:
main.php:52
_MI_RANK_TITLE_4
const _MI_RANK_TITLE_4
Definition:
modinfo.php:36
_MI_RANK_TITLE_1
const _MI_RANK_TITLE_1
Definition:
modinfo.php:33
_MI_RANK_TITLE_6
const _MI_RANK_TITLE_6
Definition:
modinfo.php:38
usr64
htdocs
modules
userrank
include
install.php
Generated on Fri May 22 2015 03:07:02 for XOOPS by
1.8.9.1