Completed
Push — master ( 843c8c...eb00b7 )
by Stanislav
19s queued 15s
created
core/auth/level.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -14,27 +14,27 @@  discard block
 block discarded – undo
14 14
 {
15 15
 
16 16
 	/**
17
-	* Gallery Auth Object
18
-	* @var \phpbbgallery\core\auth\auth
19
-	*/
17
+	 * Gallery Auth Object
18
+	 * @var \phpbbgallery\core\auth\auth
19
+	 */
20 20
 	protected $auth;
21 21
 
22 22
 	/**
23
-	* Config Object
24
-	* @var \phpbb\config\config
25
-	*/
23
+	 * Config Object
24
+	 * @var \phpbb\config\config
25
+	 */
26 26
 	protected $config;
27 27
 
28 28
 	/**
29
-	* Template Object
30
-	* @var \phpbb\template\template
31
-	*/
29
+	 * Template Object
30
+	 * @var \phpbb\template\template
31
+	 */
32 32
 	protected $template;
33 33
 
34 34
 	/**
35
-	* User Object
36
-	* @var \phpbb\user
37
-	*/
35
+	 * User Object
36
+	 * @var \phpbb\user
37
+	 */
38 38
 	protected $user;
39 39
 
40 40
 	/**
@@ -62,17 +62,17 @@  discard block
 block discarded – undo
62 62
 	}
63 63
 
64 64
 	/**
65
-	* User authorisation levels output
66
-	*
67
-	* @param	int		$album_id		The current album the user is in.
68
-	* @param	int		$album_status	The albums status bit.
69
-	* @param	int		$album_user_id	The user-id of the album owner. Saves us a call to the cache if it is set.
70
-	* @return		null
71
-	*
72
-	* borrowed from phpBB3
73
-	* @author: phpBB Group
74
-	* @function: gen_forum_auth_level
75
-	*/
65
+	 * User authorisation levels output
66
+	 *
67
+	 * @param	int		$album_id		The current album the user is in.
68
+	 * @param	int		$album_status	The albums status bit.
69
+	 * @param	int		$album_user_id	The user-id of the album owner. Saves us a call to the cache if it is set.
70
+	 * @return		null
71
+	 *
72
+	 * borrowed from phpBB3
73
+	 * @author: phpBB Group
74
+	 * @function: gen_forum_auth_level
75
+	 */
76 76
 	public function display($album_id, $album_status, $album_user_id = -1)
77 77
 	{
78 78
 		$locked = ($album_status == ITEM_LOCKED && !$this->auth->acl_check('m_', $album_id, $album_user_id)) ? true : false;
Please login to merge, or discard this patch.
acpimport/acp/main_module.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 			foreach ($images as $image_src)
59 59
 			{
60 60
 				/**
61
-				* Import the images
62
-				*/
61
+				 * Import the images
62
+				 */
63 63
 
64 64
 				$image_src = str_replace("{{$import_schema}}", "'", $image_src);
65 65
 				$image_src_full = $gallery_url->path('import') . utf8_decode($image_src);
@@ -160,21 +160,21 @@  discard block
 block discarded – undo
160 160
 						$additional_sql_data = [];
161 161
 
162 162
 						/**
163
-						* Event to trigger before mass update
164
-						*
165
-						* @event phpbbgallery.acpimport.update_image_before
166
-						* @var	array	additional_sql_data		array of additional sql_data
167
-						* @var	string	file_link				String with real file link
168
-						* @since 1.2.0
169
-						*/
163
+						 * Event to trigger before mass update
164
+						 *
165
+						 * @event phpbbgallery.acpimport.update_image_before
166
+						 * @var	array	additional_sql_data		array of additional sql_data
167
+						 * @var	string	file_link				String with real file link
168
+						 * @since 1.2.0
169
+						 */
170 170
 						$vars = array('additional_sql_data', 'file_link');
171 171
 						extract($phpbb_dispatcher->trigger_event('phpbbgallery.acpimport.update_image_before', compact($vars)));
172 172
 
173 173
 						if (($filetype[0] > $gallery_config->get('max_width')) || ($filetype[1] > $gallery_config->get('max_height')))
174 174
 						{
175 175
 							/**
176
-							* Resize oversize images
177
-							*/
176
+							 * Resize oversize images
177
+							 */
178 178
 							if ($gallery_config->get('allow_resize'))
179 179
 							{
180 180
 								$image_tools->resize_image($gallery_config->get('max_width'), $gallery_config->get('max_height'));
@@ -187,13 +187,13 @@  discard block
 block discarded – undo
187 187
 						$file_updated = (bool) $image_tools->resized;
188 188
 
189 189
 						/**
190
-						* Event to trigger before mass update
191
-						*
192
-						* @event phpbbgallery.acpimport.update_image
193
-						* @var	array	additional_sql_data		array of additional sql_data
194
-						* @var	bool	file_updated			is file resized
195
-						* @since 1.2.0
196
-						*/
190
+						 * Event to trigger before mass update
191
+						 *
192
+						 * @event phpbbgallery.acpimport.update_image
193
+						 * @var	array	additional_sql_data		array of additional sql_data
194
+						 * @var	bool	file_updated			is file resized
195
+						 * @since 1.2.0
196
+						 */
197 197
 						$vars = array('additional_sql_data', 'file_updated');
198 198
 						extract($phpbb_dispatcher->trigger_event('phpbbgallery.acpimport.update_image', compact($vars)));
199 199
 
Please login to merge, or discard this patch.
core/album/manage.php 1 patch
Braces   +26 added lines, -52 removed lines patch added patch discarded remove patch
@@ -216,8 +216,7 @@  discard block
 block discarded – undo
216 216
 			if ($this->user->data['user_timezone'] == '')
217 217
 			{
218 218
 				$timezone = 'UTC';
219
-			}
220
-			else
219
+			} else
221 220
 			{
222 221
 				$timezone = $this->user->data['user_timezone'];
223 222
 			}
@@ -229,8 +228,7 @@  discard block
 block discarded – undo
229 228
 			{
230 229
 				$errors[] = sprintf($this->language->lang('CONTEST_START_INVALID'), $contest_data['contest_start']);
231 230
 				$start_date_error = true;
232
-			}
233
-			else
231
+			} else
234 232
 			{
235 233
 				$contest_data['contest_start'] = gmmktime((int) $m[4], (int) $m[5], 0, (int) $m[2], (int) $m[3], (int) $m[1]) - $time->getOffset();// - $offset;
236 234
 			}
@@ -238,8 +236,7 @@  discard block
 block discarded – undo
238 236
 			{
239 237
 				$errors[] = sprintf($this->language->lang('CONTEST_RATING_INVALID'), $contest_data['contest_rating']);
240 238
 				$date_error = true;
241
-			}
242
-			else if (!$start_date_error)
239
+			} else if (!$start_date_error)
243 240
 			{
244 241
 				$contest_data['contest_rating'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset();//- $offset;
245 242
 			}
@@ -247,8 +244,7 @@  discard block
 block discarded – undo
247 244
 			{
248 245
 				$errors[] = sprintf($this->language->lang('CONTEST_END_INVALID'), $contest_data['contest_end']);
249 246
 				$date_error = true;
250
-			}
251
-			else if (!$start_date_error)
247
+			} else if (!$start_date_error)
252 248
 			{
253 249
 				$contest_data['contest_end'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset();//- $offset;
254 250
 			}
@@ -336,8 +332,7 @@  discard block
 block discarded – undo
336 332
 
337 333
 					$album_data_sql['left_id'] = $row['right_id'];
338 334
 					$album_data_sql['right_id'] = $row['right_id'] + 1;
339
-				}
340
-				else
335
+				} else
341 336
 				{
342 337
 					$sql = 'UPDATE ' . $this->albums_table . ' 
343 338
 						SET left_id = left_id + 2, right_id = right_id + 2
@@ -354,8 +349,7 @@  discard block
 block discarded – undo
354 349
 					$album_data_sql['left_id'] = $row['left_id'] + 1;
355 350
 					$album_data_sql['right_id'] = $row['left_id'] + 2;
356 351
 				}
357
-			}
358
-			else
352
+			} else
359 353
 			{
360 354
 				if (!$add_on_top)
361 355
 				{
@@ -368,8 +362,7 @@  discard block
 block discarded – undo
368 362
 
369 363
 					$album_data_sql['left_id'] = $row['right_id'] + 1;
370 364
 					$album_data_sql['right_id'] = $row['right_id'] + 2;
371
-				}
372
-				else
365
+				} else
373 366
 				{
374 367
 					$sql = 'UPDATE ' . $this->albums_table . ' 
375 368
 						SET left_id = left_id + 2, right_id = right_id + 2
@@ -402,8 +395,7 @@  discard block
 block discarded – undo
402 395
 				$this->db->sql_query($sql);
403 396
 			}
