Code Duplication    Length = 12-15 lines in 3 locations

Sources/Subs-Members.php 1 location

@@ 1365-1376 (lines=12) @@
1362
		$num_members = $modSettings['totalMembers'];
1363
1364
	// The database knows the amount when there are extra conditions.
1365
	else
1366
	{
1367
		$request = $smcFunc['db_query']('', '
1368
			SELECT COUNT(*)
1369
			FROM {db_prefix}members AS mem
1370
			WHERE ' . $where,
1371
			array_merge($where_params, array(
1372
			))
1373
		);
1374
		list ($num_members) = $smcFunc['db_fetch_row']($request);
1375
		$smcFunc['db_free_result']($request);
1376
	}
1377
1378
	return $num_members;
1379
}

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

@@ 1641-1653 (lines=13) @@
1638
		return $user_settings['timezone'];
1639
	}
1640
1641
	if (isset($id_member))
1642
	{
1643
		$request = $smcFunc['db_query']('', '
1644
			SELECT timezone
1645
			FROM {db_prefix}members
1646
			WHERE id_member = {int:id_member}',
1647
			array(
1648
				'id_member' => $id_member,
1649
			)
1650
		);
1651
		list($timezone) = $smcFunc['db_fetch_row']($request);
1652
		$smcFunc['db_free_result']($request);
1653
	}
1654
1655
	if (empty($timezone) || !in_array($timezone, timezone_identifiers_list(DateTimeZone::ALL_WITH_BC)))
1656
		$timezone = isset($modSettings['default_timezone']) ? $modSettings['default_timezone'] : date_default_timezone_get();