Passed
Pull Request — master (#324)
by
unknown
02:40
created
core/image/image.php 1 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/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/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.