Code Duplication    Length = 15-16 lines in 2 locations

Sources/ModerationCenter.php 1 location

@@ 430-444 (lines=15) @@
427
	}
428
429
	// How many notes in total?
430
	if (($moderator_notes_total = cache_get_data('moderator_notes_total', 240)) === null)
431
	{
432
		$request = $smcFunc['db_query']('', '
433
			SELECT COUNT(*)
434
			FROM {db_prefix}log_comments AS lc
435
				LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = lc.id_member)
436
			WHERE lc.comment_type = {literal:modnote}',
437
			array(
438
			)
439
		);
440
		list ($moderator_notes_total) = $smcFunc['db_fetch_row']($request);
441
		$smcFunc['db_free_result']($request);
442
443
		cache_put_data('moderator_notes_total', $moderator_notes_total, 240);
444
	}
445
446
	// Grab the current notes. We can only use the cache for the first page of notes.
447
	$offset = isset($_GET['notes']) && isset($_GET['start']) ? $_GET['start'] : 0;

Sources/Load.php 1 location

@@ 1325-1340 (lines=16) @@
1322
	// Are we loading any moderators?  If so, fix their group data...
1323
	if (!empty($loaded_ids) && (!empty($board_info['moderators']) || !empty($board_info['moderator_groups'])) && $set === 'normal' && count($temp_mods = array_merge(array_intersect($loaded_ids, array_keys($board_info['moderators'])), $additional_mods)) !== 0)
1324
	{
1325
		if (($row = cache_get_data('moderator_group_info', 480)) == null)
1326
		{
1327
			$request = $smcFunc['db_query']('', '
1328
				SELECT group_name AS member_group, online_color AS member_group_color, icons
1329
				FROM {db_prefix}membergroups
1330
				WHERE id_group = {int:moderator_group}
1331
				LIMIT 1',
1332
				array(
1333
					'moderator_group' => 3,
1334
				)
1335
			);
1336
			$row = $smcFunc['db_fetch_assoc']($request);
1337
			$smcFunc['db_free_result']($request);
1338
1339
			cache_put_data('moderator_group_info', $row, 480);
1340
		}
1341
1342
		foreach ($temp_mods as $id)
1343
		{