404 397
 			$this->gallery_log->add_log('admin', 'add', $album_data['album_id'], 0, array('LOG_ALBUM_ADD', $album_data['album_name']));
405
-		}
406
-		else
398
+		} else
407 399
 		{
408 400
 			$row = $this->gallery_album->get_info($album_data_sql['album_id']);
409 401
 			$reset_marked_images = false;
@@ -414,22 +406,19 @@  discard block
 block discarded – undo
414 406
 				// Changing a contest to category? No!
415 407
 				$errors[] = $this->language->lang('ALBUM_WITH_CONTEST_NO_TYPE_CHANGE');
416 408
 				return $errors;
417
-			}
418
-			else if ($row['album_type'] != (int) \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST)
409
+			} else if ($row['album_type'] != (int) \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST)
419 410
 			{
420 411
 				// Changing a album to contest? No!
421 412
 				// Changing a category to contest? No!
422 413
 				$errors[] = $this->language->lang('ALBUM_NO_TYPE_CHANGE_TO_CONTEST');
423 414
 				return $errors;
424
-			}
425
-			else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_CAT && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_UPLOAD)
415
+			} else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_CAT && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_UPLOAD)
426 416
 			{
427 417
 				// Changing a category to a album? Yes!
428 418
 				// Reset the data (you couldn't upload directly in a cat, you must use a album)
429 419
 				$album_data_sql['album_images'] = $album_data_sql['album_images_real'] = $album_data_sql['album_last_image_id'] = $album_data_sql['album_last_user_id'] = $album_data_sql['album_last_image_time'] = $album_data_sql['album_contest'] = 0;
430 420
 				$album_data_sql['album_last_username'] = $album_data_sql['album_last_user_colour'] = $album_data_sql['album_last_image_name'] = '';
431
-			}
432
-			else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_UPLOAD && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CAT)
421
+			} else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_UPLOAD && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CAT)
433 422
 			{
434 423
 				// Changing a album to a category? Yes!
435 424
 				// we're turning a uploadable album into a non-uploadable album
@@ -440,22 +429,18 @@  discard block
 block discarded – undo
440 429
 					if ($to_album_id)
441 430
 					{
442 431
 						$errors = $this->move_album_content($album_data_sql['album_id'], $to_album_id);
443
-					}
444
-					else
432
+					} else
445 433
 					{
446 434
 						return array($this->language->lang('NO_DESTINATION_ALBUM'));
447 435
 					}
448
-				}
449
-				else if ($album_data_sql['type_action'] == 'delete')
436
+				} else if ($album_data_sql['type_action'] == 'delete')
450 437
 				{
451 438
 					$errors = $this->delete_album_content($album_data_sql['album_id']);
452
-				}
453
-				else
439
+				} else
454 440
 				{
455 441
 					return array($this->language->lang('NO_ALBUM_ACTION'));
456 442
 				}
457
-			}
458
-			else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST)
443
+			} else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST)
459 444
 			{
460 445
 				// Changing a contest to contest? Yes!
461 446
 				// We need to check for the contest_data
@@ -483,8 +468,7 @@  discard block
 block discarded – undo
483 468
 				if ($row['album_id'] != $album_data_sql['parent_id'])
484 469
 				{
485 470
 					$errors = $this->move_album($album_data_sql['album_id'], $album_data_sql['parent_id']);
486
-				}
487
-				else
471
+				} else
488 472
 				{
489 473
 					$album_data_sql['parent_id'] = $row['parent_id'];
490 474
 				}
