Completed
Push — master ( 8ca430...3024c9 )
by Michael
03:12
created

include/update.php (3 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/**
4
 * Module: XoopsTube
5
 *
6
 * You may not change or alter any portion of this comment or credits
7
 * of supporting developers from this source code or any supporting source code
8
 * which is considered copyrighted (c) material of the original comment or credit authors.
9
 *
10
 * PHP version 5
11
 *
12
 * @category        Module
13
 * @package         Xoopstube
14
 * @author          XOOPS Development Team
15
 * @copyright       2001-2013 The XOOPS Project
16
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
17
 * @version         $Id$
18
 * @link            http://sourceforge.net/projects/xoops/
19
 * @since           1.0.6
20
 */
21
22
// defined('XOOPS_ROOT_PATH') || die('XOOPS Root Path not defined');
0 ignored issues
show
Unused Code Comprehensibility introduced by
70% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
23
24
global $xoopsDB;
25
26
$i = 0;
27
//Make changes to table xoopstube_videos
28
++$i;
29
$ret[$i]   = true;
30
$query[$i] = sprintf(
31
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_videos') . " CHANGE forumid vidsource INT(11) NOT NULL default '0'"
32
);
33
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
34
++$i;
35
$ret[$i]   = true;
36
$query[$i] = sprintf(
37
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_videos') . " CHANGE url vidid TEXT NOT NULL default ''"
38
);
39
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
40
++$i;
41
$ret[$i]   = true;
42
$query[$i] = sprintf(
43
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_videos') . " CHANGE urlrating vidrating TINYINT(1) NOT NULL default '0'"
44
);
45
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
46
++$i;
47
$ret[$i]   = true;
48
$query[$i] = sprintf(
49
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_videos') . " MODIFY description LONGTEXT NOT NULL default ''"
50
);
51
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
52
++$i;
53
$ret[$i]   = true;
54
$query[$i] = sprintf(
55
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_videos') . " ADD COLUMN item_tag TEXT NOT NULL default '' AFTER keywords"
56
);
57
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
58
++$i;
59
$ret[$i]   = true;
60
$query[$i] = sprintf(
61
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_videos') . " ADD COLUMN picurl TEXT NOT NULL default '' AFTER item_tag"
62
);
63
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
64
$ret[$i]   = true;
65
++$i;
66
$ret[$i]   = true;
67
$query[$i] = sprintf(
68
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_videos') . " MODIFY keywords TEXT NOT NULL default ''"
69
);
70
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
71
++$i;
72
$ret[$i]   = true;
73
$query[$i] = sprintf(
74
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_videos') . " MODIFY vidsource INT(11) UNSIGNED NOT NULL default '0'"
75
);
76
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
77
++$i;
78
$ret[$i]   = true;
79
$query[$i] = sprintf(
80
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_videos') . " MODIFY time VARCHAR(7) NOT NULL default '0:00:00'"
81
);
82
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
83
//++$i;
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
84
//$ret[$i] = true;
85
//$query[$i] = sprintf("ALTER TABLE " . $xoopsDB -> prefix( 'xoopstube_videos') . " ADD COLUMN hq TINYINT(1) NOT NULL default '0' AFTER picurl");
86
//$ret[$i] = $ret[$i] && $xoopsDB -> query( $query[$i] );
87
88
//Make changes to table xoopstube_cat
89
++$i;
90
$ret[$i]   = true;
91
$query[$i] = sprintf(
92
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_cat') . " ADD COLUMN client_id INT(5) NOT NULL default '0' AFTER weight"
93
);
94
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
95
++$i;
96
$ret[$i]   = true;
97
$query[$i] = sprintf(
98
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_cat') . " ADD COLUMN banner_id INT(5) NOT NULL default '0' AFTER client_id"
99
);
100
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
101
102
//Make changes to table xoopstube_mod
103
++$i;
104
$ret[$i]   = true;
105
$query[$i] = sprintf(
106
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_mod') . " ADD COLUMN time VARCHAR(5) NOT NULL default '00:00' AFTER vidrating"
107
);
108
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
109
++$i;
110
$ret[$i]   = true;
111
$query[$i] = sprintf(
112
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_mod') . " ADD COLUMN keywords TEXT NOT NULL default '' AFTER time"
113
);
114
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
115
++$i;
116
$ret[$i]   = true;
117
$query[$i] = sprintf(
118
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_mod') . " ADD COLUMN item_tag TEXT NOT NULL default '' AFTER keywords"
119
);
120
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
121
++$i;
122
$ret[$i]   = true;
123
$query[$i] = sprintf(
124
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_mod') . " ADD COLUMN picurl TEXT NOT NULL default '' AFTER item_tag"
125
);
126
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
127
++$i;
128
$ret[$i]   = true;
129
$query[$i] = sprintf(
130
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_mod') . " MODIFY description LONGTEXT NOT NULL default ''"
131
);
132
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
133
++$i;
134
$ret[$i]   = true;
135
$query[$i] = sprintf(
136
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_mod') . " CHANGE forumid vidsource INT(11) NOT NULL default '0'"
137
);
138
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
139
++$i;
140
$ret[$i]   = true;
141
$query[$i] = sprintf("ALTER TABLE " . $xoopsDB->prefix('xoopstube_mod') . " CHANGE url vidid TEXT NOT NULL default ''");
142
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
143
++$i;
144
$ret[$i]   = true;
145
$query[$i] = sprintf(
146
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_mod') . " CHANGE urlrating vidrating TINYINT(1) NOT NULL default '0'"
147
);
148
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
149
++$i;
150
$ret[$i]   = true;
151
$query[$i] = sprintf("ALTER TABLE " . $xoopsDB->prefix('xoopstube_mod') . " MODIFY keywords TEXT NOT NULL default ''");
152
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
153
++$i;
154
$ret[$i]   = true;
155
$query[$i] = sprintf(
156
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_mod') . " MODIFY vidsource INT(11) UNSIGNED NOT NULL default '0'"
157
);
158
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
159
++$i;
160
$ret[$i]   = true;
161
$query[$i] = sprintf(
162
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_mod') . " MODIFY time VARCHAR(7) NOT NULL default '0:00:00'"
163
);
164
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
165
//++$i;
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
166
//$ret[$i] = true;
167
//$query[$i] = sprintf("ALTER TABLE " . $xoopsDB -> prefix( 'xoopstube_mod') . " ADD COLUMN hq TINYINT(1) NOT NULL default '0' AFTER picurl");
168
//$ret[$i] = $ret[$i] && $xoopsDB -> query( $query[$i] );
169
170
//Make changes to table xoopstube_indexpage
171
++$i;
172
$ret[$i]   = true;
173
$query[$i] = sprintf(
174
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_indexpage') . " ADD COLUMN lastvideosyn TINYINT(1) NOT NULL default '0' AFTER indexfooteralign"
175
);
176
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
177
++$i;
178
$ret[$i]   = true;
179
$query[$i] = sprintf(
180
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_indexpage') . " ADD COLUMN lastvideostotal VARCHAR(5) NOT NULL default '5' AFTER lastvideosyn"
181
);
182
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
183
184
// Make changes to xoopstube_broken
185
++$i;
186
$ret[$i]   = true;
187
$query[$i] = sprintf(
188
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_broken') . " MODIFY confirmed INT(1) UNSIGNED NOT NULL default '0'"
189
);
190
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
191
++$i;
192
$ret[$i]   = true;
193
$query[$i] = sprintf(
194
    "ALTER TABLE " . $xoopsDB->prefix('xoopstube_broken') . " MODIFY acknowledged INT(1) NOT NULL default '0'"
195
);
196
$ret[$i]   = $ret[$i] && $xoopsDB->query($query[$i]);
197
198
//TODO delete xoopstube.sql
199