@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
13 | 13 | $origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76; |
14 | -$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : NULL; |
|
14 | +$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : null; |
|
15 | 15 | |
16 | 16 | $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); |
17 | 17 | $tbl_site_templates = $modx->getFullTableName('site_templates'); |
@@ -190,13 +190,13 @@ discard block |
||
190 | 190 | $orderby = trim($orderby); |
191 | 191 | $limit = trim($limit); |
192 | 192 | if ($where !== '' && stripos($where, 'WHERE') !== 0) { |
193 | - $where = "WHERE {$where}"; |
|
193 | + $where = "where {$where}"; |
|
194 | 194 | } |
195 | 195 | if ($orderby !== '' && stripos($orderby, 'ORDER BY') !== 0) { |
196 | 196 | $orderby = "ORDER BY {$orderby}"; |
197 | 197 | } |
198 | 198 | if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) { |
199 | - $limit = "LIMIT {$limit}"; |
|
199 | + $limit = "limit {$limit}"; |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | return $this->query("DELETE FROM {$from} {$where} {$orderby} {$limit}"); |
@@ -228,16 +228,16 @@ discard block |
||
228 | 228 | $orderby = trim($orderby); |
229 | 229 | $limit = trim($limit); |
230 | 230 | if ($where !== '' && stripos($where, 'WHERE') !== 0) { |
231 | - $where = "WHERE {$where}"; |
|
231 | + $where = "where {$where}"; |
|
232 | 232 | } |
233 | 233 | if ($orderby !== '' && stripos($orderby, 'ORDER') !== 0) { |
234 | 234 | $orderby = "ORDER BY {$orderby}"; |
235 | 235 | } |
236 | 236 | if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) { |
237 | - $limit = "LIMIT {$limit}"; |
|
237 | + $limit = "limit {$limit}"; |
|
238 | 238 | } |
239 | 239 | |
240 | - return $this->query("SELECT {$fields} FROM {$from} {$where} {$orderby} {$limit}"); |
|
240 | + return $this->query("select {$fields} FROM {$from} {$where} {$orderby} {$limit}"); |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | public function update($fields, $table, $where = "") |
@@ -260,10 +260,10 @@ discard block |
||
260 | 260 | } |
261 | 261 | $where = trim($where); |
262 | 262 | if ($where !== '' && stripos($where, 'WHERE') !== 0) { |
263 | - $where = "WHERE {$where}"; |
|
263 | + $where = "where {$where}"; |
|
264 | 264 | } |
265 | 265 | |
266 | - return $this->query("UPDATE {$table} SET {$fields} {$where}"); |
|
266 | + return $this->query("update {$table} SET {$fields} {$where}"); |
|
267 | 267 | } |
268 | 268 | } |
269 | 269 | |
@@ -287,10 +287,10 @@ discard block |
||
287 | 287 | $where = trim($where); |
288 | 288 | $limit = trim($limit); |
289 | 289 | if ($where !== '' && stripos($where, 'WHERE') !== 0) { |
290 | - $where = "WHERE {$where}"; |
|
290 | + $where = "where {$where}"; |
|
291 | 291 | } |
292 | 292 | if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) { |
293 | - $limit = "LIMIT {$limit}"; |
|
293 | + $limit = "limit {$limit}"; |
|
294 | 294 | } |
295 | 295 | $rt = $this->query("INSERT INTO {$intotable} {$fields} SELECT {$fromfields} FROM {$fromtable} {$where} {$limit}"); |
296 | 296 | } |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | |
540 | 540 | public function truncate($table_name) |
541 | 541 | { |
542 | - $rs = $this->query("TRUNCATE {$table_name}"); |
|
542 | + $rs = $this->query("truncate {$table_name}"); |
|
543 | 543 | |
544 | 544 | return $rs; |
545 | 545 | } |
@@ -280,13 +280,13 @@ discard block |
||
280 | 280 | $orderby = trim($orderby); |
281 | 281 | $limit = trim($limit); |
282 | 282 | if ($where !== '' && stripos($where, 'WHERE') !== 0) { |
283 | - $where = "WHERE {$where}"; |
|
283 | + $where = "where {$where}"; |
|
284 | 284 | } |
285 | 285 | if ($orderby !== '' && stripos($orderby, 'ORDER BY') !== 0) { |
286 | 286 | $orderby = "ORDER BY {$orderby}"; |
287 | 287 | } |
288 | 288 | if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) { |
289 | - $limit = "LIMIT {$limit}"; |
|
289 | + $limit = "limit {$limit}"; |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | return $this->query("DELETE FROM {$from} {$where} {$orderby} {$limit}"); |
@@ -322,16 +322,16 @@ discard block |
||
322 | 322 | $orderby = trim($orderby); |
323 | 323 | $limit = trim($limit); |
324 | 324 | if ($where !== '' && stripos($where, 'WHERE') !== 0) { |
325 | - $where = "WHERE {$where}"; |
|
325 | + $where = "where {$where}"; |
|
326 | 326 | } |
327 | 327 | if ($orderby !== '' && stripos($orderby, 'ORDER') !== 0) { |
328 | 328 | $orderby = "ORDER BY {$orderby}"; |
329 | 329 | } |
330 | 330 | if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) { |
331 | - $limit = "LIMIT {$limit}"; |
|
331 | + $limit = "limit {$limit}"; |
|
332 | 332 | } |
333 | 333 | |
334 | - return $this->query("SELECT {$fields} FROM {$from} {$where} {$orderby} {$limit}"); |
|
334 | + return $this->query("select {$fields} FROM {$from} {$where} {$orderby} {$limit}"); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | /** |
@@ -358,10 +358,10 @@ discard block |
||
358 | 358 | } |
359 | 359 | $where = trim($where); |
360 | 360 | if ($where !== '' && stripos($where, 'WHERE') !== 0) { |
361 | - $where = "WHERE {$where}"; |
|
361 | + $where = "where {$where}"; |
|
362 | 362 | } |
363 | 363 | |
364 | - return $this->query("UPDATE {$table} SET {$fields} {$where}"); |
|
364 | + return $this->query("update {$table} SET {$fields} {$where}"); |
|
365 | 365 | } |
366 | 366 | } |
367 | 367 | |
@@ -390,10 +390,10 @@ discard block |
||
390 | 390 | $where = trim($where); |
391 | 391 | $limit = trim($limit); |
392 | 392 | if ($where !== '' && stripos($where, 'WHERE') !== 0) { |
393 | - $where = "WHERE {$where}"; |
|
393 | + $where = "where {$where}"; |
|
394 | 394 | } |
395 | 395 | if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) { |
396 | - $limit = "LIMIT {$limit}"; |
|
396 | + $limit = "limit {$limit}"; |
|
397 | 397 | } |
398 | 398 | $rt = $this->query("INSERT INTO {$intotable} {$fields} SELECT {$fromfields} FROM {$fromtable} {$where} {$limit}"); |
399 | 399 | } else { |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | |
733 | 733 | public function truncate($table_name) |
734 | 734 | { |
735 | - $rs = $this->query("TRUNCATE {$table_name}"); |
|
735 | + $rs = $this->query("truncate {$table_name}"); |
|
736 | 736 | |
737 | 737 | return $rs; |
738 | 738 | } |
@@ -229,7 +229,7 @@ |
||
229 | 229 | { // needs making a folder |
230 | 230 | $end_dir = ($row['alias']!=='') ? $row['alias'] : $row['id']; |
231 | 231 | $dir_path = $dirpath . $end_dir; |
232 | - if(strpos($dir_path,MODX_BASE_PATH)===false) return FALSE; |
|
232 | + if(strpos($dir_path,MODX_BASE_PATH)===false) return false; |
|
233 | 233 | if (!is_dir($dir_path)) |
234 | 234 | { |
235 | 235 | if (is_file($dir_path)) @unlink($dir_path); |
@@ -349,7 +349,7 @@ |
||
349 | 349 | $conditional = implode(' ',$this->condition); |
350 | 350 | $isvalid = (int)(eval("return ({$conditional});")); |
351 | 351 | if ($isvalid) return $this->srcValue; |
352 | - return NULL; |
|
352 | + return null; |
|
353 | 353 | case 'then': |
354 | 354 | $conditional = implode(' ',$this->condition); |
355 | 355 | $isvalid = (int)eval("return ({$conditional});"); |