@@ -627,13 +611,11 @@  discard block
 block discarded – undo
627 611
 			if ($to_data['right_id'] > $from_data['right_id'])
628 612
 			{
629 613
 				$diff = '+ ' . ($to_data['right_id'] - $from_data['right_id'] - 1);
630
-			}
631
-			else
614
+			} else
632 615
 			{
633 616
 				$diff = '- ' . abs($to_data['right_id'] - $from_data['right_id'] - 1);
634 617
 			}
635
-		}
636
-		else
618
+		} else
637 619
 		{
638 620
 			$sql = 'SELECT MAX(right_id) AS right_id
639 621
 				FROM ' . $this->albums_table . ' 
@@ -679,14 +661,12 @@  discard block
 block discarded – undo
679 661
 		{
680 662
 			$log_action_images = 'IMAGES';
681 663
 			$errors = array_merge($errors, $this->delete_album_content($album_id));
682
-		}
683
-		else if ($action_images == 'move')
664
+		} else if ($action_images == 'move')
684 665
 		{
685 666
 			if (!$images_to_id)
686 667
 			{
687 668
 				$errors[] = $this->language->lang('NO_DESTINATION_ALBUM');
688
-			}
689
-			else
669
+			} else
690 670
 			{
691 671
 				$log_action_images = 'MOVE_IMAGES';
692 672
 
@@ -700,8 +680,7 @@  discard block
 block discarded – undo
700 680
 				if (!$row)
701 681
 				{
702 682
 					$errors[] = $this->language->lang('NO_ALBUM');
703
-				}
704
-				else
683
+				} else
705 684
 				{
706 685
 					$images_to_name = $row['album_name'];
707 686
 					$errors = array_merge($errors, $this->move_album_content($album_id, $images_to_id));
@@ -735,14 +714,12 @@  discard block
 block discarded – undo
735 714
 			$sql = 'DELETE FROM ' . $this->albums_table . ' 
736 715
 				WHERE ' . $this->db->sql_in_set('album_id', $album_ids);
737 716
 			$this->db->sql_query($sql);
738
-		}
739
-		else if ($action_subalbums == 'move')
717
+		} else if ($action_subalbums == 'move')
740 718
 		{
741 719
 			if (!$subalbums_to_id)
742 720
 			{
743 721
 				$errors[] = $this->language->lang('NO_DESTINATION_ALBUM');
744
-			}
745
-			else
722
+			} else
746 723
 			{
747 724
 				$log_action_albums = 'MOVE_ALBUMS';
748 725
 
@@ -756,8 +733,7 @@  discard block
 block discarded – undo
756 733
 				if (!$row)
757 734
 				{
758 735
 					$errors[] = $this->language->lang('NO_ALBUM');
759
-				}
760
-				else
736
+				} else
761 737
 				{
762 738
 					$subalbums_to_name = $row['album_name'];
763 739
 
@@ -792,8 +768,7 @@  discard block
 block discarded – undo
792 768
 			{
793 769
 				return $errors;
794 770
 			}
795
-		}
796
-		else
771
+		} else
797 772
 		{
798 773
 			$diff = 2;
799 774
 			$sql = 'DELETE FROM ' . $this->albums_table . '  
@@ -1087,8 +1062,7 @@  discard block
 block discarded – undo
1087 1062
 
1088 1063
 			$move_up_left = $album_row['left_id'];
1089 1064
 			$move_up_right = $album_row['right_id'];
1090
-		}
1091
-		else
1065
+		} else
1092 1066
 		{
1093 1067
 			$left_id = $album_row['left_id'];
1094 1068
 			$right_id = $target['right_id'];
Please login to merge, or discard this patch.
core/album/album.php 1 patch
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -221,8 +221,7 @@  discard block
 block discarded – undo
221 221
 			{
222 222
 				$padding .= '   ';
223 223
 				$padding_store[$row['parent_id']] = $padding;
224
-			}
225
-			else if ($row['left_id'] > $right + 1)
224
+			} else if ($row['left_id'] > $right + 1)
226 225
 			{
227 226
 				$padding = (isset($padding_store[$row['parent_id']])) ? $padding_store[$row['parent_id']] : '';
228 227
 			}
@@ -248,15 +247,13 @@  discard block
 block discarded – undo
248 247
 			if (($select_id == $this->gallery_auth->get_setting_permissions()) && !$row['album_user_id'])
249 248
 			{
250 249
 				$list = true;
251
-			}
252
-			else if (!$row['album_user_id'])
250
+			} else if (!$row['album_user_id'])
253 251
 			{
254 252
 				if ($this->gallery_auth->acl_check('a_list', $row['album_id'], $row['album_user_id']) || defined('IN_ADMIN'))
255 253
 				{
256 254
 					$list = true;
257 255
 				}
258
-			}
259
-			else if (!$ignore_personals)
256
+			} else if (!$ignore_personals)
260 257
 			{
261 258
 				if ($row['album_user_id'] == $this->user->data['user_id'])
262 259
 				{
@@ -267,16 +264,14 @@  discard block
 block discarded – undo
267 264
 						if ($requested_permission)
268 265
 						{
269 266
 							$requested_own = !$this->gallery_auth->acl_check($requested_permission, $this->gallery_auth->get_own_album());
270
-						}
271
-						else
267
+						} else
272 268
 						{
273 269
 							$requested_own = false; // We need the negated version of true here
274 270
 						}
275 271
 					}
276 272
 					$list = (!$list) ? $access_own : $list;
277 273
 					$disabled = (!$disabled) ? $requested_own : $disabled;
