Changeset 1121 for trunk/smf/Sources/Modlog.php
- Timestamp:
- 03/29/10 15:37:29 (2 years ago)
- File:
-
- 1 edited
-
trunk/smf/Sources/Modlog.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/smf/Sources/Modlog.php
r852 r1121 6 6 * Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) * 7 7 * =============================================================================== * 8 * Software Version: SMF 1.1 *8 * Software Version: SMF 1.1.11 * 9 9 * Software by: Simple Machines (http://www.simplemachines.org) * 10 * Copyright 2006 by:Simple Machines LLC (http://www.simplemachines.org) *10 * Copyright 2006-2009 by: Simple Machines LLC (http://www.simplemachines.org) * 11 11 * 2001-2006 by: Lewis Media (http://www.lewismedia.com) * 12 12 * Support, News, Updates at: http://www.simplemachines.org * … … 93 93 } 94 94 95 // If we have no search, a broken search, or a new search - then create a new array. 95 // This array houses all the valid search types. 96 $searchTypes = array( 97 'action' => array('sql' => 'lm.action', 'label' => $txt['modlog_action']), 98 'member' => array('sql' => 'mem.realName', 'label' => $txt['modlog_member']), 99 'group' => array('sql' => 'mg.groupName', 'label' => $txt['modlog_position']), 100 'ip' => array('sql' => 'lm.ip', 'label' => $txt['modlog_ip']) 101 ); 102 96 103 if (!isset($search_params['string']) || (!empty($_REQUEST['search']) && $search_params['string'] != $_REQUEST['search'])) 97 { 98 // This array houses all the valid search types. 99 $searchTypes = array( 100 'action' => array('sql' => 'lm.action', 'label' => $txt['modlog_action']), 101 'member' => array('sql' => 'mem.realName', 'label' => $txt['modlog_member']), 102 'group' => array('sql' => 'mg.groupName', 'label' => $txt['modlog_position']), 103 'ip' => array('sql' => 'lm.ip', 'label' => $txt['modlog_ip']) 104 ); 105 106 $search_params = array( 107 'string' => empty($_REQUEST['search']) ? '' : $_REQUEST['search'], 108 'type' => isset($_REQUEST['search_type']) && isset($searchTypes[$_REQUEST['search_type']]) ? $_REQUEST['search_type'] : isset($searchTypes[$context['order']]) ? $context['order'] : 'member', 109 'type_sql' => isset($_REQUEST['search_type']) && isset($searchTypes[$_REQUEST['search_type']]) ? $searchTypes[$_REQUEST['search_type']]['sql'] : isset($searchTypes[$context['order']]) ? $context['columns'][$context['order']]['sql'] : 'mem.realName', 110 'type_label' => isset($_REQUEST['search_type']) && isset($searchTypes[$_REQUEST['search_type']]) ? $searchTypes[$_REQUEST['search_type']]['label'] : isset($searchTypes[$context['order']]) ? $context['columns'][$context['order']]['label'] : $txt['modlog_member'], 111 ); 112 } 104 $search_params_string = empty($_REQUEST['search']) ? '' : $_REQUEST['search']; 105 else 106 $search_params_string = $search_params['string']; 107 108 if (isset($_REQUEST['search_type']) || empty($search_params['type']) || !isset($searchTypes[$search_params['type']])) 109 $search_params_type = isset($_REQUEST['search_type']) && isset($searchTypes[$_REQUEST['search_type']]) ? $_REQUEST['search_type'] : (isset($searchTypes[$context['order']]) ? $context['order'] : 'member'); 110 else 111 $search_params_type = $search_params['type']; 112 113 $search_params_column = $searchTypes[$search_params_type]['sql']; 114 $search_params = array( 115 'string' => $search_params_string, 116 'type' => $search_params_type, 117 ); 113 118 114 119 // Setup the search context. … … 117 122 'string' => stripslashes($search_params['string']), 118 123 'type' => $search_params['type'], 119 'label' => $search _params['type_label']124 'label' => $searchTypes[$search_params_type]['label'], 120 125 ); 121 126 … … 168 173 LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lm.ID_MEMBER) 169 174 LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))" . (!empty($search_params['string']) ? " 170 WHERE INSTR($search_params [type_sql], '$search_params[string]')" : ''), __FILE__, __LINE__);175 WHERE INSTR($search_params_column, '$search_params[string]')" : ''), __FILE__, __LINE__); 171 176 list ($context['entry_count']) = mysql_fetch_row($result); 172 177 mysql_free_result($result); … … 184 189 LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lm.ID_MEMBER) 185 190 LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))" . (!empty($search_params['string']) ? " 186 WHERE INSTR($search_params [type_sql], '$search_params[string]')" : '') . "191 WHERE INSTR($search_params_column, '$search_params[string]')" : '') . " 187 192 ORDER BY $orderType" . (isset($_REQUEST['d']) ? '' : ' DESC') . " 188 193 LIMIT $context[start], $displaypage", __FILE__, __LINE__);
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)