Code Duplication    Length = 15-19 lines in 2 locations

Sources/Post.php 1 location

@@ 73-87 (lines=15) @@
70
	}
71
72
	// No message is complete without a topic.
73
	if (empty($topic) && !empty($_REQUEST['msg']))
74
	{
75
		$request = $smcFunc['db_query']('', '
76
			SELECT id_topic
77
			FROM {db_prefix}messages
78
			WHERE id_msg = {int:msg}',
79
			array(
80
				'msg' => (int) $_REQUEST['msg'],
81
		));
82
		if ($smcFunc['db_num_rows']($request) != 1)
83
			unset($_REQUEST['msg'], $_POST['msg'], $_GET['msg']);
84
		else
85
			list ($topic) = $smcFunc['db_fetch_row']($request);
86
		$smcFunc['db_free_result']($request);
87
	}
88
89
	// Check if it's locked. It isn't locked if no topic is specified.
90
	if (!empty($topic))

Sources/Subs.php 1 location

@@ 111-129 (lines=19) @@
108
					}
109
110
					// What about unapproved COPPA registrations?
111
					if (!empty($modSettings['coppaType']) && $modSettings['coppaType'] != 1)
112
					{
113
						$result = $smcFunc['db_query']('', '
114
						SELECT COUNT(*)
115
						FROM {db_prefix}members
116
						WHERE is_activated = {int:coppa_approval}',
117
							array(
118
								'coppa_approval' => 5,
119
							)
120
						);
121
						list ($coppa_approvals) = $smcFunc['db_fetch_row']($result);
122
						$smcFunc['db_free_result']($result);
123
124
						// Add this to the number of unapproved members
125
						if (!empty($changes['unapprovedMembers']))
126
							$changes['unapprovedMembers'] += $coppa_approvals;
127
						else
128
							$changes['unapprovedMembers'] = $coppa_approvals;
129
					}
130
				}
131
			}
132
			updateSettings($changes);