278
-				}
279
-				else if ($row['album_user_id'])
274
+				} else if ($row['album_user_id'])
280 275
 				{
281 276
 					if (!$c_access_personal)
282 277
 					{
@@ -285,8 +280,7 @@  discard block
 block discarded – undo
285 280
 						if ($requested_permission)
286 281
 						{
287 282
 							$requested_personal = !$this->gallery_auth->acl_check($requested_permission, $this->gallery_auth->get_personal_album());
288
-						}
289
-						else
283
+						} else
290 284
 						{
291 285
 							$requested_personal = false; // We need the negated version of true here
292 286
 						}
@@ -298,8 +292,7 @@  discard block
 block discarded – undo
298 292
 			if (($album_user_id != (int) \phpbbgallery\core\block::PUBLIC_ALBUM) && ($album_user_id != $row['album_user_id']))
299 293
 			{
300 294
 				$list = false;
301
-			}
302
-			else if (($album_user_id != (int) \phpbbgallery\core\block::PUBLIC_ALBUM) && ($row['parent_id'] == 0))
295
+			} else if (($album_user_id != (int) \phpbbgallery\core\block::PUBLIC_ALBUM) && ($row['parent_id'] == 0))
303 296
 			{
304 297
 				$disabled = true;
305 298
 			}
@@ -317,8 +310,7 @@  discard block
 block discarded – undo
317 310
 			$gallery_albumbox = "<select name='$select_name' id='$select_name'>";
318 311
 			$gallery_albumbox .= $album_list;
319 312
 			$gallery_albumbox .= '</select>';
320
-		}
321
-		else
313
+		} else
322 314
 		{
323 315
 			$gallery_albumbox = $album_list;
324 316
 		}
@@ -387,8 +379,7 @@  discard block
 block discarded – undo
387 379
 				'album_last_user_colour' => $row['image_user_colour'],
388 380
 				'album_last_user_id'     => $row['image_user_id'],
389 381
 			);
390
-		}
391
-		else
382
+		} else
392 383
 		{
393 384
 			// No approved image, so we clear the columns
394 385
 			$sql_ary = array(
Please login to merge, or discard this patch.
core/image/image.php 2 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -190,13 +190,13 @@  discard block
 block discarded – undo
190 190
 		}
191 191
 
192 192
 		/**
193
-		* Event delete images
194
-		*
195
-		* @event phpbbgallery.core.image.delete_images
196
-		* @var	array	images			array of the image ids we are deleting
197
-		* @var	array	filenames		array of the image filenames
198
-		* @since 1.2.0
199
-		*/
193
+		 * Event delete images
194
+		 *
195
+		 * @event phpbbgallery.core.image.delete_images
196
+		 * @var	array	images			array of the image ids we are deleting
197
+		 * @var	array	filenames		array of the image filenames
198
+		 * @since 1.2.0
199
+		 */
200 200
 		$vars = array('images', 'filenames');
201 201
 		extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.delete_images', compact($vars)));
202 202
 
@@ -256,11 +256,11 @@  discard block
 block discarded – undo
256 256
 	}
257 257
 
258 258
 	/**
259
-	* Get the real filenames, so we can load/delete/edit the image-file.
260
-	*
261
-	* @param	mixed		$images		Array or integer with the image_id(s)
262
-	* @return	array		Format: $image_id => $filename
263
-	*/
259
+	 * Get the real filenames, so we can load/delete/edit the image-file.
260
+	 *
261
+	 * @param	mixed		$images		Array or integer with the image_id(s)
262
+	 * @return	array		Format: $image_id => $filename
263
+	 */
264 264
 	public function get_filenames($images)
265 265
 	{
266 266
 		if (empty($images))
@@ -375,13 +375,13 @@  discard block
 block discarded – undo
375 375
 				$tpl = '{CONTENT}';
376 376
 
377 377
 				/**
378
-				* Event generate link
379
-				*
380
-				* @event phpbbgallery.core.image.generate_link
381
-				* @var	string	mode	type of link
382
-				* @var	string	tpl		html to be outputted
383
-				* @since 1.2.0
384
-				*/
378
+				 * Event generate link
379
+				 *
380
+				 * @event phpbbgallery.core.image.generate_link
381
+				 * @var	string	mode	type of link
382
+				 * @var	string	tpl		html to be outputted
383
+				 * @since 1.2.0
384
+				 */
385 385
 				$vars = array('mode', 'tpl');
386 386
 				extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.generate_link', compact($vars)));//@todo: Correctly identify the event
387 387
 			break;
@@ -391,12 +391,12 @@  discard block
 block discarded – undo
391 391
 	}
392 392
 
393 393
 	/**
394
-	* Handle user- & total image_counter
395
-	*
396
-	* @param	array	$image_id_ary	array with the image_ids which changed their status
397
-	* @param	bool	$add			are we adding or removing the images
398
-	* @param	bool	$readd			is it possible that there are images which aren't really changed
399
-	*/
394
+	 * Handle user- & total image_counter
395
+	 *
396
+	 * @param	array	$image_id_ary	array with the image_ids which changed their status
397
+	 * @param	bool	$add			are we adding or removing the images
398
+	 * @param	bool	$readd			is it possible that there are images which aren't really changed
399
+	 */
400 400
 	public function handle_counter($image_id_ary, $add, $readd = false)
401 401
 	{
402 402
 		if (empty($image_id_ary))
@@ -467,11 +467,11 @@  discard block
 block discarded – undo
467 467
 	}
468 468
 
469 469
 	/**
470
-	* Approve image
471
-	* @param (array)	$image_id_ary	The image ID array to be approved
472
-	* @param (int)		$album_id	The album image is approved to (just save some queries for log)
473
-	* return 0 on success
474
-	*/
470
+	 * Approve image
471
+	 * @param (array)	$image_id_ary	The image ID array to be approved
472
+	 * @param (int)		$album_id	The album image is approved to (just save some queries for log)
473
+	 * return 0 on success
474
+	 */
475 475
 	public function approve_images($image_id_ary, $album_id)
476 476
 	{
477 477
 		$sql = 'SELECT image_id, image_name, image_user_id
@@ -507,10 +507,10 @@  discard block
 block discarded – undo
507 507
 	}
508 508
 
509 509
 	/**
510
-	* UnApprove image
511
-	* @param (array)	$image_id_ary	The image ID array to be unapproved
512
-	* @param (int)		$album_id	The album image is approved to (just save some queries for log)
513
-	*/
510
+	 * UnApprove image
511
+	 * @param (array)	$image_id_ary	The image ID array to be unapproved
512
+	 * @param (int)		$album_id	The album image is approved to (just save some queries for log)
513
+	 */
514 514
 	public function unapprove_images($image_id_ary, $album_id)
