Code Duplication    Length = 12-12 lines in 6 locations

Sources/Display.php 1 location

@@ 532-543 (lines=12) @@
529
	$context['canonical_url'] = $scripturl . '?topic=' . $topic . '.' . ($can_show_all ? '0;all' : $context['start']);
530
531
	// For quick reply we need a response prefix in the default forum language.
532
	if (!isset($context['response_prefix']) && !($context['response_prefix'] = cache_get_data('response_prefix', 600)))
533
	{
534
		if ($language === $user_info['language'])
535
			$context['response_prefix'] = $txt['response_prefix'];
536
		else
537
		{
538
			loadLanguage('index', $language, false);
539
			$context['response_prefix'] = $txt['response_prefix'];
540
			loadLanguage('index');
541
		}
542
		cache_put_data('response_prefix', $context['response_prefix'], 600);
543
	}
544
545
	// If we want to show event information in the topic, prepare the data.
546
	if (allowedTo('calendar_view') && !empty($modSettings['cal_showInTopic']) && !empty($modSettings['cal_enabled']))

Sources/MoveTopic.php 1 location

@@ 235-246 (lines=12) @@
232
			if (isset($_POST['enforce_subject']))
233
			{
234
				// Get a response prefix, but in the forum's default language.
235
				if (!isset($context['response_prefix']) && !($context['response_prefix'] = cache_get_data('response_prefix')))
236
				{
237
					if ($language === $user_info['language'])
238
						$context['response_prefix'] = $txt['response_prefix'];
239
					else
240
					{
241
						loadLanguage('index', $language, false);
242
						$context['response_prefix'] = $txt['response_prefix'];
243
						loadLanguage('index');
244
					}
245
					cache_put_data('response_prefix', $context['response_prefix'], 600);
246
				}
247
248
				$smcFunc['db_query']('', '
249
					UPDATE {db_prefix}messages

Sources/PersonalMessage.php 1 location

@@ 1822-1833 (lines=12) @@
1819
		censorText($row_quoted['body']);
1820
1821
		// Add 'Re: ' to it....
1822
		if (!isset($context['response_prefix']) && !($context['response_prefix'] = cache_get_data('response_prefix')))
1823
		{
1824
			if ($language === $user_info['language'])
1825
				$context['response_prefix'] = $txt['response_prefix'];
1826
			else
1827
			{
1828
				loadLanguage('index', $language, false);
1829
				$context['response_prefix'] = $txt['response_prefix'];
1830
				loadLanguage('index');
1831
			}
1832
			cache_put_data('response_prefix', $context['response_prefix'], 600);
1833
		}
1834
		$form_subject = $row_quoted['subject'];
1835
		if ($context['reply'] && trim($context['response_prefix']) != '' && $smcFunc['strpos']($form_subject, trim($context['response_prefix'])) !== 0)
1836
			$form_subject = $context['response_prefix'] . $form_subject;

Sources/SplitTopics.php 1 location

@@ 1412-1423 (lines=12) @@
1409
	}
1410
1411
	// Grab the response prefix (like 'Re: ') in the default forum language.
1412
	if (!isset($context['response_prefix']) && !($context['response_prefix'] = cache_get_data('response_prefix')))
1413
	{
1414
		if ($language === $user_info['language'])
1415
			$context['response_prefix'] = $txt['response_prefix'];
1416
		else
1417
		{
1418
			loadLanguage('index', $language, false);
1419
			$context['response_prefix'] = $txt['response_prefix'];
1420
			loadLanguage('index');
1421
		}
1422
		cache_put_data('response_prefix', $context['response_prefix'], 600);
1423
	}
1424
1425
	// Change the topic IDs of all messages that will be merged.  Also adjust subjects if 'enforce subject' was checked.
1426
	$smcFunc['db_query']('', '

Sources/Post.php 2 locations

@@ 430-441 (lines=12) @@
427
	}
428
429
	// Get a response prefix (like 'Re:') in the default forum language.
430
	if (!isset($context['response_prefix']) && !($context['response_prefix'] = cache_get_data('response_prefix')))
431
	{
432
		if ($language === $user_info['language'])
433
			$context['response_prefix'] = $txt['response_prefix'];
434
		else
435
		{
436
			loadLanguage('index', $language, false);
437
			$context['response_prefix'] = $txt['response_prefix'];
438
			loadLanguage('index');
439
		}
440
		cache_put_data('response_prefix', $context['response_prefix'], 600);
441
	}
442
443
	// Previewing, modifying, or posting?
444
	// Do we have a body, but an error happened.
@@ 2849-2860 (lines=12) @@
2846
		if (isset($_POST['subject']) && isset($_REQUEST['change_all_subjects']) && $row['id_first_msg'] == $row['id_msg'] && !empty($row['num_replies']) && (allowedTo('modify_any') || ($row['id_member_started'] == $user_info['id'] && allowedTo('modify_replies'))))
2847
		{
2848
			// Get the proper (default language) response prefix first.
2849
			if (!isset($context['response_prefix']) && !($context['response_prefix'] = cache_get_data('response_prefix')))
2850
			{
2851
				if ($language === $user_info['language'])
2852
					$context['response_prefix'] = $txt['response_prefix'];
2853
				else
2854
				{
2855
					loadLanguage('index', $language, false);
2856
					$context['response_prefix'] = $txt['response_prefix'];
2857
					loadLanguage('index');
2858
				}
2859
				cache_put_data('response_prefix', $context['response_prefix'], 600);
2860
			}
2861
2862
			$smcFunc['db_query']('', '
2863
				UPDATE {db_prefix}messages