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

@@ 1340-1355 (lines=16) @@
1337
	// Are we loading any moderators?  If so, fix their group data...
1338
	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)
1339
	{
1340
		if (($row = cache_get_data('moderator_group_info', 480)) == null)
1341
		{
1342
			$request = $smcFunc['db_query']('', '
1343
				SELECT group_name AS member_group, online_color AS member_group_color, icons
1344
				FROM {db_prefix}membergroups
1345
				WHERE id_group = {int:moderator_group}
1346
				LIMIT 1',
1347
				array(
1348
					'moderator_group' => 3,
1349
				)
1350
			);
1351
			$row = $smcFunc['db_fetch_assoc']($request);
1352
			$smcFunc['db_free_result']($request);
1353
1354
			cache_put_data('moderator_group_info', $row, 480);
1355
		}
1356
1357
		foreach ($temp_mods as $id)
1358
		{