515 515
 	{
516 516
 		self::handle_counter($image_id_ary, false);
@@ -563,10 +563,10 @@  discard block
 block discarded – undo
563 563
 	}
564 564
 
565 565
 	/**
566
-	* Lock images
567
-	* @param (array)	$image_id_ary	Array of images we want to lock
568
-	* @param (int)		$album_id		Album id, so we can log the action
569
-	*/
566
+	 * Lock images
567
+	 * @param (array)	$image_id_ary	Array of images we want to lock
568
+	 * @param (int)		$album_id		Album id, so we can log the action
569
+	 */
570 570
 	public function lock_images($image_id_ary, $album_id)
571 571
 	{
572 572
 		self::handle_counter($image_id_ary, false);
@@ -590,9 +590,9 @@  discard block
 block discarded – undo
590 590
 	}
591 591
 
592 592
 	/**
593
-	* Get last image id
594
-	* Return (int) image_id
595
-	**/
593
+	 * Get last image id
594
+	 * Return (int) image_id
595
+	 **/
596 596
 	public function get_last_image()
597 597
 	{
598 598
 		$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 				* @since 1.2.0
384 384
 				*/
385 385
 				$vars = array('mode', 'tpl');
386
-				extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.generate_link', compact($vars)));//@todo: Correctly identify the event
386
+				extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.generate_link', compact($vars))); //@todo: Correctly identify the event
387 387
 			break;
388 388
 		}
389 389
 
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 
407 407
 		$num_images = $num_comments = 0;
408 408
 		$sql = 'SELECT SUM(image_comments) as comments
409
-			FROM ' . $this->table_images .'
409
+			FROM ' . $this->table_images . '
410 410
 			WHERE image_status ' . (($readd) ? '=' : '<>') . ' ' . (int) \phpbbgallery\core\block::STATUS_UNAPPROVED . '
411 411
 				AND ' . $this->db->sql_in_set('image_id', $image_id_ary) . '
412 412
 			GROUP BY image_user_id';
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 		$this->db->sql_freeresult($result);
416 416
 
417 417
 		$sql = 'SELECT COUNT(image_id) images, image_user_id
418
-			FROM ' . $this->table_images .' 
418
+			FROM ' . $this->table_images . ' 
419 419
 			WHERE image_status ' . (($readd) ? '=' : '<>') . ' ' . (int) \phpbbgallery\core\block::STATUS_UNAPPROVED . '
420 420
 				AND ' . $this->db->sql_in_set('image_id', $image_id_ary) . '
421 421
 			GROUP BY image_user_id';
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 			return;
456 456
 		}
457 457
 
458
-		$sql = 'SELECT * FROM ' . $this->table_images .' WHERE image_id = ' . (int) $image_id;
458
+		$sql = 'SELECT * FROM ' . $this->table_images . ' WHERE image_id = ' . (int) $image_id;
459 459
 		$result = $this->db->sql_query($sql);
460 460
 		$row = $this->db->sql_fetchrow($result);
461 461
 		$this->db->sql_freeresult($result);
@@ -515,14 +515,14 @@  discard block
 block discarded – undo
515 515
 	{
516 516
 		self::handle_counter($image_id_ary, false);
517 517
 
518
-		$sql = 'UPDATE ' . $this->table_images .' 
518
+		$sql = 'UPDATE ' . $this->table_images . ' 
519 519
 			SET image_status = ' . (int) \phpbbgallery\core\block::STATUS_UNAPPROVED . '
520 520
 			WHERE image_status <> ' . (int) \phpbbgallery\core\block::STATUS_ORPHAN . '
521 521
 				AND ' . $this->db->sql_in_set('image_id', $image_id_ary);
522 522
 		$this->db->sql_query($sql);
523 523
 
524 524
 		$sql = 'SELECT image_id, image_name
525
-			FROM ' . $this->table_images .' 
525
+			FROM ' . $this->table_images . ' 
526 526
 			WHERE image_status <> ' . (int) \phpbbgallery\core\block::STATUS_ORPHAN . '
527 527
 				AND ' . $this->db->sql_in_set('image_id', $image_id_ary);
528 528
 		$result = $this->db->sql_query($sql);
@@ -684,14 +684,14 @@  discard block
 block discarded – undo
684 684
 			'U_USER_IP'		=> $show_ip && $this->gallery_auth->acl_check('m_status', $image_data['image_album_id'], $image_data['album_user_id']) ? $image_data['image_user_ip'] : false,
685 685
 
686 686
 			'S_IMAGE_REPORTED'		=> $image_data['image_reported'],
687
-			'U_IMAGE_REPORTED'		=> '',//($image_data['image_reported']) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=report_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_reported']) : '',
687
+			'U_IMAGE_REPORTED'		=> '', //($image_data['image_reported']) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=report_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_reported']) : '',
688 688
 			'S_STATUS_APPROVED'		=> ($image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_APPROVED) ? true : false,
689 689
 			'S_STATUS_UNAPPROVED'	=> ($image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_UNAPPROVED) ? true : false,
690 690
 			'S_STATUS_UNAPPROVED_ACTION'	=> ($this->gallery_auth->acl_check('m_status', $image_data['image_album_id'], $image_data['album_user_id']) && $image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_UNAPPROVED) ? $this->helper->route('phpbbgallery_core_moderate_image_approve', array('image_id' => (int) $image_data['image_id'])) : '',
691 691
 			'S_STATUS_LOCKED'		=> ($image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_LOCKED) ? true : false,
692 692
 
693 693
 			'U_REPORT'	=> ($this->gallery_auth->acl_check('m_report', $image_data['image_album_id'], $image_data['album_user_id']) && $image_data['image_reported']) ? '123'/*$this->url->append_sid('mcp', "mode=report_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_reported'])*/ : '',
694
-			'U_STATUS'	=> '',//($this->auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id)) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=queue_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_id']) : '',
694
+			'U_STATUS'	=> '', //($this->auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id)) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=queue_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_id']) : '',
695 695
 			'L_STATUS'	=> ($image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_UNAPPROVED) ? $this->language->lang('APPROVE_IMAGE') : (($image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_APPROVED) ? $this->language->lang('CHANGE_IMAGE_STATUS') : $this->language->lang('UNLOCK_IMAGE')),
696 696
 		));
