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

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