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

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