697 697
 	}
Please login to merge, or discard this patch.
core/controller/image.php 1 patch
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -250,8 +250,7 @@  discard block
 block discarded – undo
250 250
 			}
251 251
 
252 252
 			$this->loader->load($this->data['image_album_id']);
253
-		}
254
-		catch (\Exception $e)
253
+		} catch (\Exception $e)
255 254
 		{
256 255
 			throw new \phpbb\exception\http_exception(404, 'INVALID_IMAGE');
257 256
 		}
@@ -264,8 +263,7 @@  discard block
 block discarded – undo
264 263
 		if ($this->gallery_auth->acl_check('m_status', $album_id, $album_data['album_user_id']))
265 264
 		{
266 265
 			$image_status_check = '';
267
-		}
268
-		else
266
+		} else
269 267
 		{
270 268
 			$user_id = (int) $this->user->data['user_id'];
271 269
 			$image_status_check = ' AND (image_status = ' . (int) \phpbbgallery\core\block::STATUS_APPROVED . ' OR image_user_id = ' . $user_id . ')';
@@ -322,8 +320,7 @@  discard block
 block discarded – undo
322 320
 		if (in_array($sort_key, array('r', 'ra')))
323 321
 		{
324 322
 			$sql_help_sort = ', image_id ' . (($sort_dir == 'd') ? 'ASC' : 'DESC');
325
-		}
326
-		else
323
+		} else
327 324
 		{
328 325
 			$sql_help_sort = ', image_id ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
329 326
 		}
@@ -551,8 +548,7 @@  discard block
 block discarded – undo
551 548
 			if (isset($album_data['contest_start']))
552 549
 			{
553 550
 				$s_hide_comment_input = (time() < ($album_data['contest_start'] + $album_data['contest_end'])) ? true : false;
554
-			}
555
-			else
551
+			} else
556 552
 			{
557 553
 				$s_hide_comment_input = false;
558 554
 			}
@@ -598,8 +594,7 @@  discard block
 block discarded – undo
598 594
 				//$this->template->assign_var('S_COMMENT_ACTION', append_sid($this->url->path('full') . 'comment/' . $image_id . '/add/0'));
599 595
 				$this->template->assign_var('S_COMMENT_ACTION', $this->helper->route('phpbbgallery_core_comment_add', array('image_id' => $image_id, 'comment_id' => 0)));
600 596
 			}
601
-		}
602
-		else if ($this->gallery_config->get('comment_user_control') && !$image_data['image_allow_comments'])
597
+		} else if ($this->gallery_config->get('comment_user_control') && !$image_data['image_allow_comments'])
603 598
 		{
604 599
 			$this->template->assign_var('S_COMMENTS_DISABLED', true);
605 600
 		}
@@ -790,8 +785,7 @@  discard block
 block discarded – undo
790 785
 								'NAME'      => $field_data['PROFILE_FIELD_NAME'],
791 786
 								'U_CONTACT' => $field_data['PROFILE_FIELD_CONTACT'],
792 787
 							));
793
-						}
794
-						else
788
+						} else
795 789
 						{
796 790
 							$this->template->assign_block_vars('commentrow.custom_fields', $field_data);
797 791
 						}
@@ -917,8 +911,7 @@  discard block
 block discarded – undo
917 911
 					{
918 912
 						$change_image_count = true;
919 913
 					}
920
-				}
921
-				else if ($this->request->variable('change_author', '', true))
914
+				} else if ($this->request->variable('change_author', '', true))
922 915
 				{
923 916
 					$errors[] = $this->language->lang('INVALID_USERNAME');
924 917
 				}
@@ -939,8 +932,7 @@  discard block
 block discarded – undo
939 932
 					{
940 933
 						$personal_album_id = $this->album->generate_personal_album($image_data['image_username'], $image_data['image_user_id'], $image_data['image_user_colour'], $image_user);
941 934
 					}
942
-				}
943
-				else
935
+				} else
944 936
 				{
945 937
 					$personal_album_id = $this->gallery_user->get_data('personal_album_id');
946 938
 					if (!$personal_album_id && $this->gallery_auth->acl_check('i_upload', $this->gallery_auth->get_own_album()))
@@ -1108,8 +1100,7 @@  discard block
 block discarded – undo
1108 1100
 			$this->notification_helper->read('approval', $album_id);
1109 1101
 			$this->url->meta_refresh(3, $album_backlink);
1110 1102
 			trigger_error($message);
1111
-		}
1112
-		else
1103
+		} else
1113 1104
 		{
1114 1105
 			if (isset($_POST['cancel']))
1115 1106
 			{
@@ -1117,8 +1108,7 @@  discard block
 block discarded – undo
1117 1108
 				$message .= '<br />' . sprintf($this->language->lang('CLICK_RETURN_IMAGE'), '<a href="' . $image_backlink . '">', '</a>');
1118 1109
 				$this->url->meta_refresh(3, $image_backlink);
1119 1110
 				trigger_error($message);
1120
-			}
1121
-			else
1111
+			} else
1122 1112
 			{
1123 1113
 				confirm_box(false, 'DELETE_IMAGE2', $s_hidden_fields);
1124 1114
 			}
@@ -1223,8 +1213,7 @@  discard block
 block discarded – undo
