Code Duplication    Length = 11-15 lines in 4 locations

Sources/Load.php 1 location

@@ 357-367 (lines=11) @@
354
	$context['description_allowed_tags'] = array('abbr', 'anchor', 'b', 'center', 'color', 'font', 'hr', 'i', 'img', 'iurl', 'left', 'li', 'list', 'ltr', 'pre', 'right', 's', 'sub', 'sup', 'table', 'td', 'tr', 'u', 'url',);
355
356
	// Get an error count, if necessary
357
	if (!isset($context['num_errors']))
358
	{
359
		$query = $smcFunc['db_query']('', '
360
			SELECT COUNT(id_error)
361
			FROM {db_prefix}log_errors',
362
			array()
363
		);
364
365
		list($context['num_errors']) = $smcFunc['db_fetch_row']($query);
366
		$smcFunc['db_free_result']($query);
367
	}
368
369
	// Call pre load integration functions.
370
	call_integration_hook('integrate_pre_load');

Sources/ManagePermissions.php 1 location

@@ 865-878 (lines=14) @@
862
	// Verify this isn't inherited.
863
	if ($_GET['group'] == -1 || $_GET['group'] == 0)
864
		$parent = -2;
865
	else
866
	{
867
		$result = $smcFunc['db_query']('', '
868
			SELECT id_parent
869
			FROM {db_prefix}membergroups
870
			WHERE id_group = {int:current_group}
871
			LIMIT 1',
872
			array(
873
				'current_group' => $_GET['group'],
874
			)
875
		);
876
		list ($parent) = $smcFunc['db_fetch_row']($result);
877
		$smcFunc['db_free_result']($result);
878
	}
879
880
	if ($parent != -2)
881
		fatal_lang_error('cannot_edit_permissions_inherited');

Sources/Subs-Post.php 1 location

@@ 2704-2718 (lines=15) @@
2701
{
2702
	global $smcFunc;
2703
2704
	if ($member_name == null)
2705
	{
2706
		// Get the new user's name....
2707
		$request = $smcFunc['db_query']('', '
2708
			SELECT real_name
2709
			FROM {db_prefix}members
2710
			WHERE id_member = {int:id_member}
2711
			LIMIT 1',
2712
			array(
2713
				'id_member' => $memberID,
2714
			)
2715
		);
2716
		list ($member_name) = $smcFunc['db_fetch_row']($request);
2717
		$smcFunc['db_free_result']($request);
2718
	}
2719
2720
	// This is really just a wrapper for making a new background task to deal with all the fun.
2721
	$smcFunc['db_insert']('insert',

Sources/Subs-Calendar.php 1 location

@@ 1617-1629 (lines=13) @@
1614
	if (is_null($id_member) && $user_info['is_guest'] == false)
1615
		$id_member = $context['user']['id'];
1616
1617
	if (isset($id_member))
1618
	{
1619
		$request = $smcFunc['db_query']('', '
1620
			SELECT timezone
1621
			FROM {db_prefix}members
1622
			WHERE id_member = {int:id_member}',
1623
			array(
1624
				'id_member' => $id_member,
1625
			)
1626
		);
1627
		list($timezone) = $smcFunc['db_fetch_row']($request);
1628
		$smcFunc['db_free_result']($request);
1629
	}
1630
1631
	if (empty($timezone) || !in_array($timezone, timezone_identifiers_list(DateTimeZone::ALL_WITH_BC)))
1632
		$timezone = isset($modSettings['default_timezone']) ? $modSettings['default_timezone'] : date_default_timezone_get();