Code Duplication    Length = 31-31 lines in 2 locations

Sources/ReportToMod.php 2 locations

@@ 310-340 (lines=31) @@
307
	}
308
309
	// Now just add our report...
310
	if ($id_report)
311
	{
312
		$smcFunc['db_insert']('',
313
			'{db_prefix}log_reported_comments',
314
			array(
315
				'id_report' => 'int', 'id_member' => 'int', 'membername' => 'string',
316
				'member_ip' => 'inet', 'comment' => 'string', 'time_sent' => 'int',
317
			),
318
			array(
319
				$id_report, $user_info['id'], $user_info['name'],
320
				$user_info['ip'], $reason, time(),
321
			),
322
			array('id_comment')
323
		);
324
325
		// And get ready to notify people.
326
		$smcFunc['db_insert']('insert',
327
			'{db_prefix}background_tasks',
328
			array('task_file' => 'string', 'task_class' => 'string', 'task_data' => 'string', 'claimed_time' => 'int'),
329
			array('$sourcedir/tasks/MsgReport-Notify.php', 'MsgReport_Notify_Background', json_encode(array(
330
				'report_id' => $id_report,
331
				'msg_id' => $_POST['msg'],
332
				'topic_id' => $message['id_topic'],
333
				'board_id' => $message['id_board'],
334
				'sender_id' => $context['user']['id'],
335
				'sender_name' => $context['user']['name'],
336
				'time' => time(),
337
			)), 0),
338
			array('id_task')
339
		);
340
	}
341
342
	// Keep track of when the mod reports get updated, that way we know when we need to look again.
343
	updateSettings(array('last_mod_report_action' => time()));
@@ 431-461 (lines=31) @@
428
	}
429
430
	// Now just add our report...
431
	if ($id_report)
432
	{
433
		$smcFunc['db_insert']('',
434
			'{db_prefix}log_reported_comments',
435
			array(
436
				'id_report' => 'int', 'id_member' => 'int', 'membername' => 'string',
437
				'member_ip' => 'inet', 'comment' => 'string', 'time_sent' => 'int',
438
			),
439
			array(
440
				$id_report, $user_info['id'], $user_info['name'],
441
				$user_info['ip'], $reason, time(),
442
			),
443
			array('id_comment')
444
		);
445
446
		// And get ready to notify people.
447
		$smcFunc['db_insert']('insert',
448
			'{db_prefix}background_tasks',
449
			array('task_file' => 'string', 'task_class' => 'string', 'task_data' => 'string', 'claimed_time' => 'int'),
450
			array('$sourcedir/tasks/MemberReport-Notify.php', 'MemberReport_Notify_Background', json_encode(array(
451
				'report_id' => $id_report,
452
				'user_id' => $user['id_member'],
453
				'user_name' => $user_name,
454
				'sender_id' => $context['user']['id'],
455
				'sender_name' => $context['user']['name'],
456
				'comment' => $reason,
457
				'time' => time(),
458
			)), 0),
459
			array('id_task')
460
		);
461
	}
462
463
	// Keep track of when the mod reports get updated, that way we know when we need to look again.
464
	updateSettings(array('last_mod_report_action' => time()));