1223 1213
 			{
1224 1214
 				// @todo Add "redirect after login" url
1225 1215
 				login_box();
1226
-			}
1227
-			else
1216
+			} else
1228 1217
 			{
1229 1218
 				//return $this->error('NOT_AUTHORISED', 403);
1230 1219
 				redirect('gallery/album/' . $album_id);
Please login to merge, or discard this patch.
core/controller/album.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 			$album_user_id = $image_data['album_user_id'];
355 355
 
356 356
 			//@todo: $rating = new phpbb_gallery_image_rating($image_data['image_id'], $image_data, $image_data);
357
-			$image_data['rating'] = '0';//@todo: $rating->get_image_rating(false, false);
357
+			$image_data['rating'] = '0'; //@todo: $rating->get_image_rating(false, false);
358 358
 			//@todo: unset($rating);
359 359
 
360 360
 			$s_user_allowed = (($image_data['image_user_id'] == $this->user->data['user_id']) && ($album_status != (int) \phpbbgallery\core\block::ALBUM_LOCKED));
@@ -412,14 +412,14 @@  discard block
 block discarded – undo
412 412
 
413 413
 				'U_USER_IP'                  => $show_ip && $this->auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id) ? $image_data['image_user_ip'] : false,
414 414
 				'S_IMAGE_REPORTED'           => $image_data['image_reported'],
415
-				'U_IMAGE_REPORTED'           => '',//($image_data['image_reported']) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=report_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_reported']) : '',
415
+				'U_IMAGE_REPORTED'           => '', //($image_data['image_reported']) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=report_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_reported']) : '',
416 416
 				'S_STATUS_APPROVED'          => ($image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_APPROVED) ? true : false,
417 417
 				'S_STATUS_UNAPPROVED'        => ($image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_UNAPPROVED) ? true : false,
418 418
 				'S_STATUS_UNAPPROVED_ACTION' => ($this->auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id) && $image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_UNAPPROVED) ? $this->helper->route('phpbbgallery_core_moderate_image_approve', array('image_id' => $image_data['image_id'])) : '',
419 419
 				'S_STATUS_LOCKED'            => ($image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_LOCKED) ? true : false,
420 420
 
421 421
 				'U_REPORT' => ($this->auth->acl_check('m_report', $image_data['image_album_id'], $album_user_id) && $image_data['image_reported']) ? '123'/*$this->url->append_sid('mcp', "mode=report_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_reported'])*/ : '',
422
-				'U_STATUS' => '',//($this->auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id)) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=queue_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_id']) : '',
422
+				'U_STATUS' => '', //($this->auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id)) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=queue_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_id']) : '',
423 423
 				'L_STATUS' => ($image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_UNAPPROVED) ? $this->language->lang('APPROVE_IMAGE') : (($image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_APPROVED) ? $this->language->lang('CHANGE_IMAGE_STATUS') : $this->language->lang('UNLOCK_IMAGE')),
424 424
 
425 425
 				'S_CONTEST_RANK' => $image_data['image_contest_rank'],
Please login to merge, or discard this patch.
core/acp/albums_module.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -324,8 +324,7 @@  discard block
 block discarded – undo
324 324
 					if (!$update)
325 325
 					{
326 326
 						$album_data = $row;
327
-					}
328
-					else
327
+					} else
329 328
 					{
330 329
 						$album_data['left_id'] = $row['left_id'];
331 330
 						$album_data['right_id'] = $row['right_id'];
@@ -333,8 +332,7 @@  discard block
 block discarded – undo
333 332
 					if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST)
334 333
 					{
335 334
 						$contest_data = $phpbb_gallery_contest->get_contest($album_id, 'album');
336
-					}
337
-					else
335
+					} else
338 336
 					{
339 337
 						// Default values, 3 days later rate and 7 for the end of the contest
340 338
 						$contest_data = array(
@@ -356,8 +354,7 @@  discard block
 block discarded – undo
356 354
 					/*
357 355
 					$album_data['album_password_confirm'] = $album_data['album_password'];
358 356
 					*/
359
-				}
360
-				else
357
+				} else
361 358
 				{
362 359
 					$this->page_title = 'CREATE_ALBUM';
363 360
 
@@ -494,8 +491,7 @@  discard block
 block discarded – undo
494 491
 						'S_HAS_SUBALBUMS'		=> ($album_data['right_id'] - $album_data['left_id'] > 1) ? true : false,
495 492
 						'S_ALBUMS_LIST'			=> $albums_list,
496 493
 					));
497
-				}
498
-				else if ($uploadable_album_exists)
494
+				} else if ($uploadable_album_exists)
499 495
 				{
500 496
 					$template->assign_vars(array(
501 497
 						'S_MOVE_ALBUM_OPTIONS'		=> $phpbb_ext_gallery_core_album->get_albumbox(true, '', $album_data['parent_id'], false, $album_id, 0, (int) \phpbbgallery\core\block::TYPE_UPLOAD),
@@ -635,8 +631,7 @@  discard block
 block discarded – undo
635 631
 		if (!$this->parent_id)
636 632
 		{
637 633
 			$navigation = $user->lang['GALLERY_INDEX'];
638
-		}
639
-		else
634
+		} else
640 635
 		{
641 636
 			$navigation = '<a href="' . $this->u_action . '">' . $user->lang['GALLERY_INDEX'] . '</a>';
642 637
 
@@ -646,8 +641,7 @@  discard block
 block discarded – undo
646 641
 				if ($row['album_id'] == $this->parent_id)
647 642
 				{
648 643
 					$navigation .= ' -&gt; ' . $row['album_name'];
649
-				}
650
-				else
644
+				} else
651 645
 				{
652 646
 					$navigation .= ' -&gt; <a href="' . $this->u_action . '&amp;parent_id=' . $row['album_id'] . '">' . $row['album_name'] . '</a>';
653 647
 				}
@@ -678,8 +672,7 @@  discard block
 block discarded – undo
678 672
 				if ($row['album_status'] == (int) \phpbbgallery\core\block::ALBUM_LOCKED)
679 673
 				{
680 674
 					$folder_image = '<img src="images/icon_folder_lock.gif" alt="' . $user->lang['LOCKED'] . '" />';
681
-				}
682
-				else
675
+				} else
683 676
 				{
684 677
 					$folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="' . $user->lang['SUBALBUM'] . '" />' : '<img src="images/icon_folder.gif" alt="' . $user->lang['FOLDER'] . '" />';
685 678
 				}
@@ -705,8 +698,7 @@  discard block
 block discarded – undo
705 698
 				);
706 699
 			}
707 700
 			while ($row = $db->sql_fetchrow($result));
