Browse Source

Merge https://github.com/Spuds/playpen

emanuele 13 years ago
parent
commit
fdd32fe9dd

+ 6 - 8
Sources/PersonalMessage.php

@@ -3025,12 +3025,10 @@ function MessageSettings()
 
 /**
  * Allows the user to report a personal message to an administrator.
- * In the first instance requires that the ID of the message to report
- * is passed through $_GET.
- * It allows the user to report to either a particular administrator - or
- * the whole admin team.
- * It will forward on a copy of the original message without allowing the
- * reporter to make changes.
+ *
+ * - In the first instance requires that the ID of the message to report is passed through $_GET.
+ * - It allows the user to report to either a particular administrator - or the whole admin team.
+ * - It will forward on a copy of the original message without allowing the reporter to make changes.
  *
  * @uses report_message sub-template.
  */
@@ -3138,11 +3136,11 @@ function ReportMessage()
 			SELECT id_member, real_name, lngfile
 			FROM {db_prefix}members
 			WHERE (id_group = {int:admin_id} OR FIND_IN_SET({int:admin_id}, additional_groups) != 0)
-				' . (empty($_POST['ID_ADMIN']) ? '' : 'AND id_member = {int:specific_admin}') . '
+				' . (empty($_POST['id_admin']) ? '' : 'AND id_member = {int:specific_admin}') . '
 			ORDER BY lngfile',
 			array(
 				'admin_id' => 1,
-				'specific_admin' => isset($_POST['ID_ADMIN']) ? (int) $_POST['ID_ADMIN'] : 0,
+				'specific_admin' => isset($_POST['id_admin']) ? (int) $_POST['id_admin'] : 0,
 			)
 		);
 

+ 5 - 1
Sources/Recent.php

@@ -17,7 +17,11 @@ if (!defined('SMF'))
 	die('Hacking attempt...');
 
 /**
- * Get the latest post.
+ * Get the latest post made on the system
+ *
+ * - respects approved, recycled, and board permissions
+ * - @todo is this even used anywhere?
+ *
  * @return array
  */
 function getLastPost()

+ 5 - 3
Sources/Search.php

@@ -1233,14 +1233,16 @@ function PlushSearch2()
 						$numTables = 0;
 						$prev_join = 0;
 						$count = 0;
