Преглед изворни кода

! Decluttering the memberlist and killing a useless function.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer пре 10 година
родитељ
комит
69c9d60019
3 измењених фајлова са 7 додато и 34 уклоњено
  1. 0 7
      Sources/Memberlist.php
  2. 7 24
      Sources/SendTopic.php
  3. 0 3
      Themes/default/Memberlist.template.php

+ 0 - 7
Sources/Memberlist.php

@@ -75,13 +75,6 @@ function Memberlist()
 				'up' => 'mem.real_name ASC'
 			),
 		),
-		'email_address' => array(
-			'label' => $txt['email'],
-			'sort' => array(
-				'down' => allowedTo('moderate_forum') ? 'mem.email_address DESC' : 'mem.hide_email DESC, mem.email_address DESC',
-				'up' => allowedTo('moderate_forum') ? 'mem.email_address ASC' : 'mem.hide_email ASC, mem.email_address ASC'
-			),
-		),
 		'website_url' => array(
 			'label' => $txt['website'],
 			'link_with' => 'website',

+ 7 - 24
Sources/SendTopic.php

@@ -15,36 +15,13 @@
 if (!defined('SMF'))
 	die('No direct access...');
 
-/**
- * The main handling function for sending specialist (Or otherwise) emails to a user.
- */
-function EmailUser()
-{
-	global $context;
-
-	// Don't index anything here.
-	$context['robot_no_index'] = true;
-
-	// Load the template.
-	loadTemplate('SendTopic');
-
-	$sub_actions = array(
-		'email' => 'CustomEmail',
-	);
-
-	if (!isset($_GET['sa']) || !isset($sub_actions[$_GET['sa']]))
-		$_GET['sa'] = 'email';
-
-	$sub_actions[$_GET['sa']]();
-}
-
 /**
  * Allow a user to send an email.
  * Send an email to the user - allow the sender to write the message.
  * Can either be passed a user ID as uid or a message id as msg.
  * Does not check permissions for a message ID as there is no information disclosed.
  */
-function CustomEmail()
+function EmailUser()
 {
 	global $context, $user_info, $smcFunc, $txt, $scripturl, $sourcedir;
 
@@ -54,6 +31,12 @@ function CustomEmail()
 
 	isAllowedTo('send_email_to_members');
 
+	// Don't index anything here.
+	$context['robot_no_index'] = true;
+
+	// Load the template.
+	loadTemplate('SendTopic');
+
 	// Are we sending to a user?
 	$context['form_hidden_vars'] = array();
 	if (isset($_REQUEST['uid']))

+ 0 - 3
Themes/default/Memberlist.template.php

@@ -72,9 +72,6 @@ function template_main()
 						', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['text'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" class="centericon">' : $member['online']['label'], $context['can_send_pm'] ? '</a>' : '', '
 					</td>
 					<td class="lefttext">', $member['link'], '</td>';
-			if ($context['can_send_email'])
-				echo '
-					<td class="centertext">', $member['show_email'] == 'no' ? '' : '<a href="' . $scripturl . '?action=emailuser;sa=email;uid=' . $member['id'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $member['name'] . '"></span></a>', '</td>';
 
 		if (!isset($context['disabled_fields']['website']))
 			echo '