708
-		}
709
-		else if ($this->parent_id)
701
+		} else if ($this->parent_id)
710 702
 		{
711 703
 			$row = $phpbb_ext_gallery_core_album->get_info($this->parent_id);
712 704
 
Please login to merge, or discard this patch.
core/controller/search.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -141,10 +141,10 @@  discard block
 block discarded – undo
141 141
 
142 142
 	public function base($page = 1)
143 143
 	{
144
-		$search_id		= $this->request->variable('search_id', '');
144
+		$search_id = $this->request->variable('search_id', '');
145 145
 		$image_id		= $this->request->variable('image_id', 0);
146 146
 
147
-		$submit			= $this->request->variable('submit', false);
147
+		$submit = $this->request->variable('submit', false);
148 148
 		$keywords		= utf8_normalize_nfc($this->request->variable('keywords', '', true));
149 149
 		$add_keywords	= utf8_normalize_nfc($this->request->variable('add_keywords', '', true));
150 150
 		$username		= $this->request->variable('username', '', true);
@@ -152,13 +152,13 @@  discard block
 block discarded – undo
152 152
 		$search_terms	= $this->request->variable('terms', 'all');
153 153
 		$search_album	= $this->request->variable('aid', array(0));
154 154
 		$search_child	= $this->request->variable('sc', true);
155
-		$search_fields	= $this->request->variable('sf', 'all');
156
-		$sort_days		= $this->request->variable('st', 0);
155
+		$search_fields = $this->request->variable('sf', 'all');
156
+		$sort_days = $this->request->variable('st', 0);
157 157
 		$sort_key		= $this->request->variable('sk', 't');
158 158
 		$sort_dir		= $this->request->variable('sd', 'd');
159 159
 		$filtered		= $this->request->variable('filtered', false);
160 160
 
161
-		$start 			= ($page - 1) * $this->gallery_config->get('items_per_page');
161
+		$start = ($page - 1) * $this->gallery_config->get('items_per_page');
162 162
 		if ($filtered)
163 163
 		{
164 164
 			$submit = true;
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 		if ($this->gallery_config->get('allow_rates'))
176 176
 		{
177 177
 			$sort_by_text['ra'] = $this->language->lang('RATING');
178
-			$sort_by_sql['ra'] = 'image_rate_points';//@todo: (phpbb_gallery_contest::$mode == phpbb_gallery_contest::MODE_SUM) ? 'image_rate_points' : 'image_rate_avg';
178
+			$sort_by_sql['ra'] = 'image_rate_points'; //@todo: (phpbb_gallery_contest::$mode == phpbb_gallery_contest::MODE_SUM) ? 'image_rate_points' : 'image_rate_avg';
179 179
 			$sort_by_text['r'] = $this->language->lang('RATES_COUNT');
180 180
 			$sort_by_sql['r'] = 'image_rates';
181 181
 		}
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 				{
207 207
 					trigger_error(sprintf($this->language->lang('TOO_FEW_AUTHOR_CHARS'), $this->config['min_search_author_chars']));
208 208
 				}
209
-				$username_parsed = (strpos($username, '*') !== false) ? ' username_clean ' . $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), utf8_clean_string($this->db->sql_escape($username)))) : ' username_clean = \'' . $this->db->sql_escape(utf8_clean_string($username)) .'\'';
209
+				$username_parsed = (strpos($username, '*') !== false) ? ' username_clean ' . $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), utf8_clean_string($this->db->sql_escape($username)))) : ' username_clean = \'' . $this->db->sql_escape(utf8_clean_string($username)) . '\'';
210 210
 				$sql = 'SELECT user_id
211 211
 					FROM ' . USERS_TABLE . '
212 212
 					WHERE ' . $username_parsed . '
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 
225 225
 			if (!empty($user_id))
226 226
 			{
227
-				$sql_where[] =  $this->db->sql_in_set('i.image_user_id', $user_id);
227
+				$sql_where[] = $this->db->sql_in_set('i.image_user_id', $user_id);
228 228
 			}
229 229
 			// if we search in an existing search result just add the additional keywords. But we need to use "all search terms"-mode
230 230
 			// so we can keep the old keywords in their old mode, but add the new ones as required words
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 				else
238 238
 				{
239 239
 					$search_terms = 'all';
240
-					$keywords = preg_replace('#\s+#u', ' |', $keywords) . ' ' .$add_keywords;
240
+					$keywords = preg_replace('#\s+#u', ' |', $keywords) . ' ' . $add_keywords;
241 241
 				}
242 242
 			}
243 243
 			$keywords_ary = ($keywords) ? explode(' ', $keywords) : array();
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 				$match_search_query = '';
263 263
 				foreach ($matches as $match)
264 264
 				{
265
-					$match_search_query .= (($match_search_query) ? ' OR ' : '') . 'LOWER('. $match . ') ';
265
+					$match_search_query .= (($match_search_query) ? ' OR ' : '') . 'LOWER(' . $match . ') ';
266 266
 					$match_search_query .= $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), $this->db->get_any_char() . mb_strtolower($word) . $this->db->get_any_char()));
267 267
 				}
268 268
 				$search_query .= ((!$search_query) ? '' : (($search_terms == 'all') ? ' AND ' : ' OR ')) . '(' . $match_search_query . ')';
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 				trigger_error('NO_SEARCH_RESULTS');
292 292
 			}
293 293
 			$sql_array['SELECT'] = '*, a.album_name, a.album_status, a.album_user_id, a.album_id';
294
-			$sql_array['LEFT_JOIN']	= array(
294
+			$sql_array['LEFT_JOIN'] = array(
295 295
 				array(
296 296
 					'FROM'		=> array($this->albums_table => 'a'),
297 297
 					'ON'		=> 'a.album_id = i.image_album_id',
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 			{
320 320
 				$this->image->assign_block('imageblock.image', $row, $show_options, $thumbnail_link, $imagename_link);
321 321
 			}
322
-			$current_page = $page*$this->gallery_config->get('items_per_page');
322
+			$current_page = $page * $this->gallery_config->get('items_per_page');
323 323
 			$this->pagination->generate_template_pagination(array(
324 324
 				'routes' => array(
325 325
 					'phpbbgallery_core_search',
Please login to merge, or discard this patch.