+						$excluded = false;
 						foreach ($words['subject_words'] as $subjectWord)
 						{
 							$numTables++;
 							if (in_array($subjectWord, $excludedSubjectWords))
 							{
-								if ($subject_query['from'] != '{db_prefix}messages AS m')
-								{
+								if (($subject_query['from'] != '{db_prefix}messages AS m') && !$excluded)
+								{ 
 									$subject_query['inner_join'][] = '{db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)';
+									$excluded = true;
 								}
 								$subject_query['left_join'][] = '{db_prefix}log_search_subjects AS subj' . $numTables . ' ON (subj' . $numTables . '.word ' . (empty($modSettings['search_match_words']) ? 'LIKE {string:subject_not_' . $count . '}' : '= {string:subject_not_' . $count . '}') . ' AND subj' . $numTables . '.id_topic = t.id_topic)';
 								$subject_query['params']['subject_not_' . $count] = empty($modSettings['search_match_words']) ? '%' . $subjectWord . '%' : $subjectWord;
@@ -1305,7 +1307,7 @@ function PlushSearch2()
 						// Nothing to search for?
 						if (empty($subject_query['where']))
 							continue;
-
+						
 						$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_topics', ($smcFunc['db_support_ignore'] ? ( '
 							INSERT IGNORE INTO {db_prefix}' . ($createTemporary ? 'tmp_' : '') . 'log_search_topics
 								(' . ($createTemporary ? '' : 'id_search, ') . 'id_topic)') : '') . '

+ 3 - 3
Sources/Subs.php

@@ -579,7 +579,7 @@ function constructPageIndex($base_url, &$start, $max_value, $num_per_page, $flex
 
 		// Show the '...' part near the end. (1 ... 6 7 [8] 9 10 >...< 15)
 		if ($start + $num_per_page * ($PageContiguous + 1) < $tmpMaxPages)
-			$pageindex .= '<span style="font-weight: bold;" onclick="expandPages(this, \'' . ($flexible_start ? strtr($base_url, array('\'' => '\\\'')) : strtr($base_url, array('%' => '%%', '\'' => '\\\'')) . ';start=%1$d') . '\', ' . ($start + $num_per_page * ($PageContiguous + 1)) . ', ' . $tmpMaxPages . ', ' . $num_per_page . ');" onmouseover="this.style.cursor=\'pointer\';"> ... </span>';
+			$pageindex .= '<span style="font-weight: bold;" onclick="' . htmlspecialchars('expandPages(this, ' . JavaScriptEscape(($flexible_start ? $base_url : strtr($base_url, array('%' => '%%')) . ';start=%1$d')) . ', ' . ($start + $num_per_page * ($PageContiguous + 1)) . ', ' . $tmpMaxPages . ', ' . $num_per_page . ');') . '" onmouseover="this.style.cursor=\'pointer\';"> ... </span>';
 
 		// Show the last number in the list. (1 ... 6 7 [8] 9 10 ... >15<)
 		if ($start + $num_per_page * $PageContiguous < $tmpMaxPages)
@@ -2407,13 +2407,13 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
 function parsesmileys(&$message)
 {
 	global $modSettings, $txt, $user_info, $context, $smcFunc;
-	static $smileyPregSearch = array(), $smileyPregReplacements = array();
+	static $smileyPregSearch = null, $smileyPregReplacements = array();
 
 	// No smiley set at all?!
 	if ($user_info['smiley_set'] === 'none' || trim($message) === '')
 		return;
 
-	// If the smiley array hasn't been set, do it now.
+	// If smileyPregSearch hasn't been set, do it now.
 	if (empty($smileyPregSearch))
 	{
 		// Use the default smileys if it is disabled. (better for "portability" of smileys.)

+ 1 - 1
Sources/Subscriptions-PayPal.php

@@ -85,7 +85,7 @@ class paypal_display
 			$return_data['hidden']['t3'] = $period;
 		}
 
-		// If it's repeatable do soem javascript to respect this idea.
+		// If it's repeatable do some javascript to respect this idea.
 		if (!empty($sub_data['repeatable']))
 			$return_data['javascript'] = '
 				document.write(\'<label for="do_paypal_recur"><input type="checkbox" name="do_paypal_recur" id="do_paypal_recur" checked="checked" onclick="switchPaypalRecur();" class="input_check" />' . $txt['paid_make_recurring'] . '</label><br />\');

+ 1 - 3
Themes/core/Stats.template.php

@@ -193,7 +193,7 @@ function template_main()
 							<td width="15%">', $txt['stats_new_topics'], '</td>
 							<td width="15%">', $txt['stats_new_posts'], '</td>
 							<td width="15%">', $txt['stats_new_members'], '</td>
-							<td width="15%">', $txt['smf_stats_14'], '</td>';
+							<td width="15%">', $txt['most_online'], '</td>';
 
 		if (!empty($modSettings['hitStats']))
 			echo '
@@ -304,5 +304,3 @@ function template_main()
 	// ]]></script>';
 	}
 }
-
-?>

+ 1 - 1
Themes/default/GenericControls.template.php

@@ -322,7 +322,7 @@ function template_control_verification($verify_id, $display_type = 'all', $reset
 			else
 				echo '
 				<div class="smalltext" style="margin: 4px 0 8px 0;">
-					<a href="', $verify_context['image_href'], ';sound" id="visual_verification_', $verify_id, '_sound" rel="nofollow">', $txt['visual_verification_sound'], '</a> / <a href="#" id="visual_verification_', $verify_id, '_refresh">', $txt['visual_verification_request_new'], '</a>', $display_type != 'quick_reply' ? '<br />' : '', '<br />
+					<a href="', $verify_context['image_href'], ';sound" id="visual_verification_', $verify_id, '_sound" rel="nofollow">', $txt['visual_verification_sound'], '</a> / <a href="#visual_verification_', $verify_id, '_refresh" id="visual_verification_', $verify_id, '_refresh">', $txt['visual_verification_request_new'], '</a>', $display_type != 'quick_reply' ? '<br />' : '', '<br />
 					', $txt['visual_verification_description'], ':', $display_type != 'quick_reply' ? '<br />' : '', '
 					<input type="text" name="', $verify_id, '_vv[code]" value="', !empty($verify_context['text_value']) ? $verify_context['text_value'] : '', '" size="30" tabindex="', $context['tabindex']++, '" class="input_text" />
 				</div>';

+ 1 - 1
Themes/default/PersonalMessage.template.php

@@ -1273,7 +1273,7 @@ function template_report_message()
 						<strong>', $txt['pm_report_admins'], ':</strong>
 					</dt>
 					<dd>
-						<select name="ID_ADMIN">
+						<select name="id_admin">
 							<option value="0">', $txt['pm_report_all_admins'], '</option>';
 		foreach ($context['admins'] as $id => $name)
 			echo '

+ 2 - 2
Themes/default/Post.template.php

@@ -103,9 +103,9 @@ function template_main()
 							<dt>
 								<strong style="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'display: none;' : '', '" id="error_serious">', $txt['error_while_submitting'], '</strong>
 							</dt>
-							<dt class="error" id="error_list">
+							<dd class="error" id="error_list">
 								', empty($context['post_error']['messages']) ? '' : implode('<br />', $context['post_error']['messages']), '
-							</dt>
+							</dd>
 						</dl>
 					</div>';
 

+ 1 - 1
Themes/default/Stats.template.php

@@ -348,7 +348,7 @@ function template_main()
 					<th width="15%">', $txt['stats_new_topics'], '</th>
 					<th width="15%">', $txt['stats_new_posts'], '</th>
 					<th width="15%">', $txt['stats_new_members'], '</th>
-					<th', empty($modSettings['hitStats']) ? ' class="last_th"' : '', ' width="15%">', $txt['smf_stats_14'], '</th>';
+					<th', empty($modSettings['hitStats']) ? ' class="last_th"' : '', ' width="15%">', $txt['most_online'], '</th>';
 
 		if (!empty($modSettings['hitStats']))
 			echo '