Ignore:
Timestamp:
03/29/10 15:37:29 (2 years ago)
Author:
bogdan2412
Message:

Updated with changes from live.

  • Updated SMF to 1.1.11
  • Added Summify to site and forum
  • Small change to job detail view
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/smf/Sources/Modlog.php

    r852 r1121  
    66* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    * 
    77* =============================================================================== * 
    8 * Software Version:           SMF 1.1                                             * 
     8* Software Version:           SMF 1.1.11                                          * 
    99* 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) * 
    1111*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             * 
    1212* Support, News, Updates at:  http://www.simplemachines.org                       * 
     
    9393        } 
    9494 
    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 
    96103        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        ); 
    113118 
    114119        // Setup the search context. 
     
    117122                'string' => stripslashes($search_params['string']), 
    118123                'type' => $search_params['type'], 
    119                 'label' => $search_params['type_label'] 
     124                'label' => $searchTypes[$search_params_type]['label'], 
    120125        ); 
    121126 
     
    168173                        LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lm.ID_MEMBER) 
    169174                        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__); 
    171176        list ($context['entry_count']) = mysql_fetch_row($result); 
    172177        mysql_free_result($result); 
     
    184189                        LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lm.ID_MEMBER) 
    185190                        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]')" : '') . " 
    187192                ORDER BY $orderType" . (isset($_REQUEST['d']) ? '' : ' DESC') . " 
    188193                LIMIT $context[start], $displaypage", __FILE__, __LINE__); 
Note: See TracChangeset for help on using the changeset viewer.