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/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

Sources/MoveTopic.php 1 location

@@ 222-233 (lines=12) @@
219
			if (isset($_POST['enforce_subject']))
220
			{
221
				// Get a response prefix, but in the forum's default language.
222
				if (!isset($context['response_prefix']) && !($context['response_prefix'] = cache_get_data('response_prefix')))
223
				{
224
					if ($language === $user_info['language'])
225
						$context['response_prefix'] = $txt['response_prefix'];
226
					else
227
					{
228
						loadLanguage('index', $language, false);
229
						$context['response_prefix'] = $txt['response_prefix'];
230
						loadLanguage('index');
231
					}
232
					cache_put_data('response_prefix', $context['response_prefix'], 600);
233
				}
234
235
				$smcFunc['db_query']('', '
236
					UPDATE {db_prefix}messages

Sources/PersonalMessage.php 1 location

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