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

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