Code Duplication    Length = 2-2 lines in 10 locations

Sources/MessageIndex.php 2 locations

@@ 432-433 (lines=2) @@
429
			// We need to check the topic icons exist...
430
			if (!empty($modSettings['messageIconChecks_enable']))
431
			{
432
				if (!isset($context['icon_sources'][$row['first_icon']]))
433
					$context['icon_sources'][$row['first_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['first_icon'] . '.png') ? 'images_url' : 'default_images_url';
434
				if (!isset($context['icon_sources'][$row['last_icon']]))
435
					$context['icon_sources'][$row['last_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['last_icon'] . '.png') ? 'images_url' : 'default_images_url';
436
			}
@@ 434-435 (lines=2) @@
431
			{
432
				if (!isset($context['icon_sources'][$row['first_icon']]))
433
					$context['icon_sources'][$row['first_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['first_icon'] . '.png') ? 'images_url' : 'default_images_url';
434
				if (!isset($context['icon_sources'][$row['last_icon']]))
435
					$context['icon_sources'][$row['last_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['last_icon'] . '.png') ? 'images_url' : 'default_images_url';
436
			}
437
			else
438
			{

Sources/Recent.php 2 locations

@@ 1261-1262 (lines=2) @@
1258
		if (!empty($modSettings['messageIconChecks_enable']))
1259
		{
1260
			// First icon first... as you'd expect.
1261
			if (!isset($context['icon_sources'][$row['first_icon']]))
1262
				$context['icon_sources'][$row['first_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['first_icon'] . '.png') ? 'images_url' : 'default_images_url';
1263
			// Last icon... last... duh.
1264
			if (!isset($context['icon_sources'][$row['last_icon']]))
1265
				$context['icon_sources'][$row['last_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['last_icon'] . '.png') ? 'images_url' : 'default_images_url';
@@ 1264-1265 (lines=2) @@
1261
			if (!isset($context['icon_sources'][$row['first_icon']]))
1262
				$context['icon_sources'][$row['first_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['first_icon'] . '.png') ? 'images_url' : 'default_images_url';
1263
			// Last icon... last... duh.
1264
			if (!isset($context['icon_sources'][$row['last_icon']]))
1265
				$context['icon_sources'][$row['last_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['last_icon'] . '.png') ? 'images_url' : 'default_images_url';
1266
		}
1267
1268
		// Force the recycling icon if appropriate

Sources/Search.php 3 locations

@@ 1983-1984 (lines=2) @@
1980
	// Sadly, we need to check the icon ain't broke.
1981
	if (!empty($modSettings['messageIconChecks_enable']))
1982
	{
1983
		if (!isset($context['icon_sources'][$message['first_icon']]))
1984
			$context['icon_sources'][$message['first_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['first_icon'] . '.png') ? 'images_url' : 'default_images_url';
1985
		if (!isset($context['icon_sources'][$message['last_icon']]))
1986
			$context['icon_sources'][$message['last_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['last_icon'] . '.png') ? 'images_url' : 'default_images_url';
1987
		if (!isset($context['icon_sources'][$message['icon']]))
@@ 1985-1986 (lines=2) @@
1982
	{
1983
		if (!isset($context['icon_sources'][$message['first_icon']]))
1984
			$context['icon_sources'][$message['first_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['first_icon'] . '.png') ? 'images_url' : 'default_images_url';
1985
		if (!isset($context['icon_sources'][$message['last_icon']]))
1986
			$context['icon_sources'][$message['last_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['last_icon'] . '.png') ? 'images_url' : 'default_images_url';
1987
		if (!isset($context['icon_sources'][$message['icon']]))
1988
			$context['icon_sources'][$message['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['icon'] . '.png') ? 'images_url' : 'default_images_url';
1989
	}
@@ 1987-1988 (lines=2) @@
1984
			$context['icon_sources'][$message['first_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['first_icon'] . '.png') ? 'images_url' : 'default_images_url';
1985
		if (!isset($context['icon_sources'][$message['last_icon']]))
1986
			$context['icon_sources'][$message['last_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['last_icon'] . '.png') ? 'images_url' : 'default_images_url';
1987
		if (!isset($context['icon_sources'][$message['icon']]))
1988
			$context['icon_sources'][$message['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['icon'] . '.png') ? 'images_url' : 'default_images_url';
1989
	}
1990
	else
1991
	{

Sources/Display.php 1 location

@@ 1401-1402 (lines=2) @@
1398
	if (empty($modSettings['messageIconChecks_disable']))
1399
	{
1400
		// If the current icon isn't known, then we need to do something...
1401
		if (!isset($context['icon_sources'][$message['icon']]))
1402
			$context['icon_sources'][$message['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['icon'] . '.png') ? 'images_url' : 'default_images_url';
1403
	}
1404
	elseif (!isset($context['icon_sources'][$message['icon']]))
1405
		$context['icon_sources'][$message['icon']] = 'images_url';

SSI.php 2 locations

@@ 575-576 (lines=2) @@
572
		if (!empty($recycle_board) && $topics[$row['id_topic']]['id_board'])
573
			$row['icon'] = 'recycled';
574
575
		if (!empty($modSettings['messageIconChecks_enable']) && !isset($icon_sources[$row['icon']]))
576
			$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.png') ? 'images_url' : 'default_images_url';
577
578
		// Build the array.
579
		$posts[] = array(
@@ 2002-2003 (lines=2) @@
1999
			$row['icon'] = 'recycled';
2000
2001
		// Check that this message icon is there...
2002
		if (!empty($modSettings['messageIconChecks_enable']) && !isset($icon_sources[$row['icon']]))
2003
			$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.png') ? 'images_url' : 'default_images_url';
2004
2005
		censorText($row['subject']);
2006
		censorText($row['body']);