Merge lp:~quam-plures-core/quam-plures/qp5_final_branch into lp:quam-plures
- qp5_final_branch
- Merge into trunk
Proposed by
EdB
Status: | Merged |
---|---|
Merged at revision: | 7663 |
Proposed branch: | lp:~quam-plures-core/quam-plures/qp5_final_branch |
Merge into: | lp:quam-plures |
Diff against target: |
2497 lines (+864/-454) 44 files modified
admin.php (+3/-3) blog2.php (+0/-42) blog3.php (+0/-42) blog4.php (+0/-42) qp_config/_admin.php (+72/-7) qp_inc/_application.php (+3/-3) qp_inc/_core/__core.init.php (+25/-48) qp_inc/_core/_param.funcs.php (+5/-0) qp_inc/_core/model/__core.install.php (+2/-32) qp_inc/_core/ui/results/_results.class.php (+12/-6) qp_inc/blogs/blogs.ctrl.php (+1/-1) qp_inc/blogs/model/_blog.class.php (+3/-3) qp_inc/files/file_settings.ctrl.php (+48/-16) qp_inc/files/files.ctrl.php (+2/-2) qp_inc/files/model/_file.class.php (+3/-0) qp_inc/files/model/_file.funcs.php (+5/-4) qp_inc/files/model/_filelist.class.php (+5/-2) qp_inc/files/model/_fileroot.class.php (+3/-3) qp_inc/files/model/_filerootcache.class.php (+1/-1) qp_inc/files/upload.ctrl.php (+124/-42) qp_inc/files/views/_file_browse.view.php (+2/-2) qp_inc/files/views/_file_browse_set.form.php (+1/-1) qp_inc/files/views/_file_list.inc.php (+1/-1) qp_inc/files/views/_file_settings.form.php (+32/-59) qp_inc/generic/model/_genericelement.class.php (+1/-1) qp_inc/generic/views/_generic_category.form.php (+1/-1) qp_inc/plugins/_plugin.class.php (+11/-0) qp_inc/plugins/_plugin.funcs.php (+2/-1) qp_inc/plugins/model/_plugins_admin.class.php (+1/-0) qp_inc/sessions/_sessions.init.php (+3/-6) qp_inc/settings/model/_generalsettings.class.php (+9/-1) qp_inc/templates/model/_template.class.php (+3/-0) qp_inc/tools/views/_system_list.view.php (+2/-20) qp_inc/users/model/_user.class.php (+28/-7) qp_inc/users/model/_user.funcs.php (+37/-12) qp_inc/users/model/_usersettings.class.php (+1/-1) qp_inc/users/users.ctrl.php (+11/-0) qp_inc/users/views/_user.form.php (+46/-20) qp_inc/users/views/_user_list.view.php (+37/-10) qp_install/_create_items.php (+9/-9) qp_install/_functions_dbupgrade.php (+297/-0) qp_plugins/smilies_plugin/_smilies.plugin.php (+6/-1) qp_srvc/profile_update.php (+4/-1) qp_srvc/register.php (+2/-1) |
To merge this branch: | bzr merge lp:~quam-plures-core/quam-plures/qp5_final_branch |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Quam Plures Core Team | Pending | ||
Review via email: mp+156414@code.launchpad.net |
Commit message
Description of the change
the last of the "monster" series. after this we're back to business as usual :)
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'admin.php' | |||
2 | --- admin.php 2013-03-18 19:20:42 +0000 | |||
3 | +++ admin.php 2013-04-18 18:37:26 +0000 | |||
4 | @@ -79,10 +79,10 @@ | |||
5 | 79 | if( ! $admin_template || ! file_exists( sprintf( $admin_template_path, $admin_template ) ) ) | 79 | if( ! $admin_template || ! file_exists( sprintf( $admin_template_path, $admin_template ) ) ) |
6 | 80 | { | 80 | { |
7 | 81 | // even the default template does not exist! | 81 | // even the default template does not exist! |
10 | 82 | // set 'wind' as the admin template if it exists | 82 | // set 'earth' as the admin template if it exists |
11 | 83 | if( file_exists( sprintf( $admin_template_path, 'wind' ) ) ) | 83 | if( file_exists( sprintf( $admin_template_path, 'earth' ) ) ) |
12 | 84 | { | 84 | { |
14 | 85 | $admin_template = 'wind'; | 85 | $admin_template = 'earth'; |
15 | 86 | } | 86 | } |
16 | 87 | else | 87 | else |
17 | 88 | { | 88 | { |
18 | 89 | 89 | ||
19 | === removed file 'blog2.php' | |||
20 | --- blog2.php 2013-03-08 20:58:52 +0000 | |||
21 | +++ blog2.php 1970-01-01 00:00:00 +0000 | |||
22 | @@ -1,42 +0,0 @@ | |||
23 | 1 | <?php | ||
24 | 2 | /** | ||
25 | 3 | * Stub File Template | ||
26 | 4 | * | ||
27 | 5 | * This file is used to create a new stub file when a blog is created. If the value of $blog | ||
28 | 6 | * is not NNN then this file was created; only stubfile.template.php has that value of $blog. | ||
29 | 7 | * | ||
30 | 8 | * @author {@link http://wonderwinds.com/ Ed Bennett} | ||
31 | 9 | * @copyright (c) 2010 by {@link http://quamplures.net/ the Quam Plures project} | ||
32 | 10 | * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3 | ||
33 | 11 | * @package templates | ||
34 | 12 | */ | ||
35 | 13 | |||
36 | 14 | // select which blog | ||
37 | 15 | $blog = 2; | ||
38 | 16 | |||
39 | 17 | // retricts posts to published, hides drafts | ||
40 | 18 | $show_statuses = array(); | ||
41 | 19 | |||
42 | 20 | // ignore before, unix timestamp or 'now' | ||
43 | 21 | $timestamp_min = ''; | ||
44 | 22 | |||
45 | 23 | // ignore after, unix timestamp or 'now' | ||
46 | 24 | $timestamp_max = 'now'; | ||
47 | 25 | |||
48 | 26 | // force a template? | ||
49 | 27 | # $template = 'custom'; | ||
50 | 28 | |||
51 | 29 | // change order? | ||
52 | 30 | # $order = 'ASC'; | ||
53 | 31 | |||
54 | 32 | /** | ||
55 | 33 | * Load the configuration minimum | ||
56 | 34 | */ | ||
57 | 35 | require_once dirname(__FILE__).'/qp_config/_config.php'; | ||
58 | 36 | |||
59 | 37 | /** | ||
60 | 38 | * Main initialization, with the identified $blog | ||
61 | 39 | */ | ||
62 | 40 | require $inc_path.'_blog_main.inc.php'; | ||
63 | 41 | |||
64 | 42 | ?> | ||
65 | 43 | 0 | ||
66 | === removed file 'blog3.php' | |||
67 | --- blog3.php 2013-03-08 20:58:52 +0000 | |||
68 | +++ blog3.php 1970-01-01 00:00:00 +0000 | |||
69 | @@ -1,42 +0,0 @@ | |||
70 | 1 | <?php | ||
71 | 2 | /** | ||
72 | 3 | * Stub File Template | ||
73 | 4 | * | ||
74 | 5 | * This file is used to create a new stub file when a blog is created. If the value of $blog | ||
75 | 6 | * is not NNN then this file was created; only stubfile.template.php has that value of $blog. | ||
76 | 7 | * | ||
77 | 8 | * @author {@link http://wonderwinds.com/ Ed Bennett} | ||
78 | 9 | * @copyright (c) 2010 by {@link http://quamplures.net/ the Quam Plures project} | ||
79 | 10 | * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3 | ||
80 | 11 | * @package templates | ||
81 | 12 | */ | ||
82 | 13 | |||
83 | 14 | // select which blog | ||
84 | 15 | $blog = 3; | ||
85 | 16 | |||
86 | 17 | // retricts posts to published, hides drafts | ||
87 | 18 | $show_statuses = array(); | ||
88 | 19 | |||
89 | 20 | // ignore before, unix timestamp or 'now' | ||
90 | 21 | $timestamp_min = ''; | ||
91 | 22 | |||
92 | 23 | // ignore after, unix timestamp or 'now' | ||
93 | 24 | $timestamp_max = 'now'; | ||
94 | 25 | |||
95 | 26 | // force a template? | ||
96 | 27 | # $template = 'custom'; | ||
97 | 28 | |||
98 | 29 | // change order? | ||
99 | 30 | # $order = 'ASC'; | ||
100 | 31 | |||
101 | 32 | /** | ||
102 | 33 | * Load the configuration minimum | ||
103 | 34 | */ | ||
104 | 35 | require_once dirname(__FILE__).'/qp_config/_config.php'; | ||
105 | 36 | |||
106 | 37 | /** | ||
107 | 38 | * Main initialization, with the identified $blog | ||
108 | 39 | */ | ||
109 | 40 | require $inc_path.'_blog_main.inc.php'; | ||
110 | 41 | |||
111 | 42 | ?> | ||
112 | 43 | 0 | ||
113 | === removed file 'blog4.php' | |||
114 | --- blog4.php 2013-03-08 20:58:52 +0000 | |||
115 | +++ blog4.php 1970-01-01 00:00:00 +0000 | |||
116 | @@ -1,42 +0,0 @@ | |||
117 | 1 | <?php | ||
118 | 2 | /** | ||
119 | 3 | * Stub File Template | ||
120 | 4 | * | ||
121 | 5 | * This file is used to create a new stub file when a blog is created. If the value of $blog | ||
122 | 6 | * is not NNN then this file was created; only stubfile.template.php has that value of $blog. | ||
123 | 7 | * | ||
124 | 8 | * @author {@link http://wonderwinds.com/ Ed Bennett} | ||
125 | 9 | * @copyright (c) 2010 by {@link http://quamplures.net/ the Quam Plures project} | ||
126 | 10 | * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3 | ||
127 | 11 | * @package templates | ||
128 | 12 | */ | ||
129 | 13 | |||
130 | 14 | // select which blog | ||
131 | 15 | $blog = 4; | ||
132 | 16 | |||
133 | 17 | // retricts posts to published, hides drafts | ||
134 | 18 | $show_statuses = array(); | ||
135 | 19 | |||
136 | 20 | // ignore before, unix timestamp or 'now' | ||
137 | 21 | $timestamp_min = ''; | ||
138 | 22 | |||
139 | 23 | // ignore after, unix timestamp or 'now' | ||
140 | 24 | $timestamp_max = 'now'; | ||
141 | 25 | |||
142 | 26 | // force a template? | ||
143 | 27 | # $template = 'custom'; | ||
144 | 28 | |||
145 | 29 | // change order? | ||
146 | 30 | # $order = 'ASC'; | ||
147 | 31 | |||
148 | 32 | /** | ||
149 | 33 | * Load the configuration minimum | ||
150 | 34 | */ | ||
151 | 35 | require_once dirname(__FILE__).'/qp_config/_config.php'; | ||
152 | 36 | |||
153 | 37 | /** | ||
154 | 38 | * Main initialization, with the identified $blog | ||
155 | 39 | */ | ||
156 | 40 | require $inc_path.'_blog_main.inc.php'; | ||
157 | 41 | |||
158 | 42 | ?> | ||
159 | 43 | 0 | ||
160 | === modified file 'qp_config/_admin.php' | |||
161 | --- qp_config/_admin.php 2013-03-22 21:28:25 +0000 | |||
162 | +++ qp_config/_admin.php 2013-04-18 18:37:26 +0000 | |||
163 | @@ -24,6 +24,8 @@ | |||
164 | 24 | * - 2 if you want to be able to cross-post among multiple blogs/categories | 24 | * - 2 if you want to be able to cross-post among multiple blogs/categories |
165 | 25 | * - 3 if you want to be able to change main cat among blogs | 25 | * - 3 if you want to be able to change main cat among blogs |
166 | 26 | * Note: #3 moves the posts from one blog to another, so use with caution. | 26 | * Note: #3 moves the posts from one blog to another, so use with caution. |
167 | 27 | * | ||
168 | 28 | * @global integer $allow_cross_posting | ||
169 | 27 | */ | 29 | */ |
170 | 28 | $allow_cross_posting = 1; | 30 | $allow_cross_posting = 1; |
171 | 29 | 31 | ||
172 | @@ -32,6 +34,8 @@ | |||
173 | 32 | * | 34 | * |
174 | 33 | * Automatically balance unmatched tags in posts and comments. Choose | 35 | * Automatically balance unmatched tags in posts and comments. Choose |
175 | 34 | * the formatting options for your posts: 0 to disable, 1 to enable | 36 | * the formatting options for your posts: 0 to disable, 1 to enable |
176 | 37 | * | ||
177 | 38 | * @global bool $balance_tags | ||
178 | 35 | */ | 39 | */ |
179 | 36 | $balance_tags = 1; | 40 | $balance_tags = 1; |
180 | 37 | 41 | ||
181 | @@ -40,30 +44,38 @@ | |||
182 | 40 | * | 44 | * |
183 | 41 | * Default of 1 messages sent via the message form will be checked against | 45 | * Default of 1 messages sent via the message form will be checked against |
184 | 42 | * the antispam blacklist. Set it to 0 if you like spam I guess. | 46 | * the antispam blacklist. Set it to 0 if you like spam I guess. |
185 | 47 | * | ||
186 | 48 | * @global bool $antispam_on_message_form | ||
187 | 43 | */ | 49 | */ |
188 | 44 | $antispam_on_message_form = 1; | 50 | $antispam_on_message_form = 1; |
189 | 45 | 51 | ||
190 | 46 | /** | 52 | /** |
191 | 53 | * Cookie Expired | ||
192 | 54 | * | ||
193 | 55 | * Expired-time, used to erase comment meta data cookies. Default is 24 hours ago. | ||
194 | 56 | * | ||
195 | 57 | * @global integer $cookie_expired | ||
196 | 58 | */ | ||
197 | 59 | $cookie_expired = time() - 86400; | ||
198 | 60 | |||
199 | 61 | /** | ||
200 | 47 | * Cookies Expire | 62 | * Cookies Expire |
201 | 48 | * | 63 | * |
202 | 49 | * Expiration for comment meta data cookies, in seconds. Set this to 0 if you wish | 64 | * Expiration for comment meta data cookies, in seconds. Set this to 0 if you wish |
203 | 50 | * to use non-permanent cookies (erased when browser is closed). Default is one | 65 | * to use non-permanent cookies (erased when browser is closed). Default is one |
204 | 51 | * year from now. | 66 | * year from now. |
205 | 67 | * | ||
206 | 68 | * @global integer $cookie_expires | ||
207 | 52 | */ | 69 | */ |
208 | 53 | $cookie_expires = time() + 31536000; | 70 | $cookie_expires = time() + 31536000; |
209 | 54 | 71 | ||
210 | 55 | /** | 72 | /** |
211 | 56 | * Cookie Expired | ||
212 | 57 | * | ||
213 | 58 | * Expired-time, used to erase comment meta data cookies. Default is 24 hours ago. | ||
214 | 59 | */ | ||
215 | 60 | $cookie_expired = time() - 86400; | ||
216 | 61 | |||
217 | 62 | /** | ||
218 | 63 | * Cron Timeout Delay | 73 | * Cron Timeout Delay |
219 | 64 | * | 74 | * |
220 | 65 | * Seconds after which a scheduled task is considered to be timed out, default is | 75 | * Seconds after which a scheduled task is considered to be timed out, default is |
221 | 66 | * 30 minutes. | 76 | * 30 minutes. |
222 | 77 | * | ||
223 | 78 | * @global integer $cron_timeout_delay | ||
224 | 67 | */ | 79 | */ |
225 | 68 | $cron_timeout_delay = 1800; | 80 | $cron_timeout_delay = 1800; |
226 | 69 | 81 | ||
227 | @@ -72,6 +84,8 @@ | |||
228 | 72 | * | 84 | * |
229 | 73 | * This controls how many items by section (comments, drafts, recent edits) | 85 | * This controls how many items by section (comments, drafts, recent edits) |
230 | 74 | * are displayed on the dashboard page. | 86 | * are displayed on the dashboard page. |
231 | 87 | * | ||
232 | 88 | * @global integer $dash_disp_num | ||
233 | 75 | */ | 89 | */ |
234 | 76 | $dash_disp_num = 5; | 90 | $dash_disp_num = 5; |
235 | 77 | 91 | ||
236 | @@ -83,6 +97,8 @@ | |||
237 | 83 | * - 1 = yes | 97 | * - 1 = yes |
238 | 84 | * - 2 = yes and potentially die() to display debug info (needed before redirects, | 98 | * - 2 = yes and potentially die() to display debug info (needed before redirects, |
239 | 85 | * e-g message_send.php) | 99 | * e-g message_send.php) |
240 | 100 | * | ||
241 | 101 | * @global integer $debug | ||
242 | 86 | */ | 102 | */ |
243 | 87 | $debug = 0; | 103 | $debug = 0; |
244 | 88 | 104 | ||
245 | @@ -92,6 +108,8 @@ | |||
246 | 92 | * Display elements that are different on each request (Page processing time, ...) | 108 | * Display elements that are different on each request (Page processing time, ...) |
247 | 93 | * Set this to true to prevent displaying minor changing elements (like time) in | 109 | * Set this to true to prevent displaying minor changing elements (like time) in |
248 | 94 | * order not to have artificial content changes. | 110 | * order not to have artificial content changes. |
249 | 111 | * | ||
250 | 112 | * @global bool $debug_obhandler | ||
251 | 95 | */ | 113 | */ |
252 | 96 | $debug_obhandler = false; | 114 | $debug_obhandler = false; |
253 | 97 | 115 | ||
254 | @@ -101,6 +119,8 @@ | |||
255 | 101 | * $debug always applies to anyone logged in. Set this to 1 if you want debug info | 119 | * $debug always applies to anyone logged in. Set this to 1 if you want debug info |
256 | 102 | * displayed when you are not logged in (for troubleshooting what a visitor sees). | 120 | * displayed when you are not logged in (for troubleshooting what a visitor sees). |
257 | 103 | * Default is 0. possible values: 0 = no, 1 = yes | 121 | * Default is 0. possible values: 0 = no, 1 = yes |
258 | 122 | * | ||
259 | 123 | * @global bool $debug_visitors | ||
260 | 104 | */ | 124 | */ |
261 | 105 | $debug_visitors = 0; | 125 | $debug_visitors = 0; |
262 | 106 | 126 | ||
263 | @@ -108,6 +128,8 @@ | |||
264 | 108 | * XMLRPC logging | 128 | * XMLRPC logging |
265 | 109 | * | 129 | * |
266 | 110 | * Set this to 1 to log XMLRPC calls received by this server (into /qp_srvc/xmlrpc.log). | 130 | * Set this to 1 to log XMLRPC calls received by this server (into /qp_srvc/xmlrpc.log). |
267 | 131 | * | ||
268 | 132 | * @global bool $debug_xmlrpc_logging | ||
269 | 111 | */ | 133 | */ |
270 | 112 | $debug_xmlrpc_logging = 0; | 134 | $debug_xmlrpc_logging = 0; |
271 | 113 | 135 | ||
272 | @@ -118,6 +140,8 @@ | |||
273 | 118 | * do not allow changes to the 'admin' or 'demouser' or 'demoblogger' or 'demospecial' | 140 | * do not allow changes to the 'admin' or 'demouser' or 'demoblogger' or 'demospecial' |
274 | 119 | * accounts/groups, blog media directories can only be configured to be inside of | 141 | * accounts/groups, blog media directories can only be configured to be inside of |
275 | 120 | * {@link $media_path}. | 142 | * {@link $media_path}. |
276 | 143 | * | ||
277 | 144 | * @global bool $demo_mode | ||
278 | 121 | */ | 145 | */ |
279 | 122 | $demo_mode = false; | 146 | $demo_mode = false; |
280 | 123 | 147 | ||
281 | @@ -126,6 +150,8 @@ | |||
282 | 126 | * | 150 | * |
283 | 127 | * File extensions that the admin will not be able to enable via the admin interface | 151 | * File extensions that the admin will not be able to enable via the admin interface |
284 | 128 | * (Global settings => files). | 152 | * (Global settings => files). |
285 | 153 | * | ||
286 | 154 | * @global array $forbidden_upload_exts | ||
287 | 129 | */ | 155 | */ |
288 | 130 | $forbidden_upload_exts = array( | 156 | $forbidden_upload_exts = array( |
289 | 131 | 'cgi', | 157 | 'cgi', |
290 | @@ -148,6 +174,8 @@ | |||
291 | 148 | * The admin can configure the regular expression for valid file names in the Settings | 174 | * The admin can configure the regular expression for valid file names in the Settings |
292 | 149 | * interface. However if this is set to non empty, the admin will not be able to | 175 | * interface. However if this is set to non empty, the admin will not be able to |
293 | 150 | * customize these values. | 176 | * customize these values. |
294 | 177 | * | ||
295 | 178 | * @global string $force_regexp_filename | ||
296 | 151 | */ | 179 | */ |
297 | 152 | $force_regexp_filename = ''; | 180 | $force_regexp_filename = ''; |
298 | 153 | 181 | ||
299 | @@ -157,6 +185,8 @@ | |||
300 | 157 | * The admin can configure the regular expression for valid dir names in the Settings | 185 | * The admin can configure the regular expression for valid dir names in the Settings |
301 | 158 | * interface. However if this is set to non empty, the admin will not be able to | 186 | * interface. However if this is set to non empty, the admin will not be able to |
302 | 159 | * customize these values. | 187 | * customize these values. |
303 | 188 | * | ||
304 | 189 | * @global string $force_regexp_dirname | ||
305 | 160 | */ | 190 | */ |
306 | 161 | $force_regexp_dirname = ''; | 191 | $force_regexp_dirname = ''; |
307 | 162 | 192 | ||
308 | @@ -166,6 +196,8 @@ | |||
309 | 166 | * The "home" button on the top right of the navbar is the only use of this. By | 196 | * The "home" button on the top right of the navbar is the only use of this. By |
310 | 167 | * default this is the base url, and unless you do a complex installation there | 197 | * default this is the base url, and unless you do a complex installation there |
311 | 168 | * is no need to change it. | 198 | * is no need to change it. |
312 | 199 | * | ||
313 | 200 | * @global string $home_url | ||
314 | 169 | */ | 201 | */ |
315 | 170 | $home_url = $app_baseurl; | 202 | $home_url = $app_baseurl; |
316 | 171 | 203 | ||
317 | @@ -182,15 +214,32 @@ | |||
318 | 182 | * | 214 | * |
319 | 183 | * @todo generate a random instance name at install and have it saved in the global | 215 | * @todo generate a random instance name at install and have it saved in the global |
320 | 184 | * params in the DB | 216 | * params in the DB |
321 | 217 | * | ||
322 | 218 | * @global string $instance_name | ||
323 | 185 | */ | 219 | */ |
324 | 186 | $instance_name = 'quamplures'; | 220 | $instance_name = 'quamplures'; |
325 | 187 | 221 | ||
326 | 188 | /** | 222 | /** |
327 | 223 | * Lock user's ID and nickname | ||
328 | 224 | * | ||
329 | 225 | * Setting this to 'true' will mean a user can not change their login ID or nickname. | ||
330 | 226 | * They will still be able to change their "known as" - just not their nickname | ||
331 | 227 | * or login :) Useful if you need continuity over time for all your users (for example | ||
332 | 228 | * when this app is the gateway to a forum or chatroom or other 3rd party with a | ||
333 | 229 | * login requirement). | ||
334 | 230 | * | ||
335 | 231 | * @global bool $lock_id_and_nick | ||
336 | 232 | */ | ||
337 | 233 | $lock_id_and_nick = false; | ||
338 | 234 | |||
339 | 235 | /** | ||
340 | 189 | * Minimum Comment Interval | 236 | * Minimum Comment Interval |
341 | 190 | * | 237 | * |
342 | 191 | * This is the minimum interval in seconds between consecutive comments from the | 238 | * This is the minimum interval in seconds between consecutive comments from the |
343 | 192 | * same IP. Increasing this can slow down spam attacks, and piss off real visitors | 239 | * same IP. Increasing this can slow down spam attacks, and piss off real visitors |
344 | 193 | * if too high. | 240 | * if too high. |
345 | 241 | * | ||
346 | 242 | * @global integer $minimum_comment_interval | ||
347 | 194 | */ | 243 | */ |
348 | 195 | $minimum_comment_interval = 30; | 244 | $minimum_comment_interval = 30; |
349 | 196 | 245 | ||
350 | @@ -202,6 +251,8 @@ | |||
351 | 202 | * | 251 | * |
352 | 203 | * This is legacy code that needs to be reverse-engineered, completely figured out, | 252 | * This is legacy code that needs to be reverse-engineered, completely figured out, |
353 | 204 | * and either fixed or killed. As-is this is crap - EdB. | 253 | * and either fixed or killed. As-is this is crap - EdB. |
354 | 254 | * | ||
355 | 255 | * @global array $posttypes_locked_IDs | ||
356 | 205 | */ | 256 | */ |
357 | 206 | $posttypes_locked_IDs = array( 1000, 1500, 1520, 1530, 1570, 2000 ); | 257 | $posttypes_locked_IDs = array( 1000, 1500, 1520, 1530, 1570, 2000 ); |
358 | 207 | 258 | ||
359 | @@ -214,6 +265,8 @@ | |||
360 | 214 | * | 265 | * |
361 | 215 | * This is legacy code that needs to be reverse-engineered, completely figured out, | 266 | * This is legacy code that needs to be reverse-engineered, completely figured out, |
362 | 216 | * and either fixed or killed. As-is this is crap - EdB. | 267 | * and either fixed or killed. As-is this is crap - EdB. |
363 | 268 | * | ||
364 | 269 | * @global array $posttypes_reserved_IDs | ||
365 | 217 | */ | 270 | */ |
366 | 218 | $posttypes_reserved_IDs = array( 3000, 4000, 5000 ); | 271 | $posttypes_reserved_IDs = array( 3000, 4000, 5000 ); |
367 | 219 | 272 | ||
368 | @@ -225,6 +278,8 @@ | |||
369 | 225 | * and getfile.php will check the User permisssion to view files. HOWEVER this will | 278 | * and getfile.php will check the User permisssion to view files. HOWEVER this will |
370 | 226 | * not prevent users from hitting directly into the media folder with their web | 279 | * not prevent users from hitting directly into the media folder with their web |
371 | 227 | * browser. You still need to restrict access to the media folder from your webserver. | 280 | * browser. You still need to restrict access to the media folder from your webserver. |
372 | 281 | * | ||
373 | 282 | * @global bool $public_access_to_media | ||
374 | 228 | */ | 283 | */ |
375 | 229 | $public_access_to_media = true; | 284 | $public_access_to_media = true; |
376 | 230 | 285 | ||
377 | @@ -234,6 +289,8 @@ | |||
378 | 234 | * Default of 1 means a comment can not be left without the commenter providing | 289 | * Default of 1 means a comment can not be left without the commenter providing |
379 | 235 | * a name and email address. Set this to 0 to allow anonymous comments (without | 290 | * a name and email address. Set this to 0 to allow anonymous comments (without |
380 | 236 | * name & email address). | 291 | * name & email address). |
381 | 292 | * | ||
382 | 293 | * @global bool $require_name_email | ||
383 | 237 | */ | 294 | */ |
384 | 238 | $require_name_email = 1; | 295 | $require_name_email = 1; |
385 | 239 | 296 | ||
386 | @@ -242,6 +299,8 @@ | |||
387 | 242 | * | 299 | * |
388 | 243 | * Admins can configure max file upload size, but they won't be able to set it higher | 300 | * Admins can configure max file upload size, but they won't be able to set it higher |
389 | 244 | * than this "max max" value. | 301 | * than this "max max" value. |
390 | 302 | * | ||
391 | 303 | * @global integer $upload_maxmaxkb | ||
392 | 245 | */ | 304 | */ |
393 | 246 | $upload_maxmaxkb = 10000; | 305 | $upload_maxmaxkb = 10000; |
394 | 247 | 306 | ||
395 | @@ -263,6 +322,8 @@ | |||
396 | 263 | * tag URL "marker", you won't be able to access either the post or the tag page, | 322 | * tag URL "marker", you won't be able to access either the post or the tag page, |
397 | 264 | * depending on the value of this setting. And no, that doesn't make sense to me | 323 | * depending on the value of this setting. And no, that doesn't make sense to me |
398 | 265 | * either :/ | 324 | * either :/ |
399 | 325 | * | ||
400 | 326 | * @global bool $tags_dash_fix | ||
401 | 266 | */ | 327 | */ |
402 | 267 | $tags_dash_fix = 0; | 328 | $tags_dash_fix = 0; |
403 | 268 | 329 | ||
404 | @@ -270,6 +331,8 @@ | |||
405 | 270 | * XHTML use Strict | 331 | * XHTML use Strict |
406 | 271 | * | 332 | * |
407 | 272 | * Set this to true if you want to enforce XHTML strict validation | 333 | * Set this to true if you want to enforce XHTML strict validation |
408 | 334 | * | ||
409 | 335 | * @global bool $xhtml_use_strict | ||
410 | 273 | */ | 336 | */ |
411 | 274 | $xhtml_use_strict = false; | 337 | $xhtml_use_strict = false; |
412 | 275 | 338 | ||
413 | @@ -277,6 +340,8 @@ | |||
414 | 277 | * XHTML validate comments | 340 | * XHTML validate comments |
415 | 278 | * | 341 | * |
416 | 279 | * Do we want to use XHTML validation for comments? | 342 | * Do we want to use XHTML validation for comments? |
417 | 343 | * | ||
418 | 344 | * @global bool $xhtml_validate_comments | ||
419 | 280 | */ | 345 | */ |
420 | 281 | $xhtml_validate_comments = true; | 346 | $xhtml_validate_comments = true; |
421 | 282 | 347 | ||
422 | 283 | 348 | ||
423 | === modified file 'qp_inc/_application.php' | |||
424 | --- qp_inc/_application.php 2013-03-22 21:28:25 +0000 | |||
425 | +++ qp_inc/_application.php 2013-04-18 18:37:26 +0000 | |||
426 | @@ -19,16 +19,16 @@ | |||
427 | 19 | $app_homepage = 'http://quamplures.net/'; | 19 | $app_homepage = 'http://quamplures.net/'; |
428 | 20 | 20 | ||
429 | 21 | // The fileset version: incremented at whatever rate feels good :) | 21 | // The fileset version: incremented at whatever rate feels good :) |
431 | 22 | $files_version = '1.20'; | 22 | $files_version = '1.50'; |
432 | 23 | 23 | ||
433 | 24 | // The database version, incrememented by 1 with each change in upgrade_dbase_tables() | 24 | // The database version, incrememented by 1 with each change in upgrade_dbase_tables() |
435 | 25 | $app_db_version = 43; | 25 | $app_db_version = 70; |
436 | 26 | 26 | ||
437 | 27 | // This way the version tells us the files and the database :) | 27 | // This way the version tells us the files and the database :) |
438 | 28 | $app_version = $files_version.'.'.$app_db_version; | 28 | $app_version = $files_version.'.'.$app_db_version; |
439 | 29 | 29 | ||
440 | 30 | // The application's release date (ISO) for major (quarterly) releases | 30 | // The application's release date (ISO) for major (quarterly) releases |
442 | 31 | $app_date = '2013-03-21'; | 31 | $app_date = '2013-04-18'; |
443 | 32 | 32 | ||
444 | 33 | // Displayed on the login screen | 33 | // Displayed on the login screen |
445 | 34 | $app_banner = '<a href="'.$app_homepage.'"><img src="'.$rsc_url.'logo.jpg" width="337" height="76" alt="'.$app_name.'" /></a>'; | 34 | $app_banner = '<a href="'.$app_homepage.'"><img src="'.$rsc_url.'logo.jpg" width="337" height="76" alt="'.$app_name.'" /></a>'; |
446 | 35 | 35 | ||
447 | === modified file 'qp_inc/_core/__core.init.php' | |||
448 | --- qp_inc/_core/__core.init.php 2013-03-22 21:28:25 +0000 | |||
449 | +++ qp_inc/_core/__core.init.php 2013-04-18 18:37:26 +0000 | |||
450 | @@ -29,64 +29,42 @@ | |||
451 | 29 | $app_db_config['aliases'] = array( | 29 | $app_db_config['aliases'] = array( |
452 | 30 | 'T_antispam' => $app_db_tableprefix.'antispam', | 30 | 'T_antispam' => $app_db_tableprefix.'antispam', |
453 | 31 | 'T_blogs' => $app_db_tableprefix.'blogs', | 31 | 'T_blogs' => $app_db_tableprefix.'blogs', |
457 | 32 | 'T_blog_groups' => $app_db_tableprefix.'bloggroups', | 32 | 'T_blog_groups' => $app_db_tableprefix.'blog_groups', |
458 | 33 | 'T_blog_settings' => $app_db_tableprefix.'coll_settings', | 33 | 'T_blog_settings' => $app_db_tableprefix.'blog_settings', |
459 | 34 | 'T_blog_users' => $app_db_tableprefix.'blogusers', | 34 | 'T_blog_users' => $app_db_tableprefix.'blog_users', |
460 | 35 | 'T_categories' => $app_db_tableprefix.'categories', | 35 | 'T_categories' => $app_db_tableprefix.'categories', |
461 | 36 | 'T_collections' => $app_db_tableprefix.'collections', | 36 | 'T_collections' => $app_db_tableprefix.'collections', |
462 | 37 | 'T_comments' => $app_db_tableprefix.'comments', | 37 | 'T_comments' => $app_db_tableprefix.'comments', |
465 | 38 | 'T_cron_log' => $app_db_tableprefix.'cron__log', | 38 | 'T_cron_log' => $app_db_tableprefix.'cron_log', |
466 | 39 | 'T_cron_task' => $app_db_tableprefix.'cron__task', | 39 | 'T_cron_task' => $app_db_tableprefix.'cron_task', |
467 | 40 | 'T_files' => $app_db_tableprefix.'files', | 40 | 'T_files' => $app_db_tableprefix.'files', |
468 | 41 | 'T_filetypes' => $app_db_tableprefix.'filetypes', | 41 | 'T_filetypes' => $app_db_tableprefix.'filetypes', |
469 | 42 | 'T_groups' => $app_db_tableprefix.'groups', | 42 | 'T_groups' => $app_db_tableprefix.'groups', |
472 | 43 | 'T_items' => $app_db_tableprefix.'items__item', | 43 | 'T_items' => $app_db_tableprefix.'items', |
473 | 44 | 'T_item_cats' => $app_db_tableprefix.'postcats', | 44 | 'T_item_cats' => $app_db_tableprefix.'item_cats', |
474 | 45 | 'T_item_colls' => $app_db_tableprefix.'item_colls', | 45 | 'T_item_colls' => $app_db_tableprefix.'item_colls', |
480 | 46 | 'T_item_prerendering' => $app_db_tableprefix.'items__prerendering', | 46 | 'T_item_prerendering' => $app_db_tableprefix.'item_prerendering', |
481 | 47 | 'T_item_status' => $app_db_tableprefix.'items__status', | 47 | 'T_item_status' => $app_db_tableprefix.'item_status', |
482 | 48 | 'T_item_tags' => $app_db_tableprefix.'items__itemtag', | 48 | 'T_item_tags' => $app_db_tableprefix.'item_tags', |
483 | 49 | 'T_item_types' => $app_db_tableprefix.'items__type', | 49 | 'T_item_types' => $app_db_tableprefix.'item_types', |
484 | 50 | 'T_item_versions' => $app_db_tableprefix.'items__version', | 50 | 'T_item_versions' => $app_db_tableprefix.'item_versions', |
485 | 51 | 'T_links' => $app_db_tableprefix.'links', | 51 | 'T_links' => $app_db_tableprefix.'links', |
486 | 52 | 'T_locales' => $app_db_tableprefix.'locales', | 52 | 'T_locales' => $app_db_tableprefix.'locales', |
487 | 53 | 'T_plugins' => $app_db_tableprefix.'plugins', | 53 | 'T_plugins' => $app_db_tableprefix.'plugins', |
491 | 54 | 'T_plugin_events' => $app_db_tableprefix.'pluginevents', | 54 | 'T_plugin_events' => $app_db_tableprefix.'plugin_events', |
492 | 55 | 'T_plugin_settings' => $app_db_tableprefix.'pluginsettings', | 55 | 'T_plugin_settings' => $app_db_tableprefix.'plugin_settings', |
493 | 56 | 'T_plugin_usersettings' => $app_db_tableprefix.'pluginusersettings', | 56 | 'T_plugin_usersettings' => $app_db_tableprefix.'plugin_usersettings', |
494 | 57 | 'T_settings' => $app_db_tableprefix.'settings', | 57 | 'T_settings' => $app_db_tableprefix.'settings', |
495 | 58 | 'T_subscriptions' => $app_db_tableprefix.'subscriptions', | 58 | 'T_subscriptions' => $app_db_tableprefix.'subscriptions', |
499 | 59 | 'T_tags' => $app_db_tableprefix.'items__tag', | 59 | 'T_tags' => $app_db_tableprefix.'tags', |
500 | 60 | 'T_templates' => $app_db_tableprefix.'templates__template', | 60 | 'T_templates' => $app_db_tableprefix.'templates', |
501 | 61 | 'T_template_containers' => $app_db_tableprefix.'templates__container', | 61 | 'T_template_containers' => $app_db_tableprefix.'template_containers', |
502 | 62 | 'T_users' => $app_db_tableprefix.'users', | 62 | 'T_users' => $app_db_tableprefix.'users', |
503 | 63 | 'T_user_cyberspace' => $app_db_tableprefix.'user_cyberspace', | 63 | 'T_user_cyberspace' => $app_db_tableprefix.'user_cyberspace', |
504 | 64 | 'T_user_realworld' => $app_db_tableprefix.'user_realworld', | 64 | 'T_user_realworld' => $app_db_tableprefix.'user_realworld', |
530 | 65 | 'T_plugin_sharedfields' => $app_db_tableprefix.'plugin_sharedfields', | 65 | 'T_user_settings' => $app_db_tableprefix.'user_settings', |
531 | 66 | 'T_plugin_sharedvalues' => $app_db_tableprefix.'plugin_sharedvalues', | 66 | 'T_widgets' => $app_db_tableprefix.'widgets', |
532 | 67 | 'T_user_settings' => $app_db_tableprefix.'usersettings', | 67 | ); |
508 | 68 | 'T_widgets' => $app_db_tableprefix.'widget', | ||
509 | 69 | 'T_coll_group_perms' => $app_db_tableprefix.'bloggroups', // old, going away | ||
510 | 70 | 'T_coll_settings' => $app_db_tableprefix.'coll_settings', // old, going away | ||
511 | 71 | 'T_coll_user_perms' => $app_db_tableprefix.'blogusers', // old, going away | ||
512 | 72 | 'T_cron__log' => $app_db_tableprefix.'cron__log', // old, going away | ||
513 | 73 | 'T_cron__task' => $app_db_tableprefix.'cron__task', // old, going away | ||
514 | 74 | 'T_items__item' => $app_db_tableprefix.'items__item', // old, going away | ||
515 | 75 | 'T_postcats' => $app_db_tableprefix.'postcats', // old, going away | ||
516 | 76 | 'T_items__prerendering' => $app_db_tableprefix.'items__prerendering', // old, going away | ||
517 | 77 | 'T_items__status' => $app_db_tableprefix.'items__status', // old, going away | ||
518 | 78 | 'T_items__itemtag' => $app_db_tableprefix.'items__itemtag', // old, going away | ||
519 | 79 | 'T_items__type' => $app_db_tableprefix.'items__type', // old, going away | ||
520 | 80 | 'T_items__version' => $app_db_tableprefix.'items__version', // old, going away | ||
521 | 81 | 'T_pluginevents' => $app_db_tableprefix.'pluginevents', // old, going away | ||
522 | 82 | 'T_pluginsettings' => $app_db_tableprefix.'pluginsettings', // old, going away | ||
523 | 83 | 'T_pluginusersettings' => $app_db_tableprefix.'pluginusersettings', // old, going away | ||
524 | 84 | 'T_items__tag' => $app_db_tableprefix.'items__tag', // old, going away | ||
525 | 85 | 'T_templates__template' => $app_db_tableprefix.'templates__template', // old, going away | ||
526 | 86 | 'T_templates__container' => $app_db_tableprefix.'templates__container', // old, going away | ||
527 | 87 | 'T_usersettings' => $app_db_tableprefix.'usersettings', // old, going away | ||
528 | 88 | 'T_widget' => $app_db_tableprefix.'widget', // old, going away | ||
529 | 89 | ); | ||
533 | 90 | 68 | ||
534 | 91 | // Controller mappings | 69 | // Controller mappings |
535 | 92 | $ctrl_mappings = array( | 70 | $ctrl_mappings = array( |
536 | @@ -452,7 +430,7 @@ | |||
537 | 452 | // we have blog files | 430 | // we have blog files |
538 | 453 | $entries['file_manager']['entries']['fm_view_blog'] = array( | 431 | $entries['file_manager']['entries']['fm_view_blog'] = array( |
539 | 454 | 'text' => T_('View BLOG Files').'…', | 432 | 'text' => T_('View BLOG Files').'…', |
541 | 455 | 'href' => $admin_url.'?ctrl=files&root=collection_'.$blog_id, | 433 | 'href' => $admin_url.'?ctrl=files&root=blog_'.$blog_id, |
542 | 456 | ); | 434 | ); |
543 | 457 | if( empty( $Blog ) ) | 435 | if( empty( $Blog ) ) |
544 | 458 | { | 436 | { |
545 | @@ -498,7 +476,7 @@ | |||
546 | 498 | // we have blog files | 476 | // we have blog files |
547 | 499 | $entries['file_manager']['entries']['fm_add_blog'] = array( | 477 | $entries['file_manager']['entries']['fm_add_blog'] = array( |
548 | 500 | 'text' => T_('Upload BLOG Files').'…', | 478 | 'text' => T_('Upload BLOG Files').'…', |
550 | 501 | 'href' => $admin_url.'?ctrl=upload&root=collection_'.$blog_id, | 479 | 'href' => $admin_url.'?ctrl=upload&root=blog_'.$blog_id, |
551 | 502 | ); | 480 | ); |
552 | 503 | if( empty( $Blog ) ) | 481 | if( empty( $Blog ) ) |
553 | 504 | { | 482 | { |
554 | @@ -683,7 +661,7 @@ | |||
555 | 683 | // current user's profile | 661 | // current user's profile |
556 | 684 | $entries['userprefs']['entries']['userprof'] = array( | 662 | $entries['userprefs']['entries']['userprof'] = array( |
557 | 685 | 'text' => T_('Your Profile').'…', | 663 | 'text' => T_('Your Profile').'…', |
559 | 686 | 'href' => get_user_profile_url(), | 664 | 'href' => get_user_profile_url( $current_User->ID ), |
560 | 687 | ); | 665 | ); |
561 | 688 | 666 | ||
562 | 689 | if( $current_User->check_perm( 'users', 'edit' ) ) | 667 | if( $current_User->check_perm( 'users', 'edit' ) ) |
563 | @@ -765,13 +743,12 @@ | |||
564 | 765 | ), | 743 | ), |
565 | 766 | ); | 744 | ); |
566 | 767 | 745 | ||
567 | 768 | |||
568 | 769 | if( ! $current_User->check_perm( 'admin', 'visible' ) ) | 746 | if( ! $current_User->check_perm( 'admin', 'visible' ) ) |
569 | 770 | { | 747 | { |
570 | 771 | // user can not access admin, replace admin link with profile link | 748 | // user can not access admin, replace admin link with profile link |
571 | 772 | $entries['abswitch']['text'] = '<strong>'.$current_User->login.'</strong>'; | 749 | $entries['abswitch']['text'] = '<strong>'.$current_User->login.'</strong>'; |
572 | 773 | $entries['abswitch']['title'] = T_('Edit your user profile'); | 750 | $entries['abswitch']['title'] = T_('Edit your user profile'); |
574 | 774 | $entries['abswitch']['href'] = get_user_profile_url(); | 751 | $entries['abswitch']['href'] = get_user_profile_url( $current_User->ID ); |
575 | 775 | $entries['abswitch']['class'] = ''; | 752 | $entries['abswitch']['class'] = ''; |
576 | 776 | 753 | ||
577 | 777 | if( $subs_url = get_user_subs_url() ) | 754 | if( $subs_url = get_user_subs_url() ) |
578 | 778 | 755 | ||
579 | === modified file 'qp_inc/_core/_param.funcs.php' | |||
580 | --- qp_inc/_core/_param.funcs.php 2013-03-23 18:54:25 +0000 | |||
581 | +++ qp_inc/_core/_param.funcs.php 2013-04-18 18:37:26 +0000 | |||
582 | @@ -387,6 +387,10 @@ | |||
583 | 387 | */ | 387 | */ |
584 | 388 | function param_check_number( $var, $err_msg, $required = false ) | 388 | function param_check_number( $var, $err_msg, $required = false ) |
585 | 389 | { | 389 | { |
586 | 390 | // first get the param even as a string to avoid red-death errors | ||
587 | 391 | param( $var, 'string', $required ? true : '' ); | ||
588 | 392 | |||
589 | 393 | // if it is empty and that's okay then we're done? wait it might be a string ... which might be okay anyway | ||
590 | 390 | if( empty( $GLOBALS[$var] ) && ! $required ) | 394 | if( empty( $GLOBALS[$var] ) && ! $required ) |
591 | 391 | { | 395 | { |
592 | 392 | // empty is OK | 396 | // empty is OK |
593 | @@ -395,6 +399,7 @@ | |||
594 | 395 | 399 | ||
595 | 396 | if( ! preg_match( '#^[0-9]+$#', $GLOBALS[$var] ) ) | 400 | if( ! preg_match( '#^[0-9]+$#', $GLOBALS[$var] ) ) |
596 | 397 | { | 401 | { |
597 | 402 | // forget_param( 'link_ID' ); | ||
598 | 398 | param_error( $var, $err_msg ); | 403 | param_error( $var, $err_msg ); |
599 | 399 | return false; | 404 | return false; |
600 | 400 | } | 405 | } |
601 | 401 | 406 | ||
602 | === modified file 'qp_inc/_core/model/__core.install.php' | |||
603 | --- qp_inc/_core/model/__core.install.php 2013-03-22 21:28:25 +0000 | |||
604 | +++ qp_inc/_core/model/__core.install.php 2013-04-18 18:37:26 +0000 | |||
605 | @@ -55,7 +55,7 @@ | |||
606 | 55 | blog_tagline VARCHAR(250) NULL default '', | 55 | blog_tagline VARCHAR(250) NULL default '', |
607 | 56 | blog_description VARCHAR(250) NULL default '', | 56 | blog_description VARCHAR(250) NULL default '', |
608 | 57 | blog_longdesc TEXT NULL DEFAULT NULL, | 57 | blog_longdesc TEXT NULL DEFAULT NULL, |
610 | 58 | blog_locale VARCHAR(20) NOT NULL DEFAULT 'en-EU', | 58 | blog_locale VARCHAR(20) NOT NULL DEFAULT 'en-US', |
611 | 59 | blog_access_type VARCHAR(10) NOT NULL DEFAULT 'index.php', | 59 | blog_access_type VARCHAR(10) NOT NULL DEFAULT 'index.php', |
612 | 60 | blog_siteurl VARCHAR(120) NOT NULL default '', | 60 | blog_siteurl VARCHAR(120) NOT NULL default '', |
613 | 61 | blog_urlname VARCHAR(255) NOT NULL DEFAULT 'urlname', | 61 | blog_urlname VARCHAR(255) NOT NULL DEFAULT 'urlname', |
614 | @@ -202,7 +202,7 @@ | |||
615 | 202 | 'T_files' => array( 'Creating files table', | 202 | 'T_files' => array( 'Creating files table', |
616 | 203 | "CREATE TABLE T_files ( | 203 | "CREATE TABLE T_files ( |
617 | 204 | file_ID INT(11) unsigned not null AUTO_INCREMENT, | 204 | file_ID INT(11) unsigned not null AUTO_INCREMENT, |
619 | 205 | file_root_type ENUM('absolute','user','collection','shared','templates') not null default 'absolute', | 205 | file_root_type ENUM('absolute','user','blog','shared','templates') not null default 'absolute', |
620 | 206 | file_root_ID INT(11) unsigned not null default 0, | 206 | file_root_ID INT(11) unsigned not null default 0, |
621 | 207 | file_path VARCHAR(255) not null default '', | 207 | file_path VARCHAR(255) not null default '', |
622 | 208 | file_title VARCHAR(255), | 208 | file_title VARCHAR(255), |
623 | @@ -565,36 +565,6 @@ | |||
624 | 565 | UNIQUE wi_order( wi_widget_blog_ID, wi_sco_name, wi_order ) | 565 | UNIQUE wi_order( wi_widget_blog_ID, wi_sco_name, wi_order ) |
625 | 566 | ) ENGINE = innodb DEFAULT CHARSET = $db_storage_charset" ), | 566 | ) ENGINE = innodb DEFAULT CHARSET = $db_storage_charset" ), |
626 | 567 | 567 | ||
627 | 568 | /** | ||
628 | 569 | * This table holds info about fields a plugin might want to access and | ||
629 | 570 | * use. The only time it gets called is on a plugin's settings page | ||
630 | 571 | * for the various bits that make a plugin field be a plugin field | ||
631 | 572 | */ | ||
632 | 573 | 'T_plugin_sharedfields' => array( 'Creating table for User field definitions', | ||
633 | 574 | "CREATE TABLE T_plugin_sharedfields ( | ||
634 | 575 | psf_fieldname VARCHAR(16) NOT NULL, | ||
635 | 576 | psf_label VARCHAR(255) NOT NULL, | ||
636 | 577 | psf_type VARCHAR(255) NOT NULL, -- probably only 'text', maybe 'checkbox', 'select' is crazy talk! | ||
637 | 578 | psf_note VARCHAR(255) NOT NULL, | ||
638 | 579 | psf_validate VARCHAR(255) NOT NULL, -- make sure a url is a url ... for example | ||
639 | 580 | PRIMARY KEY ( psf_fieldname ) | ||
640 | 581 | ) ENGINE = innodb DEFAULT CHARSET = $db_storage_charset" ), | ||
641 | 582 | |||
642 | 583 | /** | ||
643 | 584 | * This table holds user-specific info for any shared plugin field. When on a | ||
644 | 585 | * plugin's settings page it gets accessed to find then store info about a | ||
645 | 586 | * user. The plugin then stores the fact that some info about the user | ||
646 | 587 | * is stored in this table for the rest of QP to do it's thing with. | ||
647 | 588 | */ | ||
648 | 589 | 'T_plugin_sharedvalues' => array( 'Creating table for User fields', | ||
649 | 590 | "CREATE TABLE T_plugin_sharedvalues ( | ||
650 | 591 | psv_ID INT(10) unsigned NOT NULL auto_increment, | ||
651 | 592 | psv_user_ID INT(10) unsigned NOT NULL, | ||
652 | 593 | psv_psf_fieldname VARCHAR(32) NOT NULL, | ||
653 | 594 | psv_userfieldvalue VARCHAR(255) NOT NULL, | ||
654 | 595 | PRIMARY KEY ( psv_ID ) | ||
655 | 596 | ) ENGINE = innodb DEFAULT CHARSET = $db_storage_charset" ), | ||
656 | 597 | |||
657 | 598 | ); | 568 | ); |
658 | 599 | 569 | ||
659 | 600 | ?> | 570 | ?> |
660 | 601 | 571 | ||
661 | === modified file 'qp_inc/_core/ui/results/_results.class.php' | |||
662 | --- qp_inc/_core/ui/results/_results.class.php 2013-03-22 21:28:25 +0000 | |||
663 | +++ qp_inc/_core/ui/results/_results.class.php 2013-04-18 18:37:26 +0000 | |||
664 | @@ -92,9 +92,13 @@ | |||
665 | 92 | */ | 92 | */ |
666 | 93 | var $current_Obj; | 93 | var $current_Obj; |
667 | 94 | /** | 94 | /** |
669 | 95 | * Definitions for each column: | 95 | * Definitions for each column |
670 | 96 | * | ||
671 | 97 | * Possible definitions for each column are: | ||
672 | 96 | * - th | 98 | * - th |
673 | 99 | * - th_class | ||
674 | 97 | * - td | 100 | * - td |
675 | 101 | * - td_class | ||
676 | 98 | * - order: SQL column name(s) to sort by (delimited by comma) | 102 | * - order: SQL column name(s) to sort by (delimited by comma) |
677 | 99 | * - order_objects_callback: a PHP callback function (can be array( $Object, $method )). | 103 | * - order_objects_callback: a PHP callback function (can be array( $Object, $method )). |
678 | 100 | * This gets three params: $a, $b, $desc. $a and $b are instantiated objects | 104 | * This gets three params: $a, $b, $desc. $a and $b are instantiated objects |
679 | @@ -104,8 +108,7 @@ | |||
680 | 104 | * This gets three params: $a, $b, $desc. $a and $b are DB row objects, $desc | 108 | * This gets three params: $a, $b, $desc. $a and $b are DB row objects, $desc |
681 | 105 | * is either 'ASC' or 'DESC'. The function has to return -1, 0 or 1, according | 109 | * is either 'ASC' or 'DESC'. The function has to return -1, 0 or 1, according |
682 | 106 | * to if the $a < $b, $a == $b or $a > $b. | 110 | * to if the $a < $b, $a == $b or $a > $b. |
685 | 107 | * - td_class | 111 | * @var array something goes here |
684 | 108 | * @var foo | ||
686 | 109 | */ | 112 | */ |
687 | 110 | var $cols; | 113 | var $cols; |
688 | 111 | /** | 114 | /** |
689 | @@ -191,11 +194,14 @@ | |||
690 | 191 | * Constructor | 194 | * Constructor |
691 | 192 | * | 195 | * |
692 | 193 | * @param string SQL query | 196 | * @param string SQL query |
695 | 194 | * @param string prefix to differentiate page/order params when multiple Results appear one same page | 197 | * @param string prefix to differentiate page/order params when multiple Results |
696 | 195 | * @param string default ordering of columns (special syntax) if not specified in the URL params | 198 | * appear one same page |
697 | 199 | * @param string default ordering of columns (special syntax) if not specified | ||
698 | 200 | * in the URL params | ||
699 | 196 | * - example: -A-- will sort in ascending order on 2nd column | 201 | * - example: -A-- will sort in ascending order on 2nd column |
700 | 197 | * - example: ---D will sort in descending order on 4th column | 202 | * - example: ---D will sort in descending order on 4th column |
702 | 198 | * @param integer number of lines displayed on one page (0 to disable paging; null to use $UserSettings/results_per_page) | 203 | * @param integer number of lines displayed on one page (0 to disable paging; |
703 | 204 | * null to use $UserSettings/results_per_page) | ||
704 | 199 | * @param string SQL to get the total count of results | 205 | * @param string SQL to get the total count of results |
705 | 200 | * @param boolean | 206 | * @param boolean |
706 | 201 | * @param string|integer SQL query used to count the total # of rows | 207 | * @param string|integer SQL query used to count the total # of rows |
707 | 202 | 208 | ||
708 | === modified file 'qp_inc/blogs/blogs.ctrl.php' | |||
709 | --- qp_inc/blogs/blogs.ctrl.php 2013-03-12 06:26:03 +0000 | |||
710 | +++ qp_inc/blogs/blogs.ctrl.php 2013-04-18 18:37:26 +0000 | |||
711 | @@ -86,7 +86,7 @@ | |||
712 | 86 | { | 86 | { |
713 | 87 | // okay good, continue | 87 | // okay good, continue |
714 | 88 | $file_imploded = implode( '', $file_loaded ); | 88 | $file_imploded = implode( '', $file_loaded ); |
716 | 89 | $stub_filename = 'blog'.$edited_Blog->urlname.'.php'; | 89 | $stub_filename = $edited_Blog->urlname.'.php'; |
717 | 90 | $new_file = $basepath.$stub_filename; | 90 | $new_file = $basepath.$stub_filename; |
718 | 91 | $f = @fopen( $new_file, 'w' ); | 91 | $f = @fopen( $new_file, 'w' ); |
719 | 92 | if( $f == false ) | 92 | if( $f == false ) |
720 | 93 | 93 | ||
721 | === modified file 'qp_inc/blogs/model/_blog.class.php' | |||
722 | --- qp_inc/blogs/model/_blog.class.php 2013-03-12 21:17:25 +0000 | |||
723 | +++ qp_inc/blogs/model/_blog.class.php 2013-04-18 18:37:26 +0000 | |||
724 | @@ -1089,7 +1089,7 @@ | |||
725 | 1089 | { | 1089 | { |
726 | 1090 | global $dispatcher; | 1090 | global $dispatcher; |
727 | 1091 | 1091 | ||
729 | 1092 | return $dispatcher.'?ctrl=files&root='.FileRoot::gen_ID( 'collection', $this->ID ); | 1092 | return $dispatcher.'?ctrl=files&root='.FileRoot::gen_ID( 'blog', $this->ID ); |
730 | 1093 | } | 1093 | } |
731 | 1094 | 1094 | ||
732 | 1095 | 1095 | ||
733 | @@ -1133,7 +1133,7 @@ | |||
734 | 1133 | 1133 | ||
735 | 1134 | if( ! $Settings->get( 'fm_enable_roots_blog' ) ) | 1134 | if( ! $Settings->get( 'fm_enable_roots_blog' ) ) |
736 | 1135 | { | 1135 | { |
738 | 1136 | // User directories are disabled | 1136 | // blog directories are disabled |
739 | 1137 | return false; | 1137 | return false; |
740 | 1138 | } | 1138 | } |
741 | 1139 | 1139 | ||
742 | @@ -1208,7 +1208,7 @@ | |||
743 | 1208 | 1208 | ||
744 | 1209 | if( ! $Settings->get( 'fm_enable_roots_blog' ) ) | 1209 | if( ! $Settings->get( 'fm_enable_roots_blog' ) ) |
745 | 1210 | { | 1210 | { |
747 | 1211 | // User directories are disabled | 1211 | // blog directories are disabled |
748 | 1212 | return false; | 1212 | return false; |
749 | 1213 | } | 1213 | } |
750 | 1214 | 1214 | ||
751 | 1215 | 1215 | ||
752 | === modified file 'qp_inc/files/file_settings.ctrl.php' | |||
753 | --- qp_inc/files/file_settings.ctrl.php 2013-03-22 21:28:25 +0000 | |||
754 | +++ qp_inc/files/file_settings.ctrl.php 2013-04-18 18:37:26 +0000 | |||
755 | @@ -29,9 +29,17 @@ | |||
756 | 29 | { | 29 | { |
757 | 30 | $Settings->delete_array( array( | 30 | $Settings->delete_array( array( |
758 | 31 | 'fm_enable_roots_blog', | 31 | 'fm_enable_roots_blog', |
759 | 32 | 'fm_blog_limit_files', | ||
760 | 33 | 'fm_blog_limit_bytes', | ||
761 | 32 | 'fm_enable_roots_user', | 34 | 'fm_enable_roots_user', |
762 | 35 | 'fm_user_limit_files', | ||
763 | 36 | 'fm_user_limit_bytes', | ||
764 | 33 | 'fm_enable_roots_shared', | 37 | 'fm_enable_roots_shared', |
765 | 38 | 'fm_shared_limit_files', | ||
766 | 39 | 'fm_shared_limit_bytes', | ||
767 | 34 | 'fm_enable_roots_templates', | 40 | 'fm_enable_roots_templates', |
768 | 41 | 'fm_templates_limit_files', | ||
769 | 42 | 'fm_templates_limit_bytes', | ||
770 | 35 | 'fm_enable_create_dir', | 43 | 'fm_enable_create_dir', |
771 | 36 | 'fm_default_chmod_dir', | 44 | 'fm_default_chmod_dir', |
772 | 37 | 'fm_enable_create_file', | 45 | 'fm_enable_create_file', |
773 | @@ -51,18 +59,48 @@ | |||
774 | 51 | } | 59 | } |
775 | 52 | else | 60 | else |
776 | 53 | { | 61 | { |
778 | 54 | // Filemanager settings | 62 | // "Accessible file roots" settings |
779 | 63 | // ... blog folders | ||
780 | 55 | param( 'fm_enable_roots_blog', 'integer', 0 ); | 64 | param( 'fm_enable_roots_blog', 'integer', 0 ); |
781 | 56 | $Settings->set( 'fm_enable_roots_blog', $fm_enable_roots_blog ); | 65 | $Settings->set( 'fm_enable_roots_blog', $fm_enable_roots_blog ); |
782 | 66 | param_check_number( 'fm_blog_limit_files', sprintf( T_('"%s file limit" must be numbers only'), 'blog' ) ); | ||
783 | 67 | $Settings->set( 'fm_blog_limit_files', $fm_blog_limit_files ); | ||
784 | 68 | param_check_number( 'fm_blog_limit_bytes', sprintf( T_('"%s dir size" must be numbers only'), 'blog' ) ); | ||
785 | 69 | $Settings->set( 'fm_blog_limit_bytes', $fm_blog_limit_bytes ); | ||
786 | 70 | // ... user folders | ||
787 | 57 | param( 'fm_enable_roots_user', 'integer', 0 ); | 71 | param( 'fm_enable_roots_user', 'integer', 0 ); |
788 | 58 | $Settings->set( 'fm_enable_roots_user', $fm_enable_roots_user ); | 72 | $Settings->set( 'fm_enable_roots_user', $fm_enable_roots_user ); |
789 | 73 | param_check_number( 'fm_user_limit_files', sprintf( T_('"%s file limit" must be numbers only'), 'user' ) ); | ||
790 | 74 | $Settings->set( 'fm_user_limit_files', $fm_user_limit_files ); | ||
791 | 75 | param_check_number( 'fm_user_limit_bytes', sprintf( T_('"%s dir size" must be numbers only'), 'user' ) ); | ||
792 | 76 | $Settings->set( 'fm_user_limit_bytes', $fm_user_limit_bytes ); | ||
793 | 77 | // ... shared folders | ||
794 | 59 | param( 'fm_enable_roots_shared', 'integer', 0 ); | 78 | param( 'fm_enable_roots_shared', 'integer', 0 ); |
795 | 60 | $Settings->set( 'fm_enable_roots_shared', $fm_enable_roots_shared ); | 79 | $Settings->set( 'fm_enable_roots_shared', $fm_enable_roots_shared ); |
796 | 80 | param_check_number( 'fm_shared_limit_files', sprintf( T_('"%s file limit" must be numbers only'), 'shared' ) ); | ||
797 | 81 | $Settings->set( 'fm_shared_limit_files', $fm_shared_limit_files ); | ||
798 | 82 | param_check_number( 'fm_shared_limit_bytes', sprintf( T_('"%s dir size" must be numbers only'), 'shared' ) ); | ||
799 | 83 | $Settings->set( 'fm_shared_limit_bytes', $fm_shared_limit_bytes ); | ||
800 | 84 | // ... template folders | ||
801 | 61 | param( 'fm_enable_roots_templates', 'integer', 0 ); | 85 | param( 'fm_enable_roots_templates', 'integer', 0 ); |
802 | 62 | $Settings->set( 'fm_enable_roots_templates', $fm_enable_roots_templates ); | 86 | $Settings->set( 'fm_enable_roots_templates', $fm_enable_roots_templates ); |
803 | 87 | param_check_number( 'fm_templates_limit_files', sprintf( T_('"%s file limit" must be numbers only'), 'template' ) ); | ||
804 | 88 | $Settings->set( 'fm_templates_limit_files', $fm_templates_limit_files ); | ||
805 | 89 | param_check_number( 'fm_templates_limit_bytes', sprintf( T_('"%s dir size" must be numbers only'), 'template' ) ); | ||
806 | 90 | $Settings->set( 'fm_templates_limit_bytes', $fm_templates_limit_bytes ); | ||
807 | 91 | |||
808 | 92 | // "File creation options" settings | ||
809 | 63 | param( 'fm_enable_create_dir', 'integer', 0 ); | 93 | param( 'fm_enable_create_dir', 'integer', 0 ); |
810 | 64 | $Settings->set( 'fm_enable_create_dir', $fm_enable_create_dir ); | 94 | $Settings->set( 'fm_enable_create_dir', $fm_enable_create_dir ); |
812 | 65 | // Default dir CHMOD | 95 | param( 'fm_enable_create_file', 'integer', 0 ); |
813 | 96 | $Settings->set( 'fm_enable_create_file', $fm_enable_create_file ); | ||
814 | 97 | param( 'upload_enabled', 'integer', 0 ); | ||
815 | 98 | $Settings->set( 'upload_enabled', $upload_enabled ); | ||
816 | 99 | param_integer_range( 'upload_maxkb', 1, $upload_maxmaxkb, T_('Maximum allowed filesize must be between %d and %d KB.') ); | ||
817 | 100 | $Settings->set( 'upload_maxkb', $upload_maxkb ); // upload limit | ||
818 | 101 | |||
819 | 102 | // "File creation options" settings | ||
820 | 103 | // ... default dir CHMOD | ||
821 | 66 | if( param( 'fm_default_chmod_dir', 'string', NULL ) !== NULL ) | 104 | if( param( 'fm_default_chmod_dir', 'string', NULL ) !== NULL ) |
822 | 67 | { | 105 | { |
823 | 68 | if( ! preg_match('~^[0-7]{3}$~', $fm_default_chmod_dir) ) | 106 | if( ! preg_match('~^[0-7]{3}$~', $fm_default_chmod_dir) ) |
824 | @@ -71,9 +109,7 @@ | |||
825 | 71 | } | 109 | } |
826 | 72 | $Settings->set( 'fm_default_chmod_dir', $fm_default_chmod_dir ); | 110 | $Settings->set( 'fm_default_chmod_dir', $fm_default_chmod_dir ); |
827 | 73 | } | 111 | } |
831 | 74 | param( 'fm_enable_create_file', 'integer', 0 ); | 112 | // ... default files CHMOD |
829 | 75 | $Settings->set( 'fm_enable_create_file', $fm_enable_create_file ); | ||
830 | 76 | // Default files CHMOD | ||
832 | 77 | if( param( 'fm_default_chmod_file', 'string', NULL ) !== NULL ) | 113 | if( param( 'fm_default_chmod_file', 'string', NULL ) !== NULL ) |
833 | 78 | { | 114 | { |
834 | 79 | if( ! preg_match('~^[0-7]{3}$~', $fm_default_chmod_file) ) | 115 | if( ! preg_match('~^[0-7]{3}$~', $fm_default_chmod_file) ) |
835 | @@ -82,23 +118,19 @@ | |||
836 | 82 | } | 118 | } |
837 | 83 | $Settings->set( 'fm_default_chmod_file', $fm_default_chmod_file ); | 119 | $Settings->set( 'fm_default_chmod_file', $fm_default_chmod_file ); |
838 | 84 | } | 120 | } |
845 | 85 | // Upload | 121 | // ... valid folder and file name |
846 | 86 | param( 'upload_enabled', 'integer', 0 ); | 122 | param( 'regexp_dirname', 'string', '' ); |
847 | 87 | $Settings->set( 'upload_enabled', $upload_enabled ); | 123 | if( param_check_isregexp( 'regexp_dirname', T_('Valid dirname pattern is not a regular expression!') ) ) |
848 | 88 | param_integer_range( 'upload_maxkb', 1, $upload_maxmaxkb, T_('Maximum allowed filesize must be between %d and %d KB.') ); | 124 | { |
849 | 89 | $Settings->set( 'upload_maxkb', $upload_maxkb ); | 125 | $Settings->set( 'regexp_dirname', $regexp_dirname ); |
850 | 90 | // Advanced settings | 126 | } |
851 | 91 | param( 'regexp_filename', 'string', '' ); | 127 | param( 'regexp_filename', 'string', '' ); |
852 | 92 | if( param_check_isregexp( 'regexp_filename', T_('Valid filename pattern is not a regular expression!') ) ) | 128 | if( param_check_isregexp( 'regexp_filename', T_('Valid filename pattern is not a regular expression!') ) ) |
853 | 93 | { | 129 | { |
854 | 94 | $Settings->set( 'regexp_filename', $regexp_filename ); | 130 | $Settings->set( 'regexp_filename', $regexp_filename ); |
855 | 95 | } | 131 | } |
856 | 96 | param( 'regexp_dirname', 'string', '' ); | ||
857 | 97 | if( param_check_isregexp( 'regexp_dirname', T_('Valid dirname pattern is not a regular expression!') ) ) | ||
858 | 98 | { | ||
859 | 99 | $Settings->set( 'regexp_dirname', $regexp_dirname ); | ||
860 | 100 | } | ||
861 | 101 | 132 | ||
862 | 133 | // wrap it up, ship it out | ||
863 | 102 | if( ! $Messages->count('error') ) | 134 | if( ! $Messages->count('error') ) |
864 | 103 | { | 135 | { |
865 | 104 | if( $Settings->dbupdate() ) | 136 | if( $Settings->dbupdate() ) |
866 | 105 | 137 | ||
867 | === modified file 'qp_inc/files/files.ctrl.php' | |||
868 | --- qp_inc/files/files.ctrl.php 2013-03-22 21:28:25 +0000 | |||
869 | +++ qp_inc/files/files.ctrl.php 2013-04-18 18:37:26 +0000 | |||
870 | @@ -190,7 +190,7 @@ | |||
871 | 190 | if( empty( $fm_FileRoot ) && ! empty( $Blog ) ) | 190 | if( empty( $fm_FileRoot ) && ! empty( $Blog ) ) |
872 | 191 | { | 191 | { |
873 | 192 | // Still not set a root, try to get it for the current Blog | 192 | // Still not set a root, try to get it for the current Blog |
875 | 193 | $fm_FileRoot = & $FileRootCache->get_by_type_and_ID( 'collection', $Blog->ID ); | 193 | $fm_FileRoot = & $FileRootCache->get_by_type_and_ID( 'blog', $Blog->ID ); |
876 | 194 | if( ! $fm_FileRoot || ! isset( $available_Roots[$fm_FileRoot->ID] ) ) | 194 | if( ! $fm_FileRoot || ! isset( $available_Roots[$fm_FileRoot->ID] ) ) |
877 | 195 | { | 195 | { |
878 | 196 | // Root not found or not in list of available ones | 196 | // Root not found or not in list of available ones |
879 | @@ -775,7 +775,7 @@ | |||
880 | 775 | 775 | ||
881 | 776 | // fp> TODO: this block should move to a general level | 776 | // fp> TODO: this block should move to a general level |
882 | 777 | // Try to go to the right blog: | 777 | // Try to go to the right blog: |
884 | 778 | if( $fm_Filelist->get_root_type() == 'collection' ) | 778 | if( $fm_Filelist->get_root_type() == 'blog' ) |
885 | 779 | { | 779 | { |
886 | 780 | set_working_blog( $fm_Filelist->get_root_ID() ); | 780 | set_working_blog( $fm_Filelist->get_root_ID() ); |
887 | 781 | // Load the blog we're in | 781 | // Load the blog we're in |
888 | 782 | 782 | ||
889 | === modified file 'qp_inc/files/model/_file.class.php' | |||
890 | --- qp_inc/files/model/_file.class.php 2013-03-22 21:28:25 +0000 | |||
891 | +++ qp_inc/files/model/_file.class.php 2013-04-18 18:37:26 +0000 | |||
892 | @@ -1646,6 +1646,9 @@ | |||
893 | 1646 | 1646 | ||
894 | 1647 | /** | 1647 | /** |
895 | 1648 | * Generate the IMG THUMBNAIL tag with all the alt & title if available | 1648 | * Generate the IMG THUMBNAIL tag with all the alt & title if available |
896 | 1649 | * | ||
897 | 1650 | * @todo (3086) EdB> this needs to be params instead of ordered bits | ||
898 | 1651 | * @todo (3086) EdB> this really needs params/bits for setting alt and title | ||
899 | 1649 | */ | 1652 | */ |
900 | 1650 | function get_thumb_imgtag( $size_name = 'fit-80x80', $class = '', $align = '' ) | 1653 | function get_thumb_imgtag( $size_name = 'fit-80x80', $class = '', $align = '' ) |
901 | 1651 | { | 1654 | { |
902 | 1652 | 1655 | ||
903 | === modified file 'qp_inc/files/model/_file.funcs.php' | |||
904 | --- qp_inc/files/model/_file.funcs.php 2013-03-22 21:28:25 +0000 | |||
905 | +++ qp_inc/files/model/_file.funcs.php 2013-04-18 18:37:26 +0000 | |||
906 | @@ -151,6 +151,7 @@ | |||
907 | 151 | * | 151 | * |
908 | 152 | * This checks if there's a _adminUI.class.php in there. | 152 | * This checks if there's a _adminUI.class.php in there. |
909 | 153 | * | 153 | * |
910 | 154 | * @todo (3086) EdB> this is ignoring the setting for default admin template :( | ||
911 | 154 | * @return array List of directory names that hold admin templates or false, if | 155 | * @return array List of directory names that hold admin templates or false, if |
912 | 155 | * the admin templates directory does not exist. | 156 | * the admin templates directory does not exist. |
913 | 156 | */ | 157 | */ |
914 | @@ -181,14 +182,14 @@ | |||
915 | 181 | } | 182 | } |
916 | 182 | // lets alphabetize them | 183 | // lets alphabetize them |
917 | 183 | sort( $r ); | 184 | sort( $r ); |
920 | 184 | // if we have "wind" put it first so we default to that | 185 | // if we have "earth" put it first so we default to that |
921 | 185 | if( in_array( 'wind', $r ) ) | 186 | if( in_array( 'earth', $r ) ) |
922 | 186 | { | 187 | { |
923 | 187 | $r_clone = array(); | 188 | $r_clone = array(); |
925 | 188 | $r_clone[] = 'wind'; | 189 | $r_clone[] = 'earth'; |
926 | 189 | foreach( $r as $v ) | 190 | foreach( $r as $v ) |
927 | 190 | { | 191 | { |
929 | 191 | if( $v != 'wind' ) | 192 | if( $v != 'earth' ) |
930 | 192 | { | 193 | { |
931 | 193 | $r_clone[] = $v; | 194 | $r_clone[] = $v; |
932 | 194 | } | 195 | } |
933 | 195 | 196 | ||
934 | === modified file 'qp_inc/files/model/_filelist.class.php' | |||
935 | --- qp_inc/files/model/_filelist.class.php 2013-03-18 19:20:42 +0000 | |||
936 | +++ qp_inc/files/model/_filelist.class.php 2013-04-18 18:37:26 +0000 | |||
937 | @@ -1166,9 +1166,12 @@ | |||
938 | 1166 | 1166 | ||
939 | 1167 | 1167 | ||
940 | 1168 | /** | 1168 | /** |
941 | 1169 | * Get Current Working Directory | ||
942 | 1170 | * | ||
943 | 1169 | * Returns cwd, where the accessible directories (below root) are clickable | 1171 | * Returns cwd, where the accessible directories (below root) are clickable |
944 | 1170 | * | 1172 | * |
946 | 1171 | * @return string cwd as clickable html | 1173 | * @param boolean true hides most of the dir path, leaving only the "clickable" part |
947 | 1174 | * @return string current working directory (cwd) as clickable html | ||
948 | 1172 | */ | 1175 | */ |
949 | 1173 | function get_cwd_clickable( $clickableOnly = true ) | 1176 | function get_cwd_clickable( $clickableOnly = true ) |
950 | 1174 | { | 1177 | { |
951 | @@ -1177,7 +1180,7 @@ | |||
952 | 1177 | return ' -- '.T_('No directory.').' -- '; | 1180 | return ' -- '.T_('No directory.').' -- '; |
953 | 1178 | } | 1181 | } |
954 | 1179 | 1182 | ||
956 | 1180 | // Get the part of the path which is not clickable: | 1183 | // Get the part of the path which is not clickable |
957 | 1181 | $r = substr( $this->_FileRoot->ads_path, 0, strrpos( substr( $this->_FileRoot->ads_path, 0, -1 ), '/' ) + 1 ); | 1184 | $r = substr( $this->_FileRoot->ads_path, 0, strrpos( substr( $this->_FileRoot->ads_path, 0, -1 ), '/' ) + 1 ); |
958 | 1182 | 1185 | ||
959 | 1183 | // get the part that is clickable | 1186 | // get the part that is clickable |
960 | 1184 | 1187 | ||
961 | === modified file 'qp_inc/files/model/_fileroot.class.php' | |||
962 | --- qp_inc/files/model/_fileroot.class.php 2013-03-22 21:28:25 +0000 | |||
963 | +++ qp_inc/files/model/_fileroot.class.php 2013-04-18 18:37:26 +0000 | |||
964 | @@ -89,7 +89,7 @@ | |||
965 | 89 | $this->ads_url = $User->get_media_url(); | 89 | $this->ads_url = $User->get_media_url(); |
966 | 90 | return; | 90 | return; |
967 | 91 | 91 | ||
969 | 92 | case 'collection': | 92 | case 'blog': |
970 | 93 | $BlogCache = & get_Cache( 'BlogCache' ); | 93 | $BlogCache = & get_Cache( 'BlogCache' ); |
971 | 94 | $Blog = & $BlogCache->get_by_ID( $root_in_type_ID ); | 94 | $Blog = & $BlogCache->get_by_ID( $root_in_type_ID ); |
972 | 95 | $this->name = $Blog->get( 'shortname' ); | 95 | $this->name = $Blog->get( 'shortname' ); |
973 | @@ -156,7 +156,7 @@ | |||
974 | 156 | case 'user': | 156 | case 'user': |
975 | 157 | return NT_('User roots'); | 157 | return NT_('User roots'); |
976 | 158 | 158 | ||
978 | 159 | case 'collection': | 159 | case 'blog': |
979 | 160 | return NT_('Blog roots'); | 160 | return NT_('Blog roots'); |
980 | 161 | 161 | ||
981 | 162 | default: | 162 | default: |
982 | @@ -172,8 +172,8 @@ | |||
983 | 172 | switch( $root_type ) | 172 | switch( $root_type ) |
984 | 173 | { | 173 | { |
985 | 174 | case 'user': | 174 | case 'user': |
986 | 175 | case 'blog': | ||
987 | 175 | case 'shared': | 176 | case 'shared': |
988 | 176 | case 'collection': | ||
989 | 177 | case 'templates': | 177 | case 'templates': |
990 | 178 | return $root_type.'_'.$root_in_type_ID; | 178 | return $root_type.'_'.$root_in_type_ID; |
991 | 179 | } | 179 | } |
992 | 180 | 180 | ||
993 | === modified file 'qp_inc/files/model/_filerootcache.class.php' | |||
994 | --- qp_inc/files/model/_filerootcache.class.php 2013-03-22 21:28:25 +0000 | |||
995 | +++ qp_inc/files/model/_filerootcache.class.php 2013-04-18 18:37:26 +0000 | |||
996 | @@ -53,7 +53,7 @@ | |||
997 | 53 | $bloglist = $BlogCache->load_user_blogs( 'blog_media_browse', $current_User->ID ); | 53 | $bloglist = $BlogCache->load_user_blogs( 'blog_media_browse', $current_User->ID ); |
998 | 54 | foreach( $bloglist as $blog_ID ) | 54 | foreach( $bloglist as $blog_ID ) |
999 | 55 | { | 55 | { |
1001 | 56 | if( $Root = & $this->get_by_type_and_ID( 'collection', $blog_ID, true ) ) | 56 | if( $Root = & $this->get_by_type_and_ID( 'blog', $blog_ID, true ) ) |
1002 | 57 | { | 57 | { |
1003 | 58 | $r[$Root->ID] = & $Root; | 58 | $r[$Root->ID] = & $Root; |
1004 | 59 | } | 59 | } |
1005 | 60 | 60 | ||
1006 | === modified file 'qp_inc/files/upload.ctrl.php' | |||
1007 | --- qp_inc/files/upload.ctrl.php 2013-03-12 21:17:25 +0000 | |||
1008 | +++ qp_inc/files/upload.ctrl.php 2013-04-18 18:37:26 +0000 | |||
1009 | @@ -210,6 +210,75 @@ | |||
1010 | 210 | // Remember failed files (and the error messages) | 210 | // Remember failed files (and the error messages) |
1011 | 211 | $failedFiles = array(); | 211 | $failedFiles = array(); |
1012 | 212 | 212 | ||
1013 | 213 | // This next section will check if we have any file or byte restrictions, | ||
1014 | 214 | // and if so see if we will even bother trying to upload. | ||
1015 | 215 | if( isset( $_FILES ) && count( $_FILES ) ) | ||
1016 | 216 | { | ||
1017 | 217 | // Some files have been uploaded | ||
1018 | 218 | global $upload_maxmaxkb; | ||
1019 | 219 | $files_allowed = 99; | ||
1020 | 220 | $bytes_allowed = $upload_maxmaxkb; | ||
1021 | 221 | $uploading_denied = false; | ||
1022 | 222 | |||
1023 | 223 | // easiest first check is if we even have limits | ||
1024 | 224 | $files_lim = $Settings->get( 'fm_'.$fm_FileRoot->type.'_limit_files' ); | ||
1025 | 225 | $bytes_lim = $Settings->get( 'fm_'.$fm_FileRoot->type.'_limit_bytes' ); | ||
1026 | 226 | |||
1027 | 227 | if( $files_lim != '' || $bytes_lim != '' ) | ||
1028 | 228 | { | ||
1029 | 229 | // we have a limit of some kind, so we deal with it | ||
1030 | 230 | $fm_Filelist = new Filelist( $fm_FileRoot, $ads_list_path ); | ||
1031 | 231 | $fm_Filelist->load(); | ||
1032 | 232 | $files = $fm_Filelist->_total_files; | ||
1033 | 233 | $bytes = $fm_Filelist->_total_bytes; | ||
1034 | 234 | |||
1035 | 235 | // have we reached or exceeded our file count limit? | ||
1036 | 236 | if( $files_lim != '' ) | ||
1037 | 237 | { | ||
1038 | 238 | if( $files >= $files_lim ) | ||
1039 | 239 | { | ||
1040 | 240 | // yes: error message, get out | ||
1041 | 241 | $Messages->add( sprintf( T_('This folder has reached the limit for number of files (%s) - uploading not allowed.'), $files_lim ), 'error' ); | ||
1042 | 242 | $uploading_denied = true; | ||
1043 | 243 | } | ||
1044 | 244 | else | ||
1045 | 245 | { | ||
1046 | 246 | $files_allowed = $files_lim - $files; | ||
1047 | 247 | } | ||
1048 | 248 | } | ||
1049 | 249 | |||
1050 | 250 | // have we reached or exceeded our byte count limit? | ||
1051 | 251 | if( $bytes_lim != '' ) | ||
1052 | 252 | { | ||
1053 | 253 | $bytes_lim = ( $bytes_lim * 1024 ); | ||
1054 | 254 | if( $bytes >= $bytes_lim ) | ||
1055 | 255 | { | ||
1056 | 256 | // yes: error message, get out | ||
1057 | 257 | $bytes_lim_kb = number_format( $bytes_lim ); | ||
1058 | 258 | $Messages->add( sprintf( T_('This folder has reached the limit for total bytes (%s) - uploading not allowed.'), $bytes_lim_kb ), 'error' ); | ||
1059 | 259 | $uploading_denied = true; | ||
1060 | 260 | } | ||
1061 | 261 | else | ||
1062 | 262 | { | ||
1063 | 263 | $bytes_allowed = $bytes_lim - $bytes; | ||
1064 | 264 | } | ||
1065 | 265 | } | ||
1066 | 266 | } | ||
1067 | 267 | } | ||
1068 | 268 | |||
1069 | 269 | // If we reached any limits we display the error message and call it a day | ||
1070 | 270 | if( $Messages->count('error') ) | ||
1071 | 271 | { | ||
1072 | 272 | $AdminUI->disp_html_head(); | ||
1073 | 273 | // Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions) | ||
1074 | 274 | $AdminUI->disp_body_top(); | ||
1075 | 275 | $AdminUI->disp_global_footer(); | ||
1076 | 276 | exit(0); | ||
1077 | 277 | } | ||
1078 | 278 | |||
1079 | 279 | // We have $files_allowed and $bytes_allowed. These are either real limits or | ||
1080 | 280 | // crazy-high high falsies. We will apply our limits after each upload ... | ||
1081 | 281 | |||
1082 | 213 | // Process uploaded files | 282 | // Process uploaded files |
1083 | 214 | if( isset( $_FILES ) && count( $_FILES ) ) | 283 | if( isset( $_FILES ) && count( $_FILES ) ) |
1084 | 215 | { | 284 | { |
1085 | @@ -222,6 +291,22 @@ | |||
1086 | 222 | 291 | ||
1087 | 223 | foreach( $_FILES['uploadfile']['name'] as $lKey => $lName ) | 292 | foreach( $_FILES['uploadfile']['name'] as $lKey => $lName ) |
1088 | 224 | { | 293 | { |
1089 | 294 | // check if our limits have been broken, if so abort out | ||
1090 | 295 | if( ! $files_allowed ) | ||
1091 | 296 | { | ||
1092 | 297 | // yes: error message, get out | ||
1093 | 298 | $Messages->add( sprintf( T_('This folder has reached the limit for number of files (%s) - uploading «%s» cancelled.'), $files_lim, $lName ), 'error' ); | ||
1094 | 299 | continue; // abort upload for this file | ||
1095 | 300 | } | ||
1096 | 301 | // have we reached or exceeded our byte count limit? | ||
1097 | 302 | if( $bytes_allowed < 1 ) | ||
1098 | 303 | { | ||
1099 | 304 | // yes: error message, get out | ||
1100 | 305 | $bytes_lim_kb = number_format( $bytes_lim ); | ||
1101 | 306 | $Messages->add( sprintf( T_('This folder has reached the limit for total bytes (%s) - uploading «%s» cancelled.'), $bytes_lim_kb, $lName ), 'error' ); | ||
1102 | 307 | continue; // abort upload for this file | ||
1103 | 308 | } | ||
1104 | 309 | |||
1105 | 225 | if( empty( $lName ) ) | 310 | if( empty( $lName ) ) |
1106 | 226 | { | 311 | { |
1107 | 227 | // No file name | 312 | // No file name |
1108 | @@ -231,73 +316,69 @@ | |||
1109 | 231 | || ! empty( $uploadfile_desc[$lKey] ) | 316 | || ! empty( $uploadfile_desc[$lKey] ) |
1110 | 232 | || ! empty( $uploadfile_name[$lKey] ) ) | 317 | || ! empty( $uploadfile_name[$lKey] ) ) |
1111 | 233 | { | 318 | { |
1114 | 234 | // User specified params but NO file!!! | 319 | // User specified params but no file; remember the file as failed when additional info provided |
1113 | 235 | // Remember the file as failed when additional info provided. | ||
1115 | 236 | $failedFiles[$lKey] = T_( 'Please select a local file to upload.' ); | 320 | $failedFiles[$lKey] = T_( 'Please select a local file to upload.' ); |
1116 | 237 | } | 321 | } |
1119 | 238 | // Abort upload for this file | 322 | continue; // abort upload for this file |
1118 | 239 | continue; | ||
1120 | 240 | } | 323 | } |
1121 | 241 | 324 | ||
1122 | 242 | if( $Settings->get( 'upload_maxkb' ) | 325 | if( $Settings->get( 'upload_maxkb' ) |
1124 | 243 | && $_FILES['uploadfile']['size'][$lKey] > $Settings->get( 'upload_maxkb' )*1024 ) | 326 | && $_FILES['uploadfile']['size'][$lKey] > $Settings->get( 'upload_maxkb' )*1024 ) |
1125 | 244 | { | 327 | { |
1126 | 245 | // bigger than defined by blog | 328 | // bigger than defined by blog |
1129 | 246 | $failedFiles[$lKey] = sprintf( | 329 | $failedFiles[$lKey] = sprintf( T_('The file is too large: %s but the maximum allowed is %s.'), |
1128 | 247 | T_('The file is too large: %s but the maximum allowed is %s.'), | ||
1130 | 248 | bytesreadable( $_FILES['uploadfile']['size'][$lKey] ), | 330 | bytesreadable( $_FILES['uploadfile']['size'][$lKey] ), |
1131 | 249 | bytesreadable( $Settings->get( 'upload_maxkb' )*1024 ) ); | 331 | bytesreadable( $Settings->get( 'upload_maxkb' )*1024 ) ); |
1134 | 250 | // Abort upload for this file | 332 | continue; // abort upload for this file |
1133 | 251 | continue; | ||
1135 | 252 | } | 333 | } |
1136 | 253 | 334 | ||
1137 | 254 | if( $_FILES['uploadfile']['error'][$lKey] ) | 335 | if( $_FILES['uploadfile']['error'][$lKey] ) |
1138 | 255 | { | 336 | { |
1140 | 256 | // PHP has detected an error! | 337 | // PHP has detected an error :: http://php.net/manual/en/features.file-upload.errors.php |
1141 | 257 | switch( $_FILES['uploadfile']['error'][$lKey] ) | 338 | switch( $_FILES['uploadfile']['error'][$lKey] ) |
1142 | 258 | { | 339 | { |
1143 | 340 | case UPLOAD_ERR_INI_SIZE: | ||
1144 | 341 | $failedFiles[$lKey] = T_('The file exceeds the upload_max_filesize directive in php.ini.'); | ||
1145 | 342 | continue; // abort upload for this file | ||
1146 | 343 | |||
1147 | 259 | case UPLOAD_ERR_FORM_SIZE: | 344 | case UPLOAD_ERR_FORM_SIZE: |
1150 | 260 | // The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form | 345 | // The uploaded file exceeds the MAX_FILE_SIZE directive that was specified |
1151 | 261 | // This can easily be changed, so we do not use it.. file size gets checked for real just above | 346 | // in the html form. This can easily be changed, so we do not use it. File |
1152 | 347 | // size gets checked for real just before this switch | ||
1153 | 262 | break; | 348 | break; |
1154 | 263 | 349 | ||
1155 | 264 | case UPLOAD_ERR_INI_SIZE: // bigger than allowed in php.ini | ||
1156 | 265 | $failedFiles[$lKey] = T_('The file exceeds the upload_max_filesize directive in php.ini.'); | ||
1157 | 266 | // Abort upload for this file | ||
1158 | 267 | continue; | ||
1159 | 268 | |||
1160 | 269 | case UPLOAD_ERR_PARTIAL: | 350 | case UPLOAD_ERR_PARTIAL: |
1161 | 270 | $failedFiles[$lKey] = T_('The file was only partially uploaded.'); | 351 | $failedFiles[$lKey] = T_('The file was only partially uploaded.'); |
1164 | 271 | // Abort upload for this file | 352 | continue; // abort upload for this file |
1163 | 272 | continue; | ||
1165 | 273 | 353 | ||
1166 | 274 | case UPLOAD_ERR_NO_FILE: | 354 | case UPLOAD_ERR_NO_FILE: |
1167 | 275 | // Is probably the same as empty( $lName ) before | ||
1168 | 276 | $failedFiles[$lKey] = T_('No file was uploaded.'); | 355 | $failedFiles[$lKey] = T_('No file was uploaded.'); |
1171 | 277 | // Abort upload for this file | 356 | continue; // abort upload for this file |
1170 | 278 | continue; | ||
1172 | 279 | 357 | ||
1176 | 280 | case 6: // numerical value of UPLOAD_ERR_NO_TMP_DIR | 358 | case UPLOAD_ERR_NO_TMP_DIR: |
1174 | 281 | # (min_php: 4.3.10, 5.0.3) case UPLOAD_ERR_NO_TMP_DIR: | ||
1175 | 282 | // Missing a temporary folder. | ||
1177 | 283 | $failedFiles[$lKey] = T_('Missing a temporary folder (upload_tmp_dir in php.ini).'); | 359 | $failedFiles[$lKey] = T_('Missing a temporary folder (upload_tmp_dir in php.ini).'); |
1180 | 284 | // Abort upload for this file | 360 | continue; // abort upload for this file |
1181 | 285 | continue; | 361 | |
1182 | 362 | case UPLOAD_ERR_CANT_WRITE: | ||
1183 | 363 | $failedFiles[$lKey] = T_('Failed to write file to disk.'); | ||
1184 | 364 | continue; // abort upload for this file | ||
1185 | 365 | |||
1186 | 366 | case UPLOAD_ERR_EXTENSION: | ||
1187 | 367 | $failedFiles[$lKey] = T_('A PHP extension stopped the file upload.'); | ||
1188 | 368 | continue; // abort upload for this file | ||
1189 | 286 | 369 | ||
1190 | 287 | default: | 370 | default: |
1191 | 288 | $failedFiles[$lKey] = T_('Unknown error.').' #'.$_FILES['uploadfile']['error'][$lKey]; | 371 | $failedFiles[$lKey] = T_('Unknown error.').' #'.$_FILES['uploadfile']['error'][$lKey]; |
1194 | 289 | // Abort upload for this file: | 372 | continue; // abort upload for this file |
1193 | 290 | continue; | ||
1195 | 291 | } | 373 | } |
1196 | 292 | } | 374 | } |
1197 | 293 | 375 | ||
1199 | 294 | if( !is_uploaded_file( $_FILES['uploadfile']['tmp_name'][$lKey] ) ) | 376 | if( ! is_uploaded_file( $_FILES['uploadfile']['tmp_name'][$lKey] ) ) |
1200 | 295 | { | 377 | { |
1203 | 296 | // Ensure that a malicious user hasn't tried to trick the script into working | 378 | // Ensure that a malicious user hasn't tried to trick the script into |
1204 | 297 | // on files upon which it should not be working | 379 | // working on files upon which it should not be working |
1205 | 298 | $failedFiles[$lKey] = T_('The file does not seem to be a valid upload! It may exceed the upload_max_filesize directive in php.ini.'); | 380 | $failedFiles[$lKey] = T_('The file does not seem to be a valid upload! It may exceed the upload_max_filesize directive in php.ini.'); |
1208 | 299 | // Abort upload for this file | 381 | continue; // abort upload for this file |
1207 | 300 | continue; | ||
1209 | 301 | } | 382 | } |
1210 | 302 | 383 | ||
1211 | 303 | // If new name on server is specified check the extension and use the new name | 384 | // If new name on server is specified check the extension and use the new name |
1212 | @@ -325,8 +406,7 @@ | |||
1213 | 325 | { | 406 | { |
1214 | 326 | // Not a file name or not an allowed extension | 407 | // Not a file name or not an allowed extension |
1215 | 327 | $failedFiles[$lKey] = $error_filename; | 408 | $failedFiles[$lKey] = $error_filename; |
1218 | 328 | // Abort upload for this file | 409 | continue; // abort upload for this file |
1217 | 329 | continue; | ||
1219 | 330 | } | 410 | } |
1220 | 331 | 411 | ||
1221 | 332 | // Get File object for requested target location | 412 | // Get File object for requested target location |
1222 | @@ -335,12 +415,11 @@ | |||
1223 | 335 | 415 | ||
1224 | 336 | if( $newFile->exists() ) | 416 | if( $newFile->exists() ) |
1225 | 337 | { | 417 | { |
1227 | 338 | // The file already exists in the target location! | 418 | // The file already exists in the target location |
1228 | 339 | // @todo (0000) Rename/Overwriting (save as filename_<numeric_extension> and | 419 | // @todo (0000) Rename/Overwriting (save as filename_<numeric_extension> and |
1229 | 340 | // provide interface to confirm, rename or overwrite) | 420 | // provide interface to confirm, rename or overwrite) |
1230 | 341 | $failedFiles[$lKey] = sprintf( T_('The file «%s» already exists.'), $newFile->dget( 'name' ) ); | 421 | $failedFiles[$lKey] = sprintf( T_('The file «%s» already exists.'), $newFile->dget( 'name' ) ); |
1233 | 342 | // Abort upload for this file | 422 | continue; // abort upload for this file |
1232 | 343 | continue; | ||
1234 | 344 | } | 423 | } |
1235 | 345 | 424 | ||
1236 | 346 | // Trigger plugin event | 425 | // Trigger plugin event |
1237 | @@ -352,7 +431,7 @@ | |||
1238 | 352 | 'size' => & $_FILES['uploadfile']['size'][$lKey], | 431 | 'size' => & $_FILES['uploadfile']['size'][$lKey], |
1239 | 353 | ) ) ) | 432 | ) ) ) |
1240 | 354 | { | 433 | { |
1242 | 355 | // Plugin returned 'false'. Abort file upload | 434 | // Plugin returned 'false' ... abort upload for this file |
1243 | 356 | continue; | 435 | continue; |
1244 | 357 | } | 436 | } |
1245 | 358 | 437 | ||
1246 | @@ -360,8 +439,7 @@ | |||
1247 | 360 | if( ! @move_uploaded_file( $_FILES['uploadfile']['tmp_name'][$lKey], $newFile->get_full_path() ) ) | 439 | if( ! @move_uploaded_file( $_FILES['uploadfile']['tmp_name'][$lKey], $newFile->get_full_path() ) ) |
1248 | 361 | { | 440 | { |
1249 | 362 | $failedFiles[$lKey] = T_('An unknown error occurred when moving the uploaded file on the server.'); | 441 | $failedFiles[$lKey] = T_('An unknown error occurred when moving the uploaded file on the server.'); |
1252 | 363 | // Abort upload for this file | 442 | continue; // abort upload for this file |
1251 | 364 | continue; | ||
1253 | 365 | } | 443 | } |
1254 | 366 | 444 | ||
1255 | 367 | // change to default chmod settings | 445 | // change to default chmod settings |
1256 | @@ -482,6 +560,10 @@ | |||
1257 | 482 | // Store File object into DB | 560 | // Store File object into DB |
1258 | 483 | $newFile->dbsave(); | 561 | $newFile->dbsave(); |
1259 | 484 | 562 | ||
1260 | 563 | // subtract this file from $files_allowed and $bytes_allowed | ||
1261 | 564 | $files_allowed = $files_allowed - 1; | ||
1262 | 565 | $bytes_allowed = $bytes_allowed - $_FILES['uploadfile']['size'][$lKey]; | ||
1263 | 566 | |||
1264 | 485 | $Plugins->trigger_event( 'AfterFileSave', array( | 567 | $Plugins->trigger_event( 'AfterFileSave', array( |
1265 | 486 | 'newFile' => & $newFile | 568 | 'newFile' => & $newFile |
1266 | 487 | ) ); | 569 | ) ); |
1267 | 488 | 570 | ||
1268 | === modified file 'qp_inc/files/views/_file_browse.view.php' | |||
1269 | --- qp_inc/files/views/_file_browse.view.php 2013-03-18 19:20:42 +0000 | |||
1270 | +++ qp_inc/files/views/_file_browse.view.php 2013-04-18 18:37:26 +0000 | |||
1271 | @@ -303,10 +303,10 @@ | |||
1272 | 303 | echo '<div class="toolbaritem">'; | 303 | echo '<div class="toolbaritem">'; |
1273 | 304 | $Form = new Form( NULL, 'fmbar_quick_upload', 'post', 'none', 'multipart/form-data' ); | 304 | $Form = new Form( NULL, 'fmbar_quick_upload', 'post', 'none', 'multipart/form-data' ); |
1274 | 305 | $Form->begin_form(); | 305 | $Form->begin_form(); |
1276 | 306 | $Form->hidden_ctrl(); | 306 | $Form->hidden( 'ctrl', 'upload' ); |
1277 | 307 | $Form->hidden( 'upload_quickmode', 1 ); | 307 | $Form->hidden( 'upload_quickmode', 1 ); |
1278 | 308 | // The following is mainly a hint to the browser. | 308 | // The following is mainly a hint to the browser. |
1280 | 309 | $Form->hidden( 'MAX_FILE_SIZE', $Settings->get( 'upload_maxkb' )*1024 ); | 309 | $Form->hidden( 'MAX_FILE_SIZE', $Settings->get( 'upload_maxkb' ) * 1024 ); |
1281 | 310 | $Form->hiddens_by_key( get_memorized('ctrl') ); | 310 | $Form->hiddens_by_key( get_memorized('ctrl') ); |
1282 | 311 | echo '<div>'; | 311 | echo '<div>'; |
1283 | 312 | echo '<input name="uploadfile[]" type="file" size="10" />'; | 312 | echo '<input name="uploadfile[]" type="file" size="10" />'; |
1284 | 313 | 313 | ||
1285 | === modified file 'qp_inc/files/views/_file_browse_set.form.php' | |||
1286 | --- qp_inc/files/views/_file_browse_set.form.php 2013-03-18 19:20:42 +0000 | |||
1287 | +++ qp_inc/files/views/_file_browse_set.form.php 2013-04-18 18:37:26 +0000 | |||
1288 | @@ -22,7 +22,7 @@ | |||
1289 | 22 | { | 22 | { |
1290 | 23 | echo '<p class="note">'.T_('See also:').' '; | 23 | echo '<p class="note">'.T_('See also:').' '; |
1291 | 24 | 24 | ||
1293 | 25 | if( $fm_FileRoot->type == 'collection' ) | 25 | if( $fm_FileRoot->type == 'blog' ) |
1294 | 26 | { | 26 | { |
1295 | 27 | echo T_('Blog Settings').' > '.T_('General').' > <a href="?ctrl=blog_settings&tab=general&blog='.$fm_FileRoot->in_type_ID.'">' | 27 | echo T_('Blog Settings').' > '.T_('General').' > <a href="?ctrl=blog_settings&tab=general&blog='.$fm_FileRoot->in_type_ID.'">' |
1296 | 28 | .T_('Media directory location').'</a> • '; | 28 | .T_('Media directory location').'</a> • '; |
1297 | 29 | 29 | ||
1298 | === modified file 'qp_inc/files/views/_file_list.inc.php' | |||
1299 | --- qp_inc/files/views/_file_list.inc.php 2013-03-22 21:28:25 +0000 | |||
1300 | +++ qp_inc/files/views/_file_list.inc.php 2013-04-18 18:37:26 +0000 | |||
1301 | @@ -459,7 +459,7 @@ | |||
1302 | 459 | $title_options = array(); | 459 | $title_options = array(); |
1303 | 460 | $caption_options = array(); | 460 | $caption_options = array(); |
1304 | 461 | 461 | ||
1306 | 462 | if( $mode != 'upload' && ( $fm_Filelist->get_root_type() == 'collection' || ! empty( $Blog ) ) ) | 462 | if( $mode != 'upload' && ( $fm_Filelist->get_root_type() == 'blog' || ! empty( $Blog ) ) ) |
1307 | 463 | { | 463 | { |
1308 | 464 | // We are browsing files for a blog | 464 | // We are browsing files for a blog |
1309 | 465 | // fp> TODO: use current as default but let user choose into which blog he wants to post | 465 | // fp> TODO: use current as default but let user choose into which blog he wants to post |
1310 | 466 | 466 | ||
1311 | === modified file 'qp_inc/files/views/_file_settings.form.php' | |||
1312 | --- qp_inc/files/views/_file_settings.form.php 2013-03-22 21:28:25 +0000 | |||
1313 | +++ qp_inc/files/views/_file_settings.form.php 2013-04-18 18:37:26 +0000 | |||
1314 | @@ -66,79 +66,52 @@ | |||
1315 | 66 | return $r; | 66 | return $r; |
1316 | 67 | } | 67 | } |
1317 | 68 | 68 | ||
1318 | 69 | |||
1319 | 70 | /** | ||
1320 | 71 | * Javascript to init hidden/shown state of a fastform field based on a checkbox | ||
1321 | 72 | * | ||
1322 | 73 | * EXPERIMENTAL | ||
1323 | 74 | * Will be moved to another file, I'm leaving it here for a short period, in order to provide context | ||
1324 | 75 | * | ||
1325 | 76 | * @param string form field id as used when creating it with the Form class | ||
1326 | 77 | * @param string DOM id | ||
1327 | 78 | */ | ||
1328 | 79 | function JS_showhide_ffield_on_checkbox( $field_id, $checkbox_id ) | ||
1329 | 80 | { | ||
1330 | 81 | return '<script type="text/javascript"> | ||
1331 | 82 | document.getElementById("ffield_'.$field_id.'").style.display = (document.getElementById("'.$checkbox_id.'").checked ? "" : "none") | ||
1332 | 83 | </script>'; | ||
1333 | 84 | } | ||
1334 | 85 | |||
1335 | 86 | |||
1336 | 87 | /** | ||
1337 | 88 | * Javascript hide/show all DOM elements with a particular class based on current checkbox | ||
1338 | 89 | * | ||
1339 | 90 | * EXPERIMENTAL | ||
1340 | 91 | * Will be moved to another file, I'm leaving it here for a short period, in order to provide context | ||
1341 | 92 | * | ||
1342 | 93 | * @param string DOM class name | ||
1343 | 94 | */ | ||
1344 | 95 | function JS_showhide_class_on_this( $class ) | ||
1345 | 96 | { | ||
1346 | 97 | return 'if( this.checked ) | ||
1347 | 98 | { | ||
1348 | 99 | jQuery(".'.$class.'").show(); | ||
1349 | 100 | } | ||
1350 | 101 | else | ||
1351 | 102 | { | ||
1352 | 103 | jQuery(".'.$class.'").hide(); | ||
1353 | 104 | }'; | ||
1354 | 105 | } | ||
1355 | 106 | |||
1356 | 107 | |||
1357 | 108 | /** | ||
1358 | 109 | * Javascript hide/show a fastform field based on current checkbox | ||
1359 | 110 | * | ||
1360 | 111 | * EXPERIMENTAL | ||
1361 | 112 | * Will be moved to another file, I'm leaving it here for a short period, in order to provide context | ||
1362 | 113 | * | ||
1363 | 114 | * @param string DOM id | ||
1364 | 115 | */ | ||
1365 | 116 | function JS_showhide_ffield_on_this( $field_id ) | ||
1366 | 117 | { | ||
1367 | 118 | return 'document.getElementById("ffield_'.$field_id.'").style.display = (this.checked ? "" : "none")'; | ||
1368 | 119 | } | ||
1369 | 120 | |||
1370 | 121 | $Form = new Form( NULL, 'files_checkchanges' ); | 69 | $Form = new Form( NULL, 'files_checkchanges' ); |
1371 | 122 | $Form->begin_form( 'fform', T_('File Settings') ); | 70 | $Form->begin_form( 'fform', T_('File Settings') ); |
1372 | 123 | $Form->hidden_ctrl(); | 71 | $Form->hidden_ctrl(); |
1373 | 124 | $Form->hidden( 'action', 'update' ); | 72 | $Form->hidden( 'action', 'update' ); |
1374 | 125 | 73 | ||
1375 | 126 | $Form->begin_fieldset( T_('Accessible file roots'), array( 'id' => 'ffset_fileroots', 'class' => 'additional_file_settings' ) ); | 74 | $Form->begin_fieldset( T_('Accessible file roots'), array( 'id' => 'ffset_fileroots', 'class' => 'additional_file_settings' ) ); |
1380 | 127 | $Form->checkbox( 'fm_enable_roots_blog', $Settings->get( 'fm_enable_roots_blog' ), T_('Enable blog directories'), T_('Check to enable root directories for blogs.' ) ); | 75 | $Form->checkbox_input( 'fm_enable_roots_blog', $Settings->get( 'fm_enable_roots_blog' ), T_('Enable blog directories'), |
1381 | 128 | $Form->checkbox( 'fm_enable_roots_user', $Settings->get( 'fm_enable_roots_user' ), T_('Enable user directories'), T_('Check to enable root directories for users.' ) ); | 76 | array( 'note' => T_('Check to enable root directories for blogs.'), |
1382 | 129 | $Form->checkbox( 'fm_enable_roots_shared', $Settings->get( 'fm_enable_roots_shared' ), T_('Enable shared directory'), T_('Check to enable shared root directory.' ) ); | 77 | 'onclick' => 'document.getElementById("fm_blog_limits").style.display = (this.checked==true ? "" : "none") ;' ) ); |
1383 | 130 | $Form->checkbox( 'fm_enable_roots_templates', $Settings->get( 'fm_enable_roots_templates' ), T_('Enable templates directory'), T_('Check to enable root directory for templates.' ) ); // fp> note: meaning may change to 1 dir per (installed) template | 78 | echo '<div id="fm_blog_limits">'; |
1384 | 79 | $Form->text_input( 'fm_blog_limit_files', $Settings->get( 'fm_blog_limit_files' ), 3, T_('blog file limit'), T_('This limits how many files a blog folder can have. Leave empty for no limit.') ); | ||
1385 | 80 | $Form->text_input( 'fm_blog_limit_bytes', $Settings->get( 'fm_blog_limit_bytes' ), 6, T_('blog dir size'), T_('KB. This limits how many kilobytes a blog folder can have. Leave empty for no limit.' ) ); | ||
1386 | 81 | echo '</div>'; | ||
1387 | 82 | $Form->checkbox_input( 'fm_enable_roots_user', $Settings->get( 'fm_enable_roots_user' ), T_('Enable user directories'), | ||
1388 | 83 | array( 'note' => T_('Check to enable root directories for users.' ), | ||
1389 | 84 | 'onclick' => 'document.getElementById("fm_user_limits").style.display = (this.checked==true ? "" : "none") ;' ) ); | ||
1390 | 85 | echo '<div id="fm_user_limits">'; | ||
1391 | 86 | $Form->text_input( 'fm_user_limit_files', $Settings->get( 'fm_user_limit_files' ), 3, T_('user file limit'), T_('This limits how many files a user folder can have. Leave empty for no limit.') ); | ||
1392 | 87 | $Form->text_input( 'fm_user_limit_bytes', $Settings->get( 'fm_user_limit_bytes' ), 6, T_('user dir size'), T_('KB. This limits how many kilobytes a user folder can have. Leave empty for no limit.' ) ); | ||
1393 | 88 | echo '</div>'; | ||
1394 | 89 | $Form->checkbox_input( 'fm_enable_roots_shared', $Settings->get( 'fm_enable_roots_shared' ), T_('Enable shared directory'), | ||
1395 | 90 | array( 'note' => T_('Check to enable shared root directory.' ), | ||
1396 | 91 | 'onclick' => 'document.getElementById("fm_shared_limits").style.display = (this.checked==true ? "" : "none") ;' ) ); | ||
1397 | 92 | echo '<div id="fm_shared_limits">'; | ||
1398 | 93 | $Form->text_input( 'fm_shared_limit_files', $Settings->get( 'fm_shared_limit_files' ), 3, T_('shared file limit'), T_('This limits how many files a shared folder can have. Leave empty for no limit.') ); | ||
1399 | 94 | $Form->text_input( 'fm_shared_limit_bytes', $Settings->get( 'fm_shared_limit_bytes' ), 6, T_('shared dir size'), T_('KB. This limits how many kilobytes a shared folder can have. Leave empty for no limit.' ) ); | ||
1400 | 95 | echo '</div>'; | ||
1401 | 96 | $Form->checkbox_input( 'fm_enable_roots_templates', $Settings->get( 'fm_enable_roots_templates' ), T_('Enable templates directory'), | ||
1402 | 97 | array( 'note' => T_('Check to enable root directory for templates.' ), | ||
1403 | 98 | 'onclick' => 'document.getElementById("fm_templates_limits").style.display = (this.checked==true ? "" : "none") ;' ) ); | ||
1404 | 99 | echo '<div id="fm_templates_limits">'; | ||
1405 | 100 | $Form->text_input( 'fm_templates_limit_files', $Settings->get( 'fm_templates_limit_files' ), 3, T_('template file limit'), T_('This limits how many files a template folder can have. Leave empty for no limit.') ); | ||
1406 | 101 | $Form->text_input( 'fm_templates_limit_bytes', $Settings->get( 'fm_templates_limit_bytes' ), 6, T_('template dir size'), T_('KB. This limits how many kilobytes a template folder can have. Leave empty for no limit.' ) ); | ||
1407 | 102 | echo '</div>'; | ||
1408 | 131 | $Form->end_fieldset(); | 103 | $Form->end_fieldset(); |
1409 | 132 | 104 | ||
1410 | 133 | $Form->begin_fieldset( T_('File creation options'), array( 'id' => 'ffset_filecreate', 'class' => 'additional_file_settings' ) ); | 105 | $Form->begin_fieldset( T_('File creation options'), array( 'id' => 'ffset_filecreate', 'class' => 'additional_file_settings' ) ); |
1411 | 134 | $Form->checkbox( 'fm_enable_create_dir', $Settings->get( 'fm_enable_create_dir' ), T_('Enable creation of folders'), T_('Check to enable creation of directories.' ) ); | 106 | $Form->checkbox( 'fm_enable_create_dir', $Settings->get( 'fm_enable_create_dir' ), T_('Enable creation of folders'), T_('Check to enable creation of directories.' ) ); |
1412 | 135 | $Form->checkbox( 'fm_enable_create_file', $Settings->get( 'fm_enable_create_file' ), T_('Enable creation of files'), T_('Check to enable creation of files.' ) ); | 107 | $Form->checkbox( 'fm_enable_create_file', $Settings->get( 'fm_enable_create_file' ), T_('Enable creation of files'), T_('Check to enable creation of files.' ) ); |
1413 | 136 | $Form->checkbox_input( 'upload_enabled', $Settings->get( 'upload_enabled' ), T_('Enable upload of files'), array( | 108 | $Form->checkbox_input( 'upload_enabled', $Settings->get( 'upload_enabled' ), T_('Enable upload of files'), array( |
1415 | 137 | 'note' => T_('Check to allow uploading files in general.' ), 'onclick' => JS_showhide_ffield_on_this('upload_maxkb') ) ); | 109 | 'note' => T_('Check to allow uploading files in general.' ), |
1416 | 110 | 'onclick' => 'document.getElementById("upload_maxkb_div").style.display = (this.checked==true ? "" : "none") ;' ) ); | ||
1417 | 111 | echo '<div id="upload_maxkb_div">'; | ||
1418 | 138 | $Form->text_input( 'upload_maxkb', $Settings->get( 'upload_maxkb' ), 6, T_('Maximum upload filesize'), | 112 | $Form->text_input( 'upload_maxkb', $Settings->get( 'upload_maxkb' ), 6, T_('Maximum upload filesize'), |
1419 | 139 | sprintf( /* TRANS: first %s is setting/var name, second is file name, third is limit value */ T_('KB. This cannot be higher than your PHP/Webserver setting and the limit of %s (in %s), which is currently %s!'), '$upload_maxmaxkb', '/qp_config/_advanced.php', $upload_maxmaxkb.' '.T_('KB') ), array( 'maxlength' => 7, 'required' => true ) ); | 113 | sprintf( /* TRANS: first %s is setting/var name, second is file name, third is limit value */ T_('KB. This cannot be higher than your PHP/Webserver setting and the limit of %s (in %s), which is currently %s!'), '$upload_maxmaxkb', '/qp_config/_advanced.php', $upload_maxmaxkb.' '.T_('KB') ), array( 'maxlength' => 7, 'required' => true ) ); |
1422 | 140 | // Javascript to init hidden/shown state: | 114 | echo '</div>'; |
1421 | 141 | echo JS_showhide_ffield_on_checkbox( 'upload_maxkb', 'upload_enabled' ); | ||
1423 | 142 | $Form->end_fieldset(); | 115 | $Form->end_fieldset(); |
1424 | 143 | 116 | ||
1425 | 144 | $Form->begin_fieldset( T_('Advanced options'), array( 'id' => 'ffset_fileadvanced', 'class' => 'additional_file_settings' ) ); | 117 | $Form->begin_fieldset( T_('Advanced options'), array( 'id' => 'ffset_fileadvanced', 'class' => 'additional_file_settings' ) ); |
1426 | 145 | 118 | ||
1427 | === modified file 'qp_inc/generic/model/_genericelement.class.php' | |||
1428 | --- qp_inc/generic/model/_genericelement.class.php 2013-03-18 19:20:42 +0000 | |||
1429 | +++ qp_inc/generic/model/_genericelement.class.php 2013-04-18 18:37:26 +0000 | |||
1430 | @@ -79,8 +79,8 @@ | |||
1431 | 79 | $Form->global_icon( T_('Cancel editing!'), 'close', regenerate_url( 'action' ), T_('cancel') ); | 79 | $Form->global_icon( T_('Cancel editing!'), 'close', regenerate_url( 'action' ), T_('cancel') ); |
1432 | 80 | } | 80 | } |
1433 | 81 | $Form->begin_form( 'fform', $creating ? T_('New element') : T_('Element') ); | 81 | $Form->begin_form( 'fform', $creating ? T_('New element') : T_('Element') ); |
1434 | 82 | $Form->hidden_ctrl(); | ||
1435 | 83 | $Form->hidden( 'action', $creating ? 'create' : 'update' ); | 82 | $Form->hidden( 'action', $creating ? 'create' : 'update' ); |
1436 | 83 | $Form->hidden( 'ctrl', $ctrl ); | ||
1437 | 84 | $Form->hiddens_by_key( get_memorized( 'action, ctrl' ) ); | 84 | $Form->hiddens_by_key( get_memorized( 'action, ctrl' ) ); |
1438 | 85 | $Form->text_input( $this->dbprefix.'name', $this->name, $edited_name_maxlen, T_('name'), '', array( 'required' => true ) ); | 85 | $Form->text_input( $this->dbprefix.'name', $this->name, $edited_name_maxlen, T_('name'), '', array( 'required' => true ) ); |
1439 | 86 | if( $creating ) | 86 | if( $creating ) |
1440 | 87 | 87 | ||
1441 | === modified file 'qp_inc/generic/views/_generic_category.form.php' | |||
1442 | --- qp_inc/generic/views/_generic_category.form.php 2013-03-18 19:20:42 +0000 | |||
1443 | +++ qp_inc/generic/views/_generic_category.form.php 2013-04-18 18:37:26 +0000 | |||
1444 | @@ -22,8 +22,8 @@ | |||
1445 | 22 | $Form = new Form( NULL, 'form' ); | 22 | $Form = new Form( NULL, 'form' ); |
1446 | 23 | $Form->global_icon( T_('Cancel editing!'), 'close', regenerate_url( 'action' ), T_('cancel') ); | 23 | $Form->global_icon( T_('Cancel editing!'), 'close', regenerate_url( 'action' ), T_('cancel') ); |
1447 | 24 | $Form->begin_form( 'fform', $creating ? T_('New category') : T_('Category') ); | 24 | $Form->begin_form( 'fform', $creating ? T_('New category') : T_('Category') ); |
1448 | 25 | $Form->hidden_ctrl(); | ||
1449 | 26 | $Form->hidden( 'action', $creating ? 'create' : 'update' ); | 25 | $Form->hidden( 'action', $creating ? 'create' : 'update' ); |
1450 | 26 | $Form->hidden( 'ctrl', $ctrl ); | ||
1451 | 27 | $Form->hiddens_by_key( get_memorized( 'action, ctrl' ) ); | 27 | $Form->hiddens_by_key( get_memorized( 'action, ctrl' ) ); |
1452 | 28 | 28 | ||
1453 | 29 | $Form->begin_fieldset( T_('Properties') ); | 29 | $Form->begin_fieldset( T_('Properties') ); |
1454 | 30 | 30 | ||
1455 | === modified file 'qp_inc/plugins/_plugin.class.php' | |||
1456 | --- qp_inc/plugins/_plugin.class.php 2013-03-22 21:28:25 +0000 | |||
1457 | +++ qp_inc/plugins/_plugin.class.php 2013-04-18 18:37:26 +0000 | |||
1458 | @@ -809,6 +809,17 @@ | |||
1459 | 809 | 809 | ||
1460 | 810 | 810 | ||
1461 | 811 | /** | 811 | /** |
1462 | 812 | * Event handler: Turns on "extended profile" feature | ||
1463 | 813 | * | ||
1464 | 814 | * Give it a true to give each user a second page of profile options | ||
1465 | 815 | */ | ||
1466 | 816 | function ActivateExtendedProfile( $activate = false ) | ||
1467 | 817 | { | ||
1468 | 818 | return false; | ||
1469 | 819 | } | ||
1470 | 820 | |||
1471 | 821 | |||
1472 | 822 | /** | ||
1473 | 812 | * Event handler: Gets invoked in /admin.php after the menu structure is built | 823 | * Event handler: Gets invoked in /admin.php after the menu structure is built |
1474 | 813 | * | 824 | * |
1475 | 814 | * Gets invoked in /admin.php for every backoffice page after the menu structure | 825 | * Gets invoked in /admin.php for every backoffice page after the menu structure |
1476 | 815 | 826 | ||
1477 | === modified file 'qp_inc/plugins/_plugin.funcs.php' | |||
1478 | --- qp_inc/plugins/_plugin.funcs.php 2013-03-12 06:26:03 +0000 | |||
1479 | +++ qp_inc/plugins/_plugin.funcs.php 2013-04-18 18:37:26 +0000 | |||
1480 | @@ -925,7 +925,8 @@ | |||
1481 | 925 | if( isset( $meta['valid_pattern'] ) ) | 925 | if( isset( $meta['valid_pattern'] ) ) |
1482 | 926 | { | 926 | { |
1483 | 927 | $param_pattern = is_array( $meta['valid_pattern'] ) ? $meta['valid_pattern']['pattern'] : $meta['valid_pattern']; | 927 | $param_pattern = is_array( $meta['valid_pattern'] ) ? $meta['valid_pattern']['pattern'] : $meta['valid_pattern']; |
1485 | 928 | if( ! preg_match( $param_pattern, $value ) ) | 928 | // checking for not empty values is a lazy solution to an unrequired field making an "error" even though it works correctly |
1486 | 929 | if( ! preg_match( $param_pattern, $value ) && $value != '' ) | ||
1487 | 929 | { | 930 | { |
1488 | 930 | $param_error = is_array( $meta['valid_pattern'] ) ? $meta['valid_pattern']['error'] : sprintf(T_('The value is invalid. It must match the regular expression «%s».'), $param_pattern); | 931 | $param_error = is_array( $meta['valid_pattern'] ) ? $meta['valid_pattern']['error'] : sprintf(T_('The value is invalid. It must match the regular expression «%s».'), $param_pattern); |
1489 | 931 | param_error( $param_name, $param_error ); | 932 | param_error( $param_name, $param_error ); |
1490 | 932 | 933 | ||
1491 | === modified file 'qp_inc/plugins/model/_plugins_admin.class.php' | |||
1492 | --- qp_inc/plugins/model/_plugins_admin.class.php 2013-03-18 19:20:42 +0000 | |||
1493 | +++ qp_inc/plugins/model/_plugins_admin.class.php 2013-04-18 18:37:26 +0000 | |||
1494 | @@ -81,6 +81,7 @@ | |||
1495 | 81 | if( empty( $supported_events ) ) | 81 | if( empty( $supported_events ) ) |
1496 | 82 | { | 82 | { |
1497 | 83 | $supported_events = array( | 83 | $supported_events = array( |
1498 | 84 | 'ActivateExtendedProfile' => 'Turns on "extended profile" feature', | ||
1499 | 84 | 'AdminAfterPageFooter' => 'This gets called after the backoffice HTML footer has been displayed.', | 85 | 'AdminAfterPageFooter' => 'This gets called after the backoffice HTML footer has been displayed.', |
1500 | 85 | 'AdminDisplayEditorButton' => 'Display action buttons on the edit screen(s)', | 86 | 'AdminDisplayEditorButton' => 'Display action buttons on the edit screen(s)', |
1501 | 86 | 'AdminDisplayCommentToolbar' => 'Display a toolbar on the admin-side feedback form', | 87 | 'AdminDisplayCommentToolbar' => 'Display a toolbar on the admin-side feedback form', |
1502 | 87 | 88 | ||
1503 | === modified file 'qp_inc/sessions/_sessions.init.php' | |||
1504 | --- qp_inc/sessions/_sessions.init.php 2013-03-22 21:28:25 +0000 | |||
1505 | +++ qp_inc/sessions/_sessions.init.php 2013-04-18 18:37:26 +0000 | |||
1506 | @@ -27,15 +27,12 @@ | |||
1507 | 27 | 27 | ||
1508 | 28 | // Aliases for table names | 28 | // Aliases for table names |
1509 | 29 | $app_db_config['aliases']['T_basedomains'] = $app_db_tableprefix.'basedomains'; | 29 | $app_db_config['aliases']['T_basedomains'] = $app_db_tableprefix.'basedomains'; |
1512 | 30 | $app_db_config['aliases']['T_goals'] = $app_db_tableprefix.'track__goal'; | 30 | $app_db_config['aliases']['T_goals'] = $app_db_tableprefix.'goals'; |
1513 | 31 | $app_db_config['aliases']['T_goal_hits'] = $app_db_tableprefix.'track__goalhit'; | 31 | $app_db_config['aliases']['T_goal_hits'] = $app_db_tableprefix.'goal_hits'; |
1514 | 32 | $app_db_config['aliases']['T_hitlog'] = $app_db_tableprefix.'hitlog'; | 32 | $app_db_config['aliases']['T_hitlog'] = $app_db_tableprefix.'hitlog'; |
1516 | 33 | $app_db_config['aliases']['T_keyphrases'] = $app_db_tableprefix.'track__keyphrase'; | 33 | $app_db_config['aliases']['T_keyphrases'] = $app_db_tableprefix.'keyphrases'; |
1517 | 34 | $app_db_config['aliases']['T_sessions'] = $app_db_tableprefix.'sessions'; | 34 | $app_db_config['aliases']['T_sessions'] = $app_db_tableprefix.'sessions'; |
1518 | 35 | $app_db_config['aliases']['T_useragents'] = $app_db_tableprefix.'useragents'; | 35 | $app_db_config['aliases']['T_useragents'] = $app_db_tableprefix.'useragents'; |
1519 | 36 | $app_db_config['aliases']['T_track__goal'] = $app_db_tableprefix.'track__goal'; // old, going away | ||
1520 | 37 | $app_db_config['aliases']['T_track__goalhit'] = $app_db_tableprefix.'track__goalhit'; // old, going away | ||
1521 | 38 | $app_db_config['aliases']['T_track__keyphrase'] = $app_db_tableprefix.'track__keyphrase'; // old, going away | ||
1522 | 39 | 36 | ||
1523 | 40 | // Controller mappings | 37 | // Controller mappings |
1524 | 41 | $ctrl_mappings['stats'] = 'sessions/stats.ctrl.php'; | 38 | $ctrl_mappings['stats'] = 'sessions/stats.ctrl.php'; |
1525 | 42 | 39 | ||
1526 | === modified file 'qp_inc/settings/model/_generalsettings.class.php' | |||
1527 | --- qp_inc/settings/model/_generalsettings.class.php 2013-03-12 06:26:03 +0000 | |||
1528 | +++ qp_inc/settings/model/_generalsettings.class.php 2013-04-18 18:37:26 +0000 | |||
1529 | @@ -58,7 +58,7 @@ | |||
1530 | 58 | 'newusers_canregister' => '0', | 58 | 'newusers_canregister' => '0', |
1531 | 59 | 'newusers_level' => '1', | 59 | 'newusers_level' => '1', |
1532 | 60 | // "Display options" section | 60 | // "Display options" section |
1534 | 61 | 'default_admin_template' => 'wind', | 61 | 'default_admin_template' => 'earth', |
1535 | 62 | // "Email validation" section | 62 | // "Email validation" section |
1536 | 63 | 'newusers_mustvalidate' => '1', | 63 | 'newusers_mustvalidate' => '1', |
1537 | 64 | 'newusers_revalidate_emailchg' => '0', | 64 | 'newusers_revalidate_emailchg' => '0', |
1538 | @@ -80,9 +80,17 @@ | |||
1539 | 80 | // GLOBAL SETTINGS -> FILES | 80 | // GLOBAL SETTINGS -> FILES |
1540 | 81 | // "Accessible file roots" section | 81 | // "Accessible file roots" section |
1541 | 82 | 'fm_enable_roots_blog' => '1', | 82 | 'fm_enable_roots_blog' => '1', |
1542 | 83 | 'fm_blog_limit_files' => '', | ||
1543 | 84 | 'fm_blog_limit_bytes' => '', | ||
1544 | 83 | 'fm_enable_roots_user' => '1', | 85 | 'fm_enable_roots_user' => '1', |
1545 | 86 | 'fm_user_limit_files' => '', | ||
1546 | 87 | 'fm_user_limit_bytes' => '', | ||
1547 | 84 | 'fm_enable_roots_shared' => '0', | 88 | 'fm_enable_roots_shared' => '0', |
1548 | 89 | 'fm_shared_limit_files' => '', | ||
1549 | 90 | 'fm_shared_limit_bytes' => '', | ||
1550 | 85 | 'fm_enable_roots_templates' => '0', | 91 | 'fm_enable_roots_templates' => '0', |
1551 | 92 | 'fm_templates_limit_files' => '', | ||
1552 | 93 | 'fm_templates_limit_bytes' => '', | ||
1553 | 86 | // "File creation options" section | 94 | // "File creation options" section |
1554 | 87 | 'fm_enable_create_dir' => '1', | 95 | 'fm_enable_create_dir' => '1', |
1555 | 88 | 'fm_enable_create_file' => '1', | 96 | 'fm_enable_create_file' => '1', |
1556 | 89 | 97 | ||
1557 | === modified file 'qp_inc/templates/model/_template.class.php' | |||
1558 | --- qp_inc/templates/model/_template.class.php 2013-03-22 21:28:25 +0000 | |||
1559 | +++ qp_inc/templates/model/_template.class.php 2013-04-18 18:37:26 +0000 | |||
1560 | @@ -194,6 +194,9 @@ | |||
1561 | 194 | * Compare discovered containers to database info | 194 | * Compare discovered containers to database info |
1562 | 195 | * | 195 | * |
1563 | 196 | * Called when reloading a template | 196 | * Called when reloading a template |
1564 | 197 | * | ||
1565 | 198 | * @todo (3085) EdB> There seems to be a bug in here that leaves mention of a | ||
1566 | 199 | * container that was removed when doing a reload. | ||
1567 | 197 | */ | 200 | */ |
1568 | 198 | function db_compare_containers() | 201 | function db_compare_containers() |
1569 | 199 | { | 202 | { |
1570 | 200 | 203 | ||
1571 | === modified file 'qp_inc/tools/views/_system_list.view.php' | |||
1572 | --- qp_inc/tools/views/_system_list.view.php 2013-03-18 19:20:42 +0000 | |||
1573 | +++ qp_inc/tools/views/_system_list.view.php 2013-04-18 18:37:26 +0000 | |||
1574 | @@ -39,19 +39,8 @@ | |||
1575 | 39 | // Version check | 39 | // Version check |
1576 | 40 | $app_timestamp = mysql2timestamp( $app_date ); | 40 | $app_timestamp = mysql2timestamp( $app_date ); |
1577 | 41 | $app_date = date_i18n( locale_datefmt(), $app_timestamp ); | 41 | $app_date = date_i18n( locale_datefmt(), $app_timestamp ); |
1591 | 42 | 42 | $ver_val = sprintf( T_('%s released on %s'), $app_version, $app_date ); | |
1592 | 43 | $bzr_revno = get_bzr_revision(); | 43 | init_system_check( sprintf( T_('%s version'), $app_name ), $ver_val ); |
1580 | 44 | if( $bzr_revno ) | ||
1581 | 45 | { | ||
1582 | 46 | /* TRANS: First %s: App version, second %s: release date, third %d: Bazaar revision number */ | ||
1583 | 47 | $ver_val = sprintf( T_( '%s released on %s — Bazaar revision %d' ), $app_version, $app_date, $bzr_revno ); | ||
1584 | 48 | } | ||
1585 | 49 | else | ||
1586 | 50 | { | ||
1587 | 51 | /* TRANS: First %s: App version, second %s: release date */ | ||
1588 | 52 | $ver_val = sprintf( T_( '%s released on %s' ), $app_version, $app_date ); | ||
1589 | 53 | } | ||
1590 | 54 | init_system_check( sprintf( T_( '%s version' ), $app_name ), $ver_val ); | ||
1593 | 55 | 44 | ||
1594 | 56 | // age check | 45 | // age check |
1595 | 57 | $app_age = ( $localtimenow - $app_timestamp ) / 3600 / 24 / 30; // approx age in months | 46 | $app_age = ( $localtimenow - $app_timestamp ) / 3600 / 24 / 30; // approx age in months |
1596 | @@ -63,13 +52,6 @@ | |||
1597 | 63 | { | 52 | { |
1598 | 64 | disp_system_check( 'warning', sprintf( T_('This version is aging. You may want to check for newer releases on').' <a href="'.$app_homepage.'">'.$app_name.'</a>.' ) ); | 53 | disp_system_check( 'warning', sprintf( T_('This version is aging. You may want to check for newer releases on').' <a href="'.$app_homepage.'">'.$app_name.'</a>.' ) ); |
1599 | 65 | } | 54 | } |
1600 | 66 | elseif( $bzr_revno ) | ||
1601 | 67 | { | ||
1602 | 68 | disp_system_check( 'ok', sprintf( /* TRANS: %d: Bazaar revision number */ | ||
1603 | 69 | T_( 'This is a development version and not an official release, but it should be mostly operational.<br />' | ||
1604 | 70 | .'If you report bugs in this version, mention that you are using the development version with ' | ||
1605 | 71 | .'<strong>Bazaar revision number %d</strong>.' ), $bzr_revno ) ); | ||
1606 | 72 | } | ||
1607 | 73 | else | 55 | else |
1608 | 74 | { | 56 | { |
1609 | 75 | disp_system_check( 'ok' ); | 57 | disp_system_check( 'ok' ); |
1610 | 76 | 58 | ||
1611 | === modified file 'qp_inc/users/model/_user.class.php' | |||
1612 | --- qp_inc/users/model/_user.class.php 2013-03-22 21:28:25 +0000 | |||
1613 | +++ qp_inc/users/model/_user.class.php 2013-04-18 18:37:26 +0000 | |||
1614 | @@ -903,13 +903,34 @@ | |||
1615 | 903 | 'align' => '', | 903 | 'align' => '', |
1616 | 904 | ), $params ); | 904 | ), $params ); |
1617 | 905 | 905 | ||
1625 | 906 | $FileCache = & get_Cache( 'FileCache' ); | 906 | |
1626 | 907 | $Avatar = & $FileCache->get_by_ID( $this->avatar_ID, false, false ); | 907 | global $DB; |
1627 | 908 | 908 | $query = 'SELECT file_path FROM T_files WHERE file_root_type = \'user\' AND file_ID = '.$this->avatar_ID; | |
1628 | 909 | return array( | 909 | if( $file_name = $DB->get_var( $query ) ) |
1629 | 910 | 'tag' => $Avatar->get_thumb_imgtag( $params['size'], $params['class'], $params['align'] ), | 910 | { |
1630 | 911 | 'root' => $Avatar->_FileRoot->ID, | 911 | $FileCache = & get_Cache( 'FileCache' ); |
1631 | 912 | ); | 912 | $Avatar = & $FileCache->get_by_root_and_path( 'user', $this->ID, $file_name ); |
1632 | 913 | return array( | ||
1633 | 914 | 'tag' => $Avatar->get_thumb_imgtag( $params['size'], $params['class'], $params['align'] ), | ||
1634 | 915 | 'root' => $Avatar->_FileRoot->ID, | ||
1635 | 916 | ); | ||
1636 | 917 | } | ||
1637 | 918 | elseif( is_null( $file_name ) ) | ||
1638 | 919 | { | ||
1639 | 920 | // avatar file must have been deleted is all I can think of | ||
1640 | 921 | $UserCache = & get_Cache( 'UserCache' ); | ||
1641 | 922 | $edited_User = & $UserCache->get_by_ID( $this->ID, false ); | ||
1642 | 923 | $edited_User->set( 'avatar_file_ID', NULL, true ); | ||
1643 | 924 | $edited_User->dbupdate(); | ||
1644 | 925 | // return an empty array as avatar | ||
1645 | 926 | return array( 'tag' => '', 'root' => '' ); | ||
1646 | 927 | } | ||
1647 | 928 | else | ||
1648 | 929 | { | ||
1649 | 930 | // this is a total mystery ... no file name but not null? | ||
1650 | 931 | debug_die( 'file id '.$this->avatar_ID.' not found but file_name not null ... which is crazy' ); | ||
1651 | 932 | } | ||
1652 | 933 | |||
1653 | 913 | } | 934 | } |
1654 | 914 | 935 | ||
1655 | 915 | 936 | ||
1656 | 916 | 937 | ||
1657 | === modified file 'qp_inc/users/model/_user.funcs.php' | |||
1658 | --- qp_inc/users/model/_user.funcs.php 2013-03-22 21:28:25 +0000 | |||
1659 | +++ qp_inc/users/model/_user.funcs.php 2013-04-18 18:37:26 +0000 | |||
1660 | @@ -276,7 +276,7 @@ | |||
1661 | 276 | 276 | ||
1662 | 277 | 277 | ||
1663 | 278 | /** | 278 | /** |
1665 | 279 | * Template tag: Output a link to the backoffice | 279 | * Template tag: Display a link to the backoffice |
1666 | 280 | * | 280 | * |
1667 | 281 | * Usually provided in templates in order for newbies to find the admin interface | 281 | * Usually provided in templates in order for newbies to find the admin interface |
1668 | 282 | * more easily... | 282 | * more easily... |
1669 | @@ -284,9 +284,10 @@ | |||
1670 | 284 | * @todo (2140) EdB> change to array of params | 284 | * @todo (2140) EdB> change to array of params |
1671 | 285 | * @param string To be displayed before the link. | 285 | * @param string To be displayed before the link. |
1672 | 286 | * @param string To be displayed after the link. | 286 | * @param string To be displayed after the link. |
1673 | 287 | * @param string The page/controller to link to inside of {@link $admin_url} | ||
1674 | 288 | * @param string Text for the link. | 287 | * @param string Text for the link. |
1675 | 289 | * @param string Title for the link. | 288 | * @param string Title for the link. |
1676 | 289 | * @param string The page/controller to link to inside of {@link $admin_url} | ||
1677 | 290 | * @param string the returned string if the user should not see the admin link | ||
1678 | 290 | */ | 291 | */ |
1679 | 291 | function user_admin_link( $before = '', $after = '', $link_text = '', $link_title = '#', $not_visible = '' ) | 292 | function user_admin_link( $before = '', $after = '', $link_text = '', $link_title = '#', $not_visible = '' ) |
1680 | 292 | { | 293 | { |
1681 | @@ -295,16 +296,16 @@ | |||
1682 | 295 | 296 | ||
1683 | 296 | 297 | ||
1684 | 297 | /** | 298 | /** |
1686 | 298 | * Template tag: Get a link to the backoffice | 299 | * Get a link to the backoffice |
1687 | 299 | * | 300 | * |
1688 | 300 | * Usually provided in templates in order for newbies to find the admin interface | 301 | * Usually provided in templates in order for newbies to find the admin interface |
1689 | 301 | * more easily... | 302 | * more easily... |
1690 | 302 | * | 303 | * |
1691 | 303 | * @param string To be displayed before the link. | 304 | * @param string To be displayed before the link. |
1692 | 304 | * @param string To be displayed after the link. | 305 | * @param string To be displayed after the link. |
1693 | 305 | * @param string The page/controller to link to inside of {@link $admin_url} | ||
1694 | 306 | * @param string Text for the link. | 306 | * @param string Text for the link. |
1695 | 307 | * @param string Title for the link. | 307 | * @param string Title for the link. |
1696 | 308 | * @param string The returned string if the user should not see the admin link | ||
1697 | 308 | * @return string | 309 | * @return string |
1698 | 309 | */ | 310 | */ |
1699 | 310 | function get_user_admin_link( $before = '', $after = '', $link_text = '', $link_title = '#', $not_visible = '' ) | 311 | function get_user_admin_link( $before = '', $after = '', $link_text = '', $link_title = '#', $not_visible = '' ) |
1700 | @@ -343,19 +344,30 @@ | |||
1701 | 343 | 344 | ||
1702 | 344 | /** | 345 | /** |
1703 | 345 | * Template tag: Display a link to user profile | 346 | * Template tag: Display a link to user profile |
1704 | 347 | * | ||
1705 | 348 | * @param string To be displayed before the link. | ||
1706 | 349 | * @param string To be displayed after the link. | ||
1707 | 350 | * @param string Text for the link. | ||
1708 | 351 | * @param string Title for the link. | ||
1709 | 352 | * @param integer The ID of the user we want a profile link for | ||
1710 | 346 | */ | 353 | */ |
1712 | 347 | function user_profile_link( $before = '', $after = '', $link_text = '', $link_title = '#' ) | 354 | function user_profile_link( $before = '', $after = '', $link_text = '', $link_title = '#', $user_id = '#' ) |
1713 | 348 | { | 355 | { |
1715 | 349 | echo get_user_profile_link( $before, $after, $link_text, $link_title ); | 356 | echo get_user_profile_link( $before, $after, $link_text, $link_title, $user_id ); |
1716 | 350 | } | 357 | } |
1717 | 351 | 358 | ||
1718 | 352 | 359 | ||
1719 | 353 | /** | 360 | /** |
1721 | 354 | * Template tag: Get a link to user profile | 361 | * Get a link to user profile |
1722 | 355 | * | 362 | * |
1723 | 363 | * @param string To be displayed before the link. | ||
1724 | 364 | * @param string To be displayed after the link. | ||
1725 | 365 | * @param string Text for the link. | ||
1726 | 366 | * @param string Title for the link. | ||
1727 | 367 | * @param integer The ID of the user we want a profile for | ||
1728 | 356 | * @return string|false | 368 | * @return string|false |
1729 | 357 | */ | 369 | */ |
1731 | 358 | function get_user_profile_link( $before = '', $after = '', $link_text = '', $link_title = '#' ) | 370 | function get_user_profile_link( $before = '', $after = '', $link_text = '', $link_title = '#', $user_id = '#' ) |
1732 | 359 | { | 371 | { |
1733 | 360 | global $current_User; | 372 | global $current_User; |
1734 | 361 | 373 | ||
1735 | @@ -372,10 +384,20 @@ | |||
1736 | 372 | { | 384 | { |
1737 | 373 | $link_text = str_replace( '%s', $current_User->login, $link_text ); | 385 | $link_text = str_replace( '%s', $current_User->login, $link_text ); |
1738 | 374 | } | 386 | } |
1740 | 375 | if( $link_title == '#' ) $link_title = T_('Edit your profile'); | 387 | |
1741 | 388 | if( $link_title == '#' ) | ||
1742 | 389 | { | ||
1743 | 390 | $link_title = T_('Edit your profile'); | ||
1744 | 391 | } | ||
1745 | 392 | |||
1746 | 393 | if( $user_id == '#' ) | ||
1747 | 394 | { | ||
1748 | 395 | $user_id = $current_User->ID; | ||
1749 | 396 | } | ||
1750 | 397 | |||
1751 | 376 | 398 | ||
1752 | 377 | $r = $before | 399 | $r = $before |
1754 | 378 | .'<a href="'.get_user_profile_url().'" title="'.$link_title.'">' | 400 | .'<a href="'.get_user_profile_url( $user_id ).'" title="'.$link_title.'">' |
1755 | 379 | .sprintf( $link_text, $current_User->login ) | 401 | .sprintf( $link_text, $current_User->login ) |
1756 | 380 | .'</a>' | 402 | .'</a>' |
1757 | 381 | .$after; | 403 | .$after; |
1758 | @@ -386,8 +408,11 @@ | |||
1759 | 386 | 408 | ||
1760 | 387 | /** | 409 | /** |
1761 | 388 | * Get URL to edit user profile | 410 | * Get URL to edit user profile |
1762 | 411 | * | ||
1763 | 412 | * @param integer The ID of the user we want a profile for | ||
1764 | 413 | * @return string The link to profile, either in admin or public with redirect | ||
1765 | 389 | */ | 414 | */ |
1767 | 390 | function get_user_profile_url() | 415 | function get_user_profile_url( $user_id ) |
1768 | 391 | { | 416 | { |
1769 | 392 | global $admin_url; | 417 | global $admin_url; |
1770 | 393 | global $Blog; | 418 | global $Blog; |
1771 | @@ -401,7 +426,7 @@ | |||
1772 | 401 | } | 426 | } |
1773 | 402 | else | 427 | else |
1774 | 403 | { | 428 | { |
1776 | 404 | $url = url_add_param( $Blog->gen_blogurl(), 'disp=profile&redirect_to='.rawurlencode( $ReqURI ) ); | 429 | $url = url_add_param( $Blog->gen_blogurl(), 'disp=profile&user_ID='.$user_id.'&redirect_to='.rawurlencode( $ReqURI ) ); |
1777 | 405 | } | 430 | } |
1778 | 406 | 431 | ||
1779 | 407 | return $url; | 432 | return $url; |
1780 | 408 | 433 | ||
1781 | === modified file 'qp_inc/users/model/_usersettings.class.php' | |||
1782 | --- qp_inc/users/model/_usersettings.class.php 2013-03-22 21:28:25 +0000 | |||
1783 | +++ qp_inc/users/model/_usersettings.class.php 2013-04-18 18:37:26 +0000 | |||
1784 | @@ -35,7 +35,7 @@ | |||
1785 | 35 | 'fm_allowfiltering' => 'simple', | 35 | 'fm_allowfiltering' => 'simple', |
1786 | 36 | 'blogperms_layout' => 'default', // selected view in blog (user/group) perms | 36 | 'blogperms_layout' => 'default', // selected view in blog (user/group) perms |
1787 | 37 | 'login_multiple_sessions' => 1, // allow multiple concurrent sessions? (PARAMOUNT ON DEMO SERVER) | 37 | 'login_multiple_sessions' => 1, // allow multiple concurrent sessions? (PARAMOUNT ON DEMO SERVER) |
1789 | 38 | 'results_per_page' => 20, | 38 | 'results_per_page' => 50, |
1790 | 39 | 'num_admin_blogs' => 10, | 39 | 'num_admin_blogs' => 10, |
1791 | 40 | ); | 40 | ); |
1792 | 41 | 41 | ||
1793 | 42 | 42 | ||
1794 | === modified file 'qp_inc/users/users.ctrl.php' | |||
1795 | --- qp_inc/users/users.ctrl.php 2013-03-22 21:28:25 +0000 | |||
1796 | +++ qp_inc/users/users.ctrl.php 2013-04-18 18:37:26 +0000 | |||
1797 | @@ -169,6 +169,17 @@ | |||
1798 | 169 | } | 169 | } |
1799 | 170 | } | 170 | } |
1800 | 171 | 171 | ||
1801 | 172 | // add menu options if a plugin needs them and we are on a user page | ||
1802 | 173 | global $Plugins; | ||
1803 | 174 | |||
1804 | 175 | if( $Plugins->trigger_event_first_true( 'ActivateExtendedProfile' ) && isset( $user_ID ) ) | ||
1805 | 176 | { | ||
1806 | 177 | $AdminUI->add_menu_entries( 'users', array( | ||
1807 | 178 | 'profile' => array( 'text' => 'Profile', 'href' => $dispatcher.'?ctrl=users&user_ID='.$user_ID ), | ||
1808 | 179 | 'users_ext' => array( 'text' => 'Extended Profile', 'href' => $dispatcher.'?ctrl=users&x=1&user_ID='.$user_ID ) | ||
1809 | 180 | ) ); | ||
1810 | 181 | } | ||
1811 | 182 | |||
1812 | 172 | // Perform actions, if there were no errors | 183 | // Perform actions, if there were no errors |
1813 | 173 | if( ! $Messages->count('error') ) | 184 | if( ! $Messages->count('error') ) |
1814 | 174 | { | 185 | { |
1815 | 175 | 186 | ||
1816 | === modified file 'qp_inc/users/views/_user.form.php' | |||
1817 | --- qp_inc/users/views/_user.form.php 2013-03-18 19:20:42 +0000 | |||
1818 | +++ qp_inc/users/views/_user.form.php 2013-04-18 18:37:26 +0000 | |||
1819 | @@ -20,6 +20,7 @@ | |||
1820 | 20 | global $AdminUI; | 20 | global $AdminUI; |
1821 | 21 | global $current_User; | 21 | global $current_User; |
1822 | 22 | global $edited_User; | 22 | global $edited_User; |
1823 | 23 | global $lock_id_and_nick; | ||
1824 | 23 | global $Plugins; | 24 | global $Plugins; |
1825 | 24 | global $Settings; | 25 | global $Settings; |
1826 | 25 | global $UserSettings; | 26 | global $UserSettings; |
1827 | @@ -112,14 +113,29 @@ | |||
1828 | 112 | if( $action != 'view_user' ) | 113 | if( $action != 'view_user' ) |
1829 | 113 | { | 114 | { |
1830 | 114 | // We can edit the values | 115 | // We can edit the values |
1832 | 115 | $Form->text_input( 'edited_user_login', $edited_User->login, 20, T_('Login'), '', array( 'required' => true ) ); | 116 | if( $lock_id_and_nick && ( ! $current_User->ID === 1 ) ) |
1833 | 117 | { | ||
1834 | 118 | // lock is set and user #1 is not out there ... no editing allowed | ||
1835 | 119 | $Form->info( T_('Login'), $edited_User->get( 'login' ) ); | ||
1836 | 120 | $Form->hidden( 'edited_user_login', $edited_User->login ); | ||
1837 | 121 | } | ||
1838 | 122 | else | ||
1839 | 123 | { | ||
1840 | 124 | $Form->text_input( 'edited_user_login', $edited_User->login, 20, T_('Login'), '', array( 'required' => true ) ); | ||
1841 | 125 | } | ||
1842 | 116 | $Form->text_input( 'edited_user_firstname', $edited_User->firstname, 20, T_('First name'), '', array( 'maxlength' => 50 ) ); | 126 | $Form->text_input( 'edited_user_firstname', $edited_User->firstname, 20, T_('First name'), '', array( 'maxlength' => 50 ) ); |
1843 | 117 | $Form->text_input( 'edited_user_lastname', $edited_User->lastname, 20, T_('Last name'), '', array( 'maxlength' => 50 ) ); | 127 | $Form->text_input( 'edited_user_lastname', $edited_User->lastname, 20, T_('Last name'), '', array( 'maxlength' => 50 ) ); |
1845 | 118 | $Form->text_input( 'edited_user_nickname', $edited_User->nickname, 20, T_('Nickname'), '', array( 'maxlength' => 50, 'required' => true ) ); | 128 | if( $lock_id_and_nick && ( ! $current_User->ID === 1 ) ) |
1846 | 129 | { | ||
1847 | 130 | // lock is set and user #1 is not out there ... no editing allowed | ||
1848 | 131 | $Form->info( T_('Nickname'), $edited_User->get( 'nickname' ) ); | ||
1849 | 132 | $Form->hidden( 'edited_user_nickname', $edited_User->nickname ); | ||
1850 | 133 | } | ||
1851 | 134 | else | ||
1852 | 135 | { | ||
1853 | 136 | $Form->text_input( 'edited_user_nickname', $edited_User->nickname, 20, T_('Nickname'), '', array( 'maxlength' => 50, 'required' => true ) ); | ||
1854 | 137 | } | ||
1855 | 119 | $Form->select( 'edited_user_idmode', $edited_User->get( 'idmode' ), array( &$edited_User, 'callback_optionsForIdMode' ), T_('Identity shown') ); | 138 | $Form->select( 'edited_user_idmode', $edited_User->get( 'idmode' ), array( &$edited_User, 'callback_optionsForIdMode' ), T_('Identity shown') ); |
1856 | 120 | $Form->checkbox( 'edited_user_showonline', $edited_User->get( 'showonline' ), T_('Show online'), T_('Check this to be displayed as online when visiting the site.') ); | ||
1857 | 121 | $Form->checkbox( 'edited_user_set_login_multiple_sessions', $UserSettings->get( 'login_multiple_sessions', $edited_User->ID), T_('Multiple sessions'), | ||
1858 | 122 | T_('Check this if you want to log in from different computers/browsers at the same time. Otherwise, logging in from a new computer/browser will disconnect you on the previous one.') ); | ||
1859 | 123 | } | 139 | } |
1860 | 124 | else | 140 | else |
1861 | 125 | { | 141 | { |
1862 | @@ -129,17 +145,14 @@ | |||
1863 | 129 | $Form->info( T_('Last name'), $edited_User->get( 'lastname' ) ); | 145 | $Form->info( T_('Last name'), $edited_User->get( 'lastname' ) ); |
1864 | 130 | $Form->info( T_('Nickname'), $edited_User->get( 'nickname' ) ); | 146 | $Form->info( T_('Nickname'), $edited_User->get( 'nickname' ) ); |
1865 | 131 | $Form->info( T_('Identity shown'), $edited_User->get( 'preferredname' ) ); | 147 | $Form->info( T_('Identity shown'), $edited_User->get( 'preferredname' ) ); |
1866 | 132 | $Form->info( T_('Show online'), ( $edited_User->get( 'showonline' ) ) ? T_('yes') : T_('no') ); | ||
1867 | 133 | $Form->info( T_('Multiple sessions'), ( $UserSettings->get( 'login_multiple_sessions', $edited_User->ID ) ? T_('Allowed') : T_('Forbidden') ) ); | ||
1868 | 134 | } | 148 | } |
1869 | 135 | $Form->end_fieldset(); | ||
1870 | 136 | 149 | ||
1871 | 137 | // "Extended Identity" section | ||
1872 | 138 | ob_start(); | 150 | ob_start(); |
1873 | 139 | $Form->begin_fieldset( T_('Extended Identity') ); | ||
1874 | 140 | ob_start(); | 151 | ob_start(); |
1875 | 141 | $Plugins->restart(); | 152 | $Plugins->restart(); |
1877 | 142 | while( $loop_Plugin = & $Plugins->get_next() ) | 153 | // $edited_User->ID is 0 if we are copying/creating, so the avatar and biography |
1878 | 154 | // bits can't be added at this point. too lazy to really fix it is the thing ... | ||
1879 | 155 | while( $loop_Plugin = & $Plugins->get_next() && $edited_User->ID ) | ||
1880 | 143 | { | 156 | { |
1881 | 144 | if( $loop_Plugin->UserSettings ) | 157 | if( $loop_Plugin->UserSettings ) |
1882 | 145 | { | 158 | { |
1883 | @@ -154,7 +167,7 @@ | |||
1884 | 154 | // get avatar info | 167 | // get avatar info |
1885 | 155 | $avatar_info = $edited_User->get_avatar( array( | 168 | $avatar_info = $edited_User->get_avatar( array( |
1886 | 156 | 'size' => 'crop-64x64', | 169 | 'size' => 'crop-64x64', |
1888 | 157 | 'class' => 'floatleft', | 170 | 'class' => 'floatleft' |
1889 | 158 | ) ); | 171 | ) ); |
1890 | 159 | $avatar_tag = $avatar_info['tag']; // '' if no avatar | 172 | $avatar_tag = $avatar_info['tag']; // '' if no avatar |
1891 | 160 | $avatar_root = $avatar_info['root']; // '' if no avatar | 173 | $avatar_root = $avatar_info['root']; // '' if no avatar |
1892 | @@ -179,7 +192,6 @@ | |||
1893 | 179 | } | 192 | } |
1894 | 180 | $Form->info( T_( 'Avatar' ), $avatar_tag ); | 193 | $Form->info( T_( 'Avatar' ), $avatar_tag ); |
1895 | 181 | } | 194 | } |
1896 | 182 | |||
1897 | 183 | // biography field | 195 | // biography field |
1898 | 184 | if( $l_name == 'use_biography' ) | 196 | if( $l_name == 'use_biography' ) |
1899 | 185 | { | 197 | { |
1900 | @@ -187,13 +199,17 @@ | |||
1901 | 187 | { | 199 | { |
1902 | 188 | $Form->textarea( 'edited_user_biography', $edited_User->get( 'biography' ), 5, T_('Biography'), T_('This is called for by a plugin so we do not know what it is used for.'), 50, 'large' ); | 200 | $Form->textarea( 'edited_user_biography', $edited_User->get( 'biography' ), 5, T_('Biography'), T_('This is called for by a plugin so we do not know what it is used for.'), 50, 'large' ); |
1903 | 189 | } | 201 | } |
1904 | 202 | else | ||
1905 | 203 | { | ||
1906 | 204 | $Form->info( T_('Biography'), $edited_User->get( 'biography' ), T_('This is called for by a plugin so we do not know what it is used for.') ); | ||
1907 | 205 | } | ||
1908 | 190 | } | 206 | } |
1909 | 191 | } | 207 | } |
1910 | 192 | } | 208 | } |
1911 | 193 | } | 209 | } |
1912 | 194 | } | 210 | } |
1913 | 195 | $has_contents = strlen( ob_get_contents() ); | 211 | $has_contents = strlen( ob_get_contents() ); |
1915 | 196 | $Form->end_fieldset(); | 212 | //$Form->end_fieldset(); |
1916 | 197 | if( $has_contents ) | 213 | if( $has_contents ) |
1917 | 198 | { | 214 | { |
1918 | 199 | ob_end_flush(); | 215 | ob_end_flush(); |
1919 | @@ -206,6 +222,22 @@ | |||
1920 | 206 | ob_end_clean(); | 222 | ob_end_clean(); |
1921 | 207 | } | 223 | } |
1922 | 208 | 224 | ||
1923 | 225 | if( $action != 'view_user' ) | ||
1924 | 226 | { | ||
1925 | 227 | // We can edit the values | ||
1926 | 228 | if( $lock_id_and_nick && ( ! $current_User->ID === 1 ) ) | ||
1927 | 229 | $Form->checkbox( 'edited_user_showonline', $edited_User->get( 'showonline' ), T_('Show online'), T_('Check this to be displayed as online when visiting the site.') ); | ||
1928 | 230 | $Form->checkbox( 'edited_user_set_login_multiple_sessions', $UserSettings->get( 'login_multiple_sessions', $edited_User->ID), T_('Multiple sessions'), | ||
1929 | 231 | T_('Check this if you want to log in from different computers/browsers at the same time. Otherwise, logging in from a new computer/browser will disconnect you on the previous one.') ); | ||
1930 | 232 | } | ||
1931 | 233 | else | ||
1932 | 234 | { | ||
1933 | 235 | // display only | ||
1934 | 236 | $Form->info( T_('Show online'), ( $edited_User->get( 'showonline' ) ) ? T_('yes') : T_('no') ); | ||
1935 | 237 | $Form->info( T_('Multiple sessions'), ( $UserSettings->get( 'login_multiple_sessions', $edited_User->ID ) ? T_('Allowed') : T_('Forbidden') ) ); | ||
1936 | 238 | } | ||
1937 | 239 | $Form->end_fieldset(); | ||
1938 | 240 | |||
1939 | 209 | // "Password" section | 241 | // "Password" section |
1940 | 210 | if( $action != 'view_user' ) | 242 | if( $action != 'view_user' ) |
1941 | 211 | { | 243 | { |
1942 | @@ -236,19 +268,14 @@ | |||
1943 | 236 | // We can edit the values | 268 | // We can edit the values |
1944 | 237 | $Form->select( 'edited_user_locale', $edited_User->get( 'locale' ), 'locale_options_return', T_('Preferred locale'), T_('Preferred locale for admin interface, notifications, etc.')); | 269 | $Form->select( 'edited_user_locale', $edited_User->get( 'locale' ), 'locale_options_return', T_('Preferred locale'), T_('Preferred locale for admin interface, notifications, etc.')); |
1945 | 238 | $Form->select_input_array( 'edited_user_admin_template', $value_admin_template, get_admin_templates(), T_('Admin template'), T_('The template defines how the backoffice appears to you.') ); | 270 | $Form->select_input_array( 'edited_user_admin_template', $value_admin_template, get_admin_templates(), T_('Admin template'), T_('The template defines how the backoffice appears to you.') ); |
1946 | 239 | |||
1947 | 240 | // To display or hide icon legend | 271 | // To display or hide icon legend |
1948 | 241 | $Form->checkbox( 'edited_user_legend', $UserSettings->get( 'display_icon_legend', $edited_User->ID ), T_('Display icon legend'), T_('Display a legend at the bottom of every page including all action icons used on that page.') ); | 272 | $Form->checkbox( 'edited_user_legend', $UserSettings->get( 'display_icon_legend', $edited_User->ID ), T_('Display icon legend'), T_('Display a legend at the bottom of every page including all action icons used on that page.') ); |
1949 | 242 | |||
1950 | 243 | // To activate or deactivate bozo validator | 273 | // To activate or deactivate bozo validator |
1951 | 244 | $Form->checkbox( 'edited_user_bozo', $UserSettings->get( 'control_form_abortions', $edited_User->ID ), T_('Control form closing'), T_('This will alert you if you fill in data into a form and try to leave the form before submitting the data.') ); | 274 | $Form->checkbox( 'edited_user_bozo', $UserSettings->get( 'control_form_abortions', $edited_User->ID ), T_('Control form closing'), T_('This will alert you if you fill in data into a form and try to leave the form before submitting the data.') ); |
1952 | 245 | |||
1953 | 246 | // To activate focus on first form input text | 275 | // To activate focus on first form input text |
1954 | 247 | $Form->checkbox( 'edited_user_focusonfirst', $UserSettings->get( 'focus_on_first_input', $edited_User->ID ), T_('Focus on first field'), T_('The focus will automatically go to the first input text field.') ); | 276 | $Form->checkbox( 'edited_user_focusonfirst', $UserSettings->get( 'focus_on_first_input', $edited_User->ID ), T_('Focus on first field'), T_('The focus will automatically go to the first input text field.') ); |
1955 | 248 | |||
1956 | 249 | // Number of results per page | 277 | // Number of results per page |
1957 | 250 | $Form->text( 'edited_user_results_per_page', $UserSettings->get( 'results_per_page', $edited_User->ID ), 3, T_('Results per page'), T_('Number of rows displayed in results tables.') ); | 278 | $Form->text( 'edited_user_results_per_page', $UserSettings->get( 'results_per_page', $edited_User->ID ), 3, T_('Results per page'), T_('Number of rows displayed in results tables.') ); |
1958 | 251 | |||
1959 | 252 | // Number of blogs to display in the admin | 279 | // Number of blogs to display in the admin |
1960 | 253 | $Form->text( 'edited_user_num_admin_blogs', $UserSettings->get( 'num_admin_blogs', $edited_User->ID ), 2, T_('Blog menu length'), T_('Number of blogs displayed in the admin console before using a select box') ); | 280 | $Form->text( 'edited_user_num_admin_blogs', $UserSettings->get( 'num_admin_blogs', $edited_User->ID ), 2, T_('Blog menu length'), T_('Number of blogs displayed in the admin console before using a select box') ); |
1961 | 254 | } | 281 | } |
1962 | @@ -263,7 +290,6 @@ | |||
1963 | 263 | $Form->end_fieldset(); | 290 | $Form->end_fieldset(); |
1964 | 264 | 291 | ||
1965 | 265 | // "Plugin options" section | 292 | // "Plugin options" section |
1966 | 266 | |||
1967 | 267 | if( $action != 'view_user' ) | 293 | if( $action != 'view_user' ) |
1968 | 268 | { | 294 | { |
1969 | 269 | // We can edit the values | 295 | // We can edit the values |
1970 | 270 | 296 | ||
1971 | === modified file 'qp_inc/users/views/_user_list.view.php' | |||
1972 | --- qp_inc/users/views/_user_list.view.php 2013-03-18 19:20:42 +0000 | |||
1973 | +++ qp_inc/users/views/_user_list.view.php 2013-04-18 18:37:26 +0000 | |||
1974 | @@ -16,11 +16,11 @@ | |||
1975 | 16 | global $Settings; | 16 | global $Settings; |
1976 | 17 | global $usedgroups; | 17 | global $usedgroups; |
1977 | 18 | 18 | ||
1979 | 19 | // query which groups have users (in order to prevent deletion of groups which have users) | 19 | // query which groups have users (to prevent deletion of groups which have users) |
1980 | 20 | $usedgroups = $DB->get_col( 'SELECT grp_ID | 20 | $usedgroups = $DB->get_col( 'SELECT grp_ID |
1981 | 21 | FROM T_groups | 21 | FROM T_groups |
1982 | 22 | INNER JOIN T_users ON user_grp_ID = grp_ID | 22 | INNER JOIN T_users ON user_grp_ID = grp_ID |
1984 | 23 | GROUP BY grp_ID'); | 23 | GROUP BY grp_ID' ); |
1985 | 24 | 24 | ||
1986 | 25 | // Query user list | 25 | // Query user list |
1987 | 26 | $keywords = param( 'keywords', 'string', '', true ); | 26 | $keywords = param( 'keywords', 'string', '', true ); |
1988 | @@ -37,12 +37,14 @@ | |||
1989 | 37 | } | 37 | } |
1990 | 38 | } | 38 | } |
1991 | 39 | 39 | ||
1998 | 40 | $sql = "SELECT T_users.*, grp_ID, grp_name, COUNT(blog_ID) AS nb_blogs | 40 | $sql = "SELECT T_users.*, grp_ID, grp_name, |
1999 | 41 | FROM T_users RIGHT JOIN T_groups ON user_grp_ID = grp_ID | 41 | COUNT(blog_ID) AS nb_blogs |
2000 | 42 | LEFT JOIN T_blogs on user_ID = blog_owner_user_ID | 42 | FROM T_users |
2001 | 43 | WHERE $where_clause 1 | 43 | RIGHT JOIN T_groups ON user_grp_ID = grp_ID |
2002 | 44 | GROUP BY user_ID, grp_ID | 44 | LEFT JOIN T_blogs on user_ID = blog_owner_user_ID |
2003 | 45 | ORDER BY grp_name, *"; | 45 | WHERE $where_clause 1 |
2004 | 46 | GROUP BY user_ID, grp_ID | ||
2005 | 47 | ORDER BY grp_name, *"; | ||
2006 | 46 | 48 | ||
2007 | 47 | $count_sql = 'SELECT COUNT(*) | 49 | $count_sql = 'SELECT COUNT(*) |
2008 | 48 | FROM T_users | 50 | FROM T_users |
2009 | @@ -111,10 +113,20 @@ | |||
2010 | 111 | 'td' => '$user_firstname$ $user_lastname$', | 113 | 'td' => '$user_firstname$ $user_lastname$', |
2011 | 112 | ); | 114 | ); |
2012 | 113 | 115 | ||
2013 | 116 | // User #1 can see all ... | ||
2014 | 117 | if( $current_User->ID === '1' ) | ||
2015 | 118 | { | ||
2016 | 119 | $Results->cols[] = array( | ||
2017 | 120 | 'th' => T_('Email'), | ||
2018 | 121 | 'td_class' => 'shrinkwrap', | ||
2019 | 122 | 'td' => '%user_mailto( #user_email# )%', | ||
2020 | 123 | ); | ||
2021 | 124 | } | ||
2022 | 125 | |||
2023 | 114 | $Results->cols[] = array( | 126 | $Results->cols[] = array( |
2025 | 115 | 'th' => T_('Email'), | 127 | 'th' => T_('Message'), |
2026 | 116 | 'td_class' => 'shrinkwrap', | 128 | 'td_class' => 'shrinkwrap', |
2028 | 117 | 'td' => '%user_mailto( #user_email# )%', | 129 | 'td' => '%user_message( #user_allow_msgform#, #user_email# , #user_ID#, #user_nickname# )%', |
2029 | 118 | ); | 130 | ); |
2030 | 119 | 131 | ||
2031 | 120 | $Results->cols[] = array( | 132 | $Results->cols[] = array( |
2032 | @@ -244,4 +256,19 @@ | |||
2033 | 244 | return action_icon( T_('Email').': '.$email, 'email', 'mailto:'.$email, T_('Email') ); | 256 | return action_icon( T_('Email').': '.$email, 'email', 'mailto:'.$email, T_('Email') ); |
2034 | 245 | } | 257 | } |
2035 | 246 | 258 | ||
2036 | 259 | /** | ||
2037 | 260 | * dummy docblock | ||
2038 | 261 | */ | ||
2039 | 262 | function user_message( $allow_form, $email, $ID, $nickname ) | ||
2040 | 263 | { | ||
2041 | 264 | if( $allow_form === '0' ) | ||
2042 | 265 | { | ||
2043 | 266 | return ' '; | ||
2044 | 267 | } | ||
2045 | 268 | |||
2046 | 269 | $form_url = url_add_param( '', 'recipient_id='.$ID.'&redirect_to='.rawurlencode( url_rel_to_same_host( regenerate_url( '', '', '', '&' ), '' ) ) ); | ||
2047 | 270 | |||
2048 | 271 | return action_icon( sprintf( T_('Send email to %s'), $nickname ), 'email', $form_url ); | ||
2049 | 272 | } | ||
2050 | 273 | |||
2051 | 247 | ?> | 274 | ?> |
2052 | 248 | 275 | ||
2053 | === modified file 'qp_install/_create_items.php' | |||
2054 | --- qp_install/_create_items.php 2013-03-22 21:28:25 +0000 | |||
2055 | +++ qp_install/_create_items.php 2013-04-18 18:37:26 +0000 | |||
2056 | @@ -132,7 +132,7 @@ | |||
2057 | 132 | $edited_Item = new Item(); | 132 | $edited_Item = new Item(); |
2058 | 133 | $edited_Item->insert( 1, T_('artists-paint-pots-2'), 'This shows the simplest attachment possible: the file name became the file\'s title, alt text, description, and post title.', $now, $cat_yellowstone, array(), 'published','en-US' ); | 133 | $edited_Item->insert( 1, T_('artists-paint-pots-2'), 'This shows the simplest attachment possible: the file name became the file\'s title, alt text, description, and post title.', $now, $cat_yellowstone, array(), 'published','en-US' ); |
2059 | 134 | // attach an image to the item | 134 | // attach an image to the item |
2061 | 135 | $edit_File = new File( 'collection', 4, 'artists-paint-pots-2.jpg' ); | 135 | $edit_File = new File( 'blog', 4, 'artists-paint-pots-2.jpg' ); |
2062 | 136 | $edit_File->link_to_Item( $edited_Item ); | 136 | $edit_File->link_to_Item( $edited_Item ); |
2063 | 137 | // add meta data for this image (only once per image!) | 137 | // add meta data for this image (only once per image!) |
2064 | 138 | $query = "UPDATE T_files SET file_title = 'artists-paint-pots-2', file_alt = 'artists-paint-pots-2', file_desc = 'artists-paint-pots-2' WHERE file_ID = {$edit_File->ID}"; | 138 | $query = "UPDATE T_files SET file_title = 'artists-paint-pots-2', file_alt = 'artists-paint-pots-2', file_desc = 'artists-paint-pots-2' WHERE file_ID = {$edit_File->ID}"; |
2065 | @@ -162,7 +162,7 @@ | |||
2066 | 162 | $edited_Item = new Item(); | 162 | $edited_Item = new Item(); |
2067 | 163 | $edited_Item->insert( 1, T_('Photo of Biscuit Basin'), 'This shows a customized "file title" field, which became the alt text and description and item title.', $now, $cat_yellowstone, array(), 'published','en-US' ); | 163 | $edited_Item->insert( 1, T_('Photo of Biscuit Basin'), 'This shows a customized "file title" field, which became the alt text and description and item title.', $now, $cat_yellowstone, array(), 'published','en-US' ); |
2068 | 164 | // attach an image to the item | 164 | // attach an image to the item |
2070 | 165 | $edit_File = new File( 'collection', 4, 'biscuit-basin.jpg' ); | 165 | $edit_File = new File( 'blog', 4, 'biscuit-basin.jpg' ); |
2071 | 166 | $edit_File->link_to_Item( $edited_Item ); | 166 | $edit_File->link_to_Item( $edited_Item ); |
2072 | 167 | // add meta data for this image (only once per image!) | 167 | // add meta data for this image (only once per image!) |
2073 | 168 | $query = "UPDATE T_files SET file_title = 'Photo of Biscuit Basin', file_alt = 'Photo of Biscuit Basin', file_desc = 'Photo of Biscuit Basin' WHERE file_ID = {$edit_File->ID}"; | 168 | $query = "UPDATE T_files SET file_title = 'Photo of Biscuit Basin', file_alt = 'Photo of Biscuit Basin', file_desc = 'Photo of Biscuit Basin' WHERE file_ID = {$edit_File->ID}"; |
2074 | @@ -212,7 +212,7 @@ | |||
2075 | 212 | $edited_Item = new Item(); | 212 | $edited_Item = new Item(); |
2076 | 213 | $edited_Item->insert( 1, T_('Emerald Pool, Yellowstone NP'), 'This image has all three attributes set to unique values, then this post was created with a unique title and content, then the image was attached to the post.', $now, $cat_yellowstone, array(), 'published','en-US' ); | 213 | $edited_Item->insert( 1, T_('Emerald Pool, Yellowstone NP'), 'This image has all three attributes set to unique values, then this post was created with a unique title and content, then the image was attached to the post.', $now, $cat_yellowstone, array(), 'published','en-US' ); |
2077 | 214 | // attach an image to the item | 214 | // attach an image to the item |
2079 | 215 | $edit_File = new File( 'collection', 4, 'emerald-pool-in-yellowstone.jpg' ); | 215 | $edit_File = new File( 'blog', 4, 'emerald-pool-in-yellowstone.jpg' ); |
2080 | 216 | $edit_File->link_to_Item( $edited_Item ); | 216 | $edit_File->link_to_Item( $edited_Item ); |
2081 | 217 | // add meta data for this image (only once per image!) | 217 | // add meta data for this image (only once per image!) |
2082 | 218 | $query = "UPDATE T_files SET file_title = 'Emerald Pool, Yellowstone', file_alt = 'Photo of Emerald Pool in Yellowstone', file_desc = 'This is the \"description/caption\" field for the file name \"emerald-pool-in-yellowstone.jpg\"' WHERE file_ID = {$edit_File->ID}"; | 218 | $query = "UPDATE T_files SET file_title = 'Emerald Pool, Yellowstone', file_alt = 'Photo of Emerald Pool in Yellowstone', file_desc = 'This is the \"description/caption\" field for the file name \"emerald-pool-in-yellowstone.jpg\"' WHERE file_ID = {$edit_File->ID}"; |
2083 | @@ -258,7 +258,7 @@ | |||
2084 | 258 | $edited_Item = new Item(); | 258 | $edited_Item = new Item(); |
2085 | 259 | $edited_Item->insert( 1, T_('Mammoth Hot Springs'), '', $now, $cat_yellowstone, array(), 'published','en-US' ); | 259 | $edited_Item->insert( 1, T_('Mammoth Hot Springs'), '', $now, $cat_yellowstone, array(), 'published','en-US' ); |
2086 | 260 | // attach an image to the item | 260 | // attach an image to the item |
2088 | 261 | $edit_File = new File( 'collection', 4, 'mammoth-hot-springs.jpg' ); | 261 | $edit_File = new File( 'blog', 4, 'mammoth-hot-springs.jpg' ); |
2089 | 262 | $edit_File->link_to_Item( $edited_Item ); | 262 | $edit_File->link_to_Item( $edited_Item ); |
2090 | 263 | // add meta data for this image (only once per image!) | 263 | // add meta data for this image (only once per image!) |
2091 | 264 | $query = "UPDATE T_files SET file_title = 'Mammoth Hot Springs', file_alt = 'Mammoth Hot Springs', file_desc = 'Free Stock Photo of Mammoth Hot Springs - Yellowstone - Travel, from public-domain-photos.com' WHERE file_ID = {$edit_File->ID}"; | 264 | $query = "UPDATE T_files SET file_title = 'Mammoth Hot Springs', file_alt = 'Mammoth Hot Springs', file_desc = 'Free Stock Photo of Mammoth Hot Springs - Yellowstone - Travel, from public-domain-photos.com' WHERE file_ID = {$edit_File->ID}"; |
2092 | @@ -317,7 +317,7 @@ | |||
2093 | 317 | $edited_Item = new Item(); | 317 | $edited_Item = new Item(); |
2094 | 318 | $edited_Item->insert( 1, T_('Morning Glory Pool'), 'This photo has some text like a normal blog post might.', $now, $cat_yellowstone, array(), 'published','en-US' ); | 318 | $edited_Item->insert( 1, T_('Morning Glory Pool'), 'This photo has some text like a normal blog post might.', $now, $cat_yellowstone, array(), 'published','en-US' ); |
2095 | 319 | // attach an image to the item | 319 | // attach an image to the item |
2097 | 320 | $edit_File = new File( 'collection', 4, 'morning-glory-pool.jpg' ); | 320 | $edit_File = new File( 'blog', 4, 'morning-glory-pool.jpg' ); |
2098 | 321 | $edit_File->link_to_Item( $edited_Item ); | 321 | $edit_File->link_to_Item( $edited_Item ); |
2099 | 322 | // add meta data for this image (only once per image!) | 322 | // add meta data for this image (only once per image!) |
2100 | 323 | $query = "UPDATE T_files SET file_title = 'Morning Glory Pool', file_alt = 'Morning Glory Pool', file_desc = 'Free Stock Photo of Morning Glory Pool - Yellowstone - Travel, from public-domain-photos.com' WHERE file_ID = {$edit_File->ID}"; | 323 | $query = "UPDATE T_files SET file_title = 'Morning Glory Pool', file_alt = 'Morning Glory Pool', file_desc = 'Free Stock Photo of Morning Glory Pool - Yellowstone - Travel, from public-domain-photos.com' WHERE file_ID = {$edit_File->ID}"; |
2101 | @@ -362,13 +362,13 @@ | |||
2102 | 362 | $edited_Item = new Item(); | 362 | $edited_Item = new Item(); |
2103 | 363 | $edited_Item->insert( 1, T_('2 pics in one post'), 'This post shows how you can attach more than one image to a post. All of the Yellowstone photos came from <a href="http://www.public-domain-photos.com/travel/yellowstone">Public-Domain-Photos</a>.', $now, $cat_yellowstone, array(), 'published','en-US' ); | 363 | $edited_Item->insert( 1, T_('2 pics in one post'), 'This post shows how you can attach more than one image to a post. All of the Yellowstone photos came from <a href="http://www.public-domain-photos.com/travel/yellowstone">Public-Domain-Photos</a>.', $now, $cat_yellowstone, array(), 'published','en-US' ); |
2104 | 364 | // attach an image to the item | 364 | // attach an image to the item |
2106 | 365 | $edit_File = new File( 'collection', 4, 'mammoth-hot-springs.jpg' ); | 365 | $edit_File = new File( 'blog', 4, 'mammoth-hot-springs.jpg' ); |
2107 | 366 | $edit_File->link_to_Item( $edited_Item ); | 366 | $edit_File->link_to_Item( $edited_Item ); |
2108 | 367 | // add meta data for this image (only once per image!) | 367 | // add meta data for this image (only once per image!) |
2109 | 368 | $query = "UPDATE T_files SET file_title = 'Mammoth Hot Springs', file_alt = 'Mammoth Hot Springs', file_desc = 'Mammoth Hot Springs.' WHERE file_ID = {$edit_File->ID}"; | 368 | $query = "UPDATE T_files SET file_title = 'Mammoth Hot Springs', file_alt = 'Mammoth Hot Springs', file_desc = 'Mammoth Hot Springs.' WHERE file_ID = {$edit_File->ID}"; |
2110 | 369 | $DB->query( $query ); | 369 | $DB->query( $query ); |
2111 | 370 | // attach another image to the item | 370 | // attach another image to the item |
2113 | 371 | $edit_File = new File( 'collection', 4, 'morning-glory-pool.jpg' ); | 371 | $edit_File = new File( 'blog', 4, 'morning-glory-pool.jpg' ); |
2114 | 372 | $edit_File->link_to_Item( $edited_Item ); | 372 | $edit_File->link_to_Item( $edited_Item ); |
2115 | 373 | // add meta data for this image (only once per image!) | 373 | // add meta data for this image (only once per image!) |
2116 | 374 | $query = "UPDATE T_files SET file_title = 'Morning Glory Pool', file_alt = 'Morning Glory Pool', file_desc = 'Morning Glory Pool.' WHERE file_ID = {$edit_File->ID}"; | 374 | $query = "UPDATE T_files SET file_title = 'Morning Glory Pool', file_alt = 'Morning Glory Pool', file_desc = 'Morning Glory Pool.' WHERE file_ID = {$edit_File->ID}"; |
2117 | @@ -551,7 +551,7 @@ | |||
2118 | 551 | 551 | ||
2119 | 552 | Image used compliments of <a href="http://www.flickr.com/photos/leeturner/sets/72157622986782395/with/4278672768/" title="inserted image sample" target="_blank">Lee Turner</a>'), $now, $cat_appname ); | 552 | Image used compliments of <a href="http://www.flickr.com/photos/leeturner/sets/72157622986782395/with/4278672768/" title="inserted image sample" target="_blank">Lee Turner</a>'), $now, $cat_appname ); |
2120 | 553 | // attach an image to the item | 553 | // attach an image to the item |
2122 | 554 | $edit_File = new File( 'collection', 2, 'waterfall.jpg' ); | 554 | $edit_File = new File( 'blog', 2, 'waterfall.jpg' ); |
2123 | 555 | $edit_File->link_to_Item( $edited_Item ); | 555 | $edit_File->link_to_Item( $edited_Item ); |
2124 | 556 | // add meta data for this image (only once per image!) | 556 | // add meta data for this image (only once per image!) |
2125 | 557 | $query = "UPDATE T_files SET file_title = 'waterfall', file_alt = 'waterfall', file_desc = 'waterfall' WHERE file_ID = {$edit_File->ID}"; | 557 | $query = "UPDATE T_files SET file_title = 'waterfall', file_alt = 'waterfall', file_desc = 'waterfall' WHERE file_ID = {$edit_File->ID}"; |
2126 | @@ -573,7 +573,7 @@ | |||
2127 | 573 | 573 | ||
2128 | 574 | Image used compliments of <a href="http://innervisions.org.uk/bimble/2008/08/sunshine-and-showers" title="attached image sample" target="_blank">Yabs</a>'), $now, $cat_appname ); | 574 | Image used compliments of <a href="http://innervisions.org.uk/bimble/2008/08/sunshine-and-showers" title="attached image sample" target="_blank">Yabs</a>'), $now, $cat_appname ); |
2129 | 575 | // attach an image to the item | 575 | // attach an image to the item |
2131 | 576 | $edit_File = new File( 'collection', 2, 'sunshine_and_flowers.jpeg' ); | 576 | $edit_File = new File( 'blog', 2, 'sunshine_and_flowers.jpeg' ); |
2132 | 577 | $edit_File->link_to_Item( $edited_Item ); | 577 | $edit_File->link_to_Item( $edited_Item ); |
2133 | 578 | // add meta data for this image (do once per default image!) | 578 | // add meta data for this image (do once per default image!) |
2134 | 579 | $query = "UPDATE T_files SET file_title = 'Coral Jupiter', file_alt = 'home grown flowers', file_desc = 'Coral Jupiter - home grown flowers (caption/description field)' WHERE file_ID = {$edit_File->ID}"; | 579 | $query = "UPDATE T_files SET file_title = 'Coral Jupiter', file_alt = 'home grown flowers', file_desc = 'Coral Jupiter - home grown flowers (caption/description field)' WHERE file_ID = {$edit_File->ID}"; |
2135 | 580 | 580 | ||
2136 | === modified file 'qp_install/_functions_dbupgrade.php' | |||
2137 | --- qp_install/_functions_dbupgrade.php 2013-03-22 21:28:25 +0000 | |||
2138 | +++ qp_install/_functions_dbupgrade.php 2013-04-18 18:37:26 +0000 | |||
2139 | @@ -873,6 +873,303 @@ | |||
2140 | 873 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | 873 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); |
2141 | 874 | } | 874 | } |
2142 | 875 | 875 | ||
2143 | 876 | if( $cur_db_version < 44 ) | ||
2144 | 877 | { | ||
2145 | 878 | $cur_db_version++; | ||
2146 | 879 | echo 'Renaming the bloggroups table to blog_groups ... '; | ||
2147 | 880 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."bloggroups RENAME TO ".$app_db_tableprefix."blog_groups" ) !== false ) | ||
2148 | 881 | { | ||
2149 | 882 | set_upgrade_checkpoint( $cur_db_version ); | ||
2150 | 883 | } | ||
2151 | 884 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2152 | 885 | } | ||
2153 | 886 | |||
2154 | 887 | if( $cur_db_version < 45 ) | ||
2155 | 888 | { | ||
2156 | 889 | $cur_db_version++; | ||
2157 | 890 | echo 'Renaming the coll_settings table to blog_settings ... '; | ||
2158 | 891 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."coll_settings RENAME TO ".$app_db_tableprefix."blog_settings" ) !== false ) | ||
2159 | 892 | { | ||
2160 | 893 | set_upgrade_checkpoint( $cur_db_version ); | ||
2161 | 894 | } | ||
2162 | 895 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2163 | 896 | } | ||
2164 | 897 | |||
2165 | 898 | if( $cur_db_version < 46 ) | ||
2166 | 899 | { | ||
2167 | 900 | $cur_db_version++; | ||
2168 | 901 | echo 'Renaming the blogusers table to blog_users ... '; | ||
2169 | 902 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."blogusers RENAME TO ".$app_db_tableprefix."blog_users" ) !== false ) | ||
2170 | 903 | { | ||
2171 | 904 | set_upgrade_checkpoint( $cur_db_version ); | ||
2172 | 905 | } | ||
2173 | 906 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2174 | 907 | } | ||
2175 | 908 | |||
2176 | 909 | if( $cur_db_version < 47 ) | ||
2177 | 910 | { | ||
2178 | 911 | $cur_db_version++; | ||
2179 | 912 | echo 'Renaming the cron__log table to cron_log ... '; | ||
2180 | 913 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."cron__log RENAME TO ".$app_db_tableprefix."cron_log" ) !== false ) | ||
2181 | 914 | { | ||
2182 | 915 | set_upgrade_checkpoint( $cur_db_version ); | ||
2183 | 916 | } | ||
2184 | 917 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2185 | 918 | } | ||
2186 | 919 | |||
2187 | 920 | if( $cur_db_version < 48 ) | ||
2188 | 921 | { | ||
2189 | 922 | $cur_db_version++; | ||
2190 | 923 | echo 'Renaming the cron__task table to cron_task ... '; | ||
2191 | 924 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."cron__task RENAME TO ".$app_db_tableprefix."cron_task" ) !== false ) | ||
2192 | 925 | { | ||
2193 | 926 | set_upgrade_checkpoint( $cur_db_version ); | ||
2194 | 927 | } | ||
2195 | 928 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2196 | 929 | } | ||
2197 | 930 | |||
2198 | 931 | if( $cur_db_version < 49 ) | ||
2199 | 932 | { | ||
2200 | 933 | $cur_db_version++; | ||
2201 | 934 | echo 'Renaming the items__item table to items ... '; | ||
2202 | 935 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."items__item RENAME TO ".$app_db_tableprefix."items" ) !== false ) | ||
2203 | 936 | { | ||
2204 | 937 | set_upgrade_checkpoint( $cur_db_version ); | ||
2205 | 938 | } | ||
2206 | 939 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2207 | 940 | } | ||
2208 | 941 | |||
2209 | 942 | if( $cur_db_version < 50 ) | ||
2210 | 943 | { | ||
2211 | 944 | $cur_db_version++; | ||
2212 | 945 | echo 'Renaming the postcats table to item_cats ... '; | ||
2213 | 946 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."postcats RENAME TO ".$app_db_tableprefix."item_cats" ) !== false ) | ||
2214 | 947 | { | ||
2215 | 948 | set_upgrade_checkpoint( $cur_db_version ); | ||
2216 | 949 | } | ||
2217 | 950 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2218 | 951 | } | ||
2219 | 952 | |||
2220 | 953 | if( $cur_db_version < 51 ) | ||
2221 | 954 | { | ||
2222 | 955 | $cur_db_version++; | ||
2223 | 956 | echo 'Renaming the items__prerendering table to item_prerendering ... '; | ||
2224 | 957 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."items__prerendering RENAME TO ".$app_db_tableprefix."item_prerendering" ) !== false ) | ||
2225 | 958 | { | ||
2226 | 959 | set_upgrade_checkpoint( $cur_db_version ); | ||
2227 | 960 | } | ||
2228 | 961 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2229 | 962 | } | ||
2230 | 963 | |||
2231 | 964 | if( $cur_db_version < 52 ) | ||
2232 | 965 | { | ||
2233 | 966 | $cur_db_version++; | ||
2234 | 967 | echo 'Renaming the items__status table to item_status ... '; | ||
2235 | 968 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."items__status RENAME TO ".$app_db_tableprefix."item_status" ) !== false ) | ||
2236 | 969 | { | ||
2237 | 970 | set_upgrade_checkpoint( $cur_db_version ); | ||
2238 | 971 | } | ||
2239 | 972 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2240 | 973 | } | ||
2241 | 974 | |||
2242 | 975 | if( $cur_db_version < 53 ) | ||
2243 | 976 | { | ||
2244 | 977 | $cur_db_version++; | ||
2245 | 978 | echo 'Renaming the items__itemtag table to item_tags ... '; | ||
2246 | 979 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."items__itemtag RENAME TO ".$app_db_tableprefix."item_tags" ) !== false ) | ||
2247 | 980 | { | ||
2248 | 981 | set_upgrade_checkpoint( $cur_db_version ); | ||
2249 | 982 | } | ||
2250 | 983 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2251 | 984 | } | ||
2252 | 985 | |||
2253 | 986 | if( $cur_db_version < 54 ) | ||
2254 | 987 | { | ||
2255 | 988 | $cur_db_version++; | ||
2256 | 989 | echo 'Renaming the items__type table to item_types ... '; | ||
2257 | 990 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."items__type RENAME TO ".$app_db_tableprefix."item_types" ) !== false ) | ||
2258 | 991 | { | ||
2259 | 992 | set_upgrade_checkpoint( $cur_db_version ); | ||
2260 | 993 | } | ||
2261 | 994 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2262 | 995 | } | ||
2263 | 996 | |||
2264 | 997 | if( $cur_db_version < 55 ) | ||
2265 | 998 | { | ||
2266 | 999 | $cur_db_version++; | ||
2267 | 1000 | echo 'Renaming the items__version table to item_versions ... '; | ||
2268 | 1001 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."items__version RENAME TO ".$app_db_tableprefix."item_versions" ) !== false ) | ||
2269 | 1002 | { | ||
2270 | 1003 | set_upgrade_checkpoint( $cur_db_version ); | ||
2271 | 1004 | } | ||
2272 | 1005 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2273 | 1006 | } | ||
2274 | 1007 | |||
2275 | 1008 | if( $cur_db_version < 56 ) | ||
2276 | 1009 | { | ||
2277 | 1010 | $cur_db_version++; | ||
2278 | 1011 | echo 'Renaming the pluginevents table to plugin_events ... '; | ||
2279 | 1012 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."pluginevents RENAME TO ".$app_db_tableprefix."plugin_events" ) !== false ) | ||
2280 | 1013 | { | ||
2281 | 1014 | set_upgrade_checkpoint( $cur_db_version ); | ||
2282 | 1015 | } | ||
2283 | 1016 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2284 | 1017 | } | ||
2285 | 1018 | |||
2286 | 1019 | if( $cur_db_version < 57 ) | ||
2287 | 1020 | { | ||
2288 | 1021 | $cur_db_version++; | ||
2289 | 1022 | echo 'Renaming the pluginsettings table to plugin_settings ... '; | ||
2290 | 1023 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."pluginsettings RENAME TO ".$app_db_tableprefix."plugin_settings" ) !== false ) | ||
2291 | 1024 | { | ||
2292 | 1025 | set_upgrade_checkpoint( $cur_db_version ); | ||
2293 | 1026 | } | ||
2294 | 1027 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2295 | 1028 | } | ||
2296 | 1029 | |||
2297 | 1030 | if( $cur_db_version < 58 ) | ||
2298 | 1031 | { | ||
2299 | 1032 | $cur_db_version++; | ||
2300 | 1033 | echo 'Renaming the pluginusersettings table to plugin_usersettings ... '; | ||
2301 | 1034 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."pluginusersettings RENAME TO ".$app_db_tableprefix."plugin_usersettings" ) !== false ) | ||
2302 | 1035 | { | ||
2303 | 1036 | set_upgrade_checkpoint( $cur_db_version ); | ||
2304 | 1037 | } | ||
2305 | 1038 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2306 | 1039 | } | ||
2307 | 1040 | |||
2308 | 1041 | if( $cur_db_version < 59 ) | ||
2309 | 1042 | { | ||
2310 | 1043 | $cur_db_version++; | ||
2311 | 1044 | echo 'Renaming the items__tag table to tags ... '; | ||
2312 | 1045 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."items__tag RENAME TO ".$app_db_tableprefix."tags" ) !== false ) | ||
2313 | 1046 | { | ||
2314 | 1047 | set_upgrade_checkpoint( $cur_db_version ); | ||
2315 | 1048 | } | ||
2316 | 1049 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2317 | 1050 | } | ||
2318 | 1051 | |||
2319 | 1052 | if( $cur_db_version < 60 ) | ||
2320 | 1053 | { | ||
2321 | 1054 | $cur_db_version++; | ||
2322 | 1055 | echo 'Renaming the templates__template table to templates ... '; | ||
2323 | 1056 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."templates__template RENAME TO ".$app_db_tableprefix."templates" ) !== false ) | ||
2324 | 1057 | { | ||
2325 | 1058 | set_upgrade_checkpoint( $cur_db_version ); | ||
2326 | 1059 | } | ||
2327 | 1060 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2328 | 1061 | } | ||
2329 | 1062 | |||
2330 | 1063 | if( $cur_db_version < 61 ) | ||
2331 | 1064 | { | ||
2332 | 1065 | $cur_db_version++; | ||
2333 | 1066 | echo 'Renaming the templates__container table to template_containers ... '; | ||
2334 | 1067 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."templates__container RENAME TO ".$app_db_tableprefix."template_containers" ) !== false ) | ||
2335 | 1068 | { | ||
2336 | 1069 | set_upgrade_checkpoint( $cur_db_version ); | ||
2337 | 1070 | } | ||
2338 | 1071 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2339 | 1072 | } | ||
2340 | 1073 | |||
2341 | 1074 | if( $cur_db_version < 62 ) | ||
2342 | 1075 | { | ||
2343 | 1076 | $cur_db_version++; | ||
2344 | 1077 | echo 'Renaming the usersettings table to user_settings ... '; | ||
2345 | 1078 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."usersettings RENAME TO ".$app_db_tableprefix."user_settings" ) !== false ) | ||
2346 | 1079 | { | ||
2347 | 1080 | set_upgrade_checkpoint( $cur_db_version ); | ||
2348 | 1081 | } | ||
2349 | 1082 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2350 | 1083 | } | ||
2351 | 1084 | |||
2352 | 1085 | if( $cur_db_version < 63 ) | ||
2353 | 1086 | { | ||
2354 | 1087 | $cur_db_version++; | ||
2355 | 1088 | echo 'Renaming the widget table to widgets ... '; | ||
2356 | 1089 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."widget RENAME TO ".$app_db_tableprefix."widgets" ) !== false ) | ||
2357 | 1090 | { | ||
2358 | 1091 | set_upgrade_checkpoint( $cur_db_version ); | ||
2359 | 1092 | } | ||
2360 | 1093 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2361 | 1094 | } | ||
2362 | 1095 | |||
2363 | 1096 | if( $cur_db_version < 64 ) | ||
2364 | 1097 | { | ||
2365 | 1098 | $cur_db_version++; | ||
2366 | 1099 | echo 'Renaming the track__keyphrase table to keyphrases ... '; | ||
2367 | 1100 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."track__keyphrase RENAME TO ".$app_db_tableprefix."keyphrases" ) !== false ) | ||
2368 | 1101 | { | ||
2369 | 1102 | set_upgrade_checkpoint( $cur_db_version ); | ||
2370 | 1103 | } | ||
2371 | 1104 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2372 | 1105 | } | ||
2373 | 1106 | |||
2374 | 1107 | if( $cur_db_version < 65 ) | ||
2375 | 1108 | { | ||
2376 | 1109 | $cur_db_version++; | ||
2377 | 1110 | echo 'Renaming the track__goal table to goals ... '; | ||
2378 | 1111 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."track__goal RENAME TO ".$app_db_tableprefix."goals" ) !== false ) | ||
2379 | 1112 | { | ||
2380 | 1113 | set_upgrade_checkpoint( $cur_db_version ); | ||
2381 | 1114 | } | ||
2382 | 1115 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2383 | 1116 | } | ||
2384 | 1117 | |||
2385 | 1118 | if( $cur_db_version < 66 ) | ||
2386 | 1119 | { | ||
2387 | 1120 | $cur_db_version++; | ||
2388 | 1121 | echo 'Renaming the track__goalhit table to goal_hits ... '; | ||
2389 | 1122 | if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."track__goalhit RENAME TO ".$app_db_tableprefix."goal_hits" ) !== false ) | ||
2390 | 1123 | { | ||
2391 | 1124 | set_upgrade_checkpoint( $cur_db_version ); | ||
2392 | 1125 | } | ||
2393 | 1126 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2394 | 1127 | } | ||
2395 | 1128 | |||
2396 | 1129 | if( $cur_db_version < 67 ) | ||
2397 | 1130 | { | ||
2398 | 1131 | $cur_db_version++; | ||
2399 | 1132 | echo 'Removing ptyp_ID = 1600 from item_types table ... '; | ||
2400 | 1133 | if( $DB->query( "DELETE FROM ".$app_db_tableprefix."item_types WHERE ptyp_ID = 1600" ) !== false ) | ||
2401 | 1134 | { | ||
2402 | 1135 | set_upgrade_checkpoint( $cur_db_version ); | ||
2403 | 1136 | } | ||
2404 | 1137 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2405 | 1138 | } | ||
2406 | 1139 | |||
2407 | 1140 | if( $cur_db_version < 68 ) | ||
2408 | 1141 | { | ||
2409 | 1142 | $cur_db_version++; | ||
2410 | 1143 | echo 'Modifying file_root_type in the files table ... '; | ||
2411 | 1144 | if( db_mod_col( $app_db_tableprefix."files", "file_root_type", "ENUM('absolute','user','blog','shared','templates','collection') NOT NULL DEFAULT 'absolute'" ) !== false ) | ||
2412 | 1145 | { | ||
2413 | 1146 | set_upgrade_checkpoint( $cur_db_version ); | ||
2414 | 1147 | } | ||
2415 | 1148 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2416 | 1149 | } | ||
2417 | 1150 | |||
2418 | 1151 | if( $cur_db_version < 69 ) | ||
2419 | 1152 | { | ||
2420 | 1153 | $cur_db_version++; | ||
2421 | 1154 | echo 'Updating file_root_type in the files table ... '; | ||
2422 | 1155 | if( $DB->query( "UPDATE ".$app_db_tableprefix."files SET template_type = REPLACE( file_root_type, 'collection', 'blog' )" ) !== false ) | ||
2423 | 1156 | { | ||
2424 | 1157 | set_upgrade_checkpoint( $cur_db_version ); | ||
2425 | 1158 | } | ||
2426 | 1159 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2427 | 1160 | } | ||
2428 | 1161 | |||
2429 | 1162 | if( $cur_db_version < 70 ) | ||
2430 | 1163 | { | ||
2431 | 1164 | $cur_db_version++; | ||
2432 | 1165 | echo 'Modifying file_root_type in the files table ... '; | ||
2433 | 1166 | if( db_mod_col( $app_db_tableprefix."files", "file_root_type", "ENUM('absolute','user','blog','shared','templates') NOT NULL DEFAULT 'absolute'" ) !== false ) | ||
2434 | 1167 | { | ||
2435 | 1168 | set_upgrade_checkpoint( $cur_db_version ); | ||
2436 | 1169 | } | ||
2437 | 1170 | else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version ); | ||
2438 | 1171 | } | ||
2439 | 1172 | |||
2440 | 876 | // ----------------------------------------------------------------------------------------- | 1173 | // ----------------------------------------------------------------------------------------- |
2441 | 877 | // Remember changing the DB schema, too! Check out these files: | 1174 | // Remember changing the DB schema, too! Check out these files: |
2442 | 878 | // - qp_inc/_core/model/__core.install.php | 1175 | // - qp_inc/_core/model/__core.install.php |
2443 | 879 | 1176 | ||
2444 | === modified file 'qp_plugins/smilies_plugin/_smilies.plugin.php' | |||
2445 | --- qp_plugins/smilies_plugin/_smilies.plugin.php 2013-03-22 21:28:25 +0000 | |||
2446 | +++ qp_plugins/smilies_plugin/_smilies.plugin.php 2013-04-18 18:37:26 +0000 | |||
2447 | @@ -172,7 +172,12 @@ | |||
2448 | 172 | */ | 172 | */ |
2449 | 173 | function DisplayCommentToolbar( & $params ) | 173 | function DisplayCommentToolbar( & $params ) |
2450 | 174 | { | 174 | { |
2452 | 175 | if( ( $this->Settings->get( 'render_comments' ) ) || ( is_logged_in() && $this->UserSettings->get( 'use_toolbar' ) ) ) | 175 | $user_wants_toolbar = false; |
2453 | 176 | if( is_logged_in() && ! is_null( $this->UserSettings ) ) | ||
2454 | 177 | { | ||
2455 | 178 | $user_wants_toolbar = $this->UserSettings->get( 'use_toolbar' ); | ||
2456 | 179 | } | ||
2457 | 180 | if( ( $this->Settings->get( 'render_comments' ) ) || $user_wants_toolbar ) | ||
2458 | 176 | { | 181 | { |
2459 | 177 | return $this->make_the_toolbar( $params ); | 182 | return $this->make_the_toolbar( $params ); |
2460 | 178 | } | 183 | } |
2461 | 179 | 184 | ||
2462 | === modified file 'qp_srvc/profile_update.php' | |||
2463 | --- qp_srvc/profile_update.php 2013-03-22 21:28:25 +0000 | |||
2464 | +++ qp_srvc/profile_update.php 2013-04-18 18:37:26 +0000 | |||
2465 | @@ -88,7 +88,10 @@ | |||
2466 | 88 | 88 | ||
2467 | 89 | $current_User->set( 'firstname', $newuser_firstname ); | 89 | $current_User->set( 'firstname', $newuser_firstname ); |
2468 | 90 | $current_User->set( 'lastname', $newuser_lastname ); | 90 | $current_User->set( 'lastname', $newuser_lastname ); |
2470 | 91 | $current_User->set( 'nickname', $newuser_nickname ); | 91 | if( ! $lock_id_and_nick ) |
2471 | 92 | { | ||
2472 | 93 | $current_User->set( 'nickname', $newuser_nickname ); | ||
2473 | 94 | } | ||
2474 | 92 | $current_User->set_email( $newuser_email ); | 95 | $current_User->set_email( $newuser_email ); |
2475 | 93 | $current_User->set( 'url', $newuser_url ); | 96 | $current_User->set( 'url', $newuser_url ); |
2476 | 94 | $current_User->set( 'idmode', $newuser_idmode ); | 97 | $current_User->set( 'idmode', $newuser_idmode ); |
2477 | 95 | 98 | ||
2478 | === modified file 'qp_srvc/register.php' | |||
2479 | --- qp_srvc/register.php 2013-03-22 21:28:25 +0000 | |||
2480 | +++ qp_srvc/register.php 2013-04-18 18:37:26 +0000 | |||
2481 | @@ -67,6 +67,7 @@ | |||
2482 | 67 | ) ); | 67 | ) ); |
2483 | 68 | 68 | ||
2484 | 69 | // all logins to be lowercase to guarantee uniqueness regardless of the database case handling for UNIQUE indexes | 69 | // all logins to be lowercase to guarantee uniqueness regardless of the database case handling for UNIQUE indexes |
2485 | 70 | $login_raw = $login; | ||
2486 | 70 | $login = strtolower( $login ); | 71 | $login = strtolower( $login ); |
2487 | 71 | 72 | ||
2488 | 72 | $UserCache = & get_Cache( 'UserCache' ); | 73 | $UserCache = & get_Cache( 'UserCache' ); |
2489 | @@ -86,7 +87,7 @@ | |||
2490 | 86 | $new_User = new User(); | 87 | $new_User = new User(); |
2491 | 87 | $new_User->set( 'login', $login ); | 88 | $new_User->set( 'login', $login ); |
2492 | 88 | $new_User->set( 'pass', md5( $pass1 ) ); // encrypted | 89 | $new_User->set( 'pass', md5( $pass1 ) ); // encrypted |
2494 | 89 | $new_User->set( 'nickname', $login ); | 90 | $new_User->set( 'nickname', $login_raw ); |
2495 | 90 | $new_User->set_email( $email ); | 91 | $new_User->set_email( $email ); |
2496 | 91 | $new_User->set( 'ip', $Hit->IP ); | 92 | $new_User->set( 'ip', $Hit->IP ); |
2497 | 92 | $new_User->set( 'domain', $Hit->get_remote_host( true ) ); | 93 | $new_User->set( 'domain', $Hit->get_remote_host( true ) ); |