Code Duplication    Length = 9-9 lines in 4 locations

Sources/Themes.php 2 locations

@@ 223-231 (lines=9) @@
220
			cache_put_data('theme_settings-' . $id, null, 90);
221
		}
222
223
		if (!empty($setValues))
224
		{
225
			$smcFunc['db_insert']('replace',
226
				'{db_prefix}themes',
227
				array('id_theme' => 'int', 'id_member' => 'int', 'variable' => 'string-255', 'value' => 'string-65534'),
228
				$setValues,
229
				array('id_theme', 'variable', 'id_member')
230
			);
231
		}
232
233
		redirectexit('action=admin;area=theme;sa=list;' . $context['session_var'] . '=' . $context['session_id']);
234
	}
@@ 733-741 (lines=9) @@
730
		foreach ($_POST['default_options'] as $opt => $val)
731
			$inserts[] = array(0, 1, $opt, is_array($val) ? implode(',', $val) : $val);
732
		// If we're actually inserting something..
733
		if (!empty($inserts))
734
		{
735
			$smcFunc['db_insert']('replace',
736
				'{db_prefix}themes',
737
				array('id_member' => 'int', 'id_theme' => 'int', 'variable' => 'string-255', 'value' => 'string-65534'),
738
				$inserts,
739
				array('id_member', 'id_theme', 'variable')
740
			);
741
		}
742
743
		cache_put_data('theme_settings-' . $_GET['th'], null, 90);
744
		cache_put_data('theme_settings-1', null, 90);

Sources/Profile-Modify.php 1 location

@@ 1032-1040 (lines=9) @@
1029
	// If themeSetArray isn't still empty, send it to the database.
1030
	if (empty($context['password_auth_failed']))
1031
	{
1032
		if (!empty($themeSetArray))
1033
		{
1034
			$smcFunc['db_insert']('replace',
1035
				'{db_prefix}themes',
1036
				array('id_member' => 'int', 'id_theme' => 'int', 'variable' => 'string-255', 'value' => 'string-65534'),
1037
				$themeSetArray,
1038
				array('id_member', 'id_theme', 'variable')
1039
			);
1040
		}
1041
1042
		if (!empty($erase_options))
1043
		{

other/upgrade.php 1 location

@@ 1545-1553 (lines=9) @@
1542
1543
		$themeData[] = array(0, 1, $variable, $value);
1544
	}
1545
	if (!empty($themeData))
1546
	{
1547
		$smcFunc['db_insert']('ignore',
1548
			$db_prefix . 'themes',
1549
			array('id_member' => 'int', 'id_theme' => 'int', 'variable' => 'string', 'value' => 'string'),
1550
			$themeData,
1551
			array('id_member', 'id_theme', 'variable')
1552
		);
1553
	}
1554
}
1555
1556
// This function only works with MySQL but that's fine as it is only used for v1.0.