Вход Регистрация
Файл: IPBMafia.ru_IPB_3.4.6_Final_Rus _Nulled/board/upload/admin/applications/members/extensions/modcp/plugin_banned.php
Строк: 135
<?php
/**
 * @file        plugin_banned.php     Moderator control panel plugin: banned members
 *~TERABYTE_DOC_READY~
 * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
 * $License: http://www.invisionpower.com/company/standards.php#license$
 * $Author: mmecham $
 * @since        2/17/2011
 * $LastChangedDate: 2012-01-24 11:56:40 -0500 (Tue, 24 Jan 2012) $
 * @version        v3.4.6
 * $Revision: 10180 $
 */

if ( ! defined'IN_IPB' ) )
{
    print 
"<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
    exit();
}

/**
 *
 * @class        plugin_members_banned
 * @brief        Moderator control panel plugin: banned members
 * 
 */
class plugin_members_banned
{
    
/**
     * Registry Object Shortcuts
     *
     * @var        $registry
     * @var        $DB
     * @var        $settings
     * @var        $request
     * @var        $lang
     * @var        $member
     * @var        $memberData
     * @var        $cache
     * @var        $caches
     */
    
protected $registry;
    protected 
$DB;
    protected 
$settings;
    protected 
$request;
    protected 
$lang;
    protected 
$member;
    protected 
$memberData;
    protected 
$cache;
    protected 
$caches;

    
/**
     * Main function executed automatically by the controller
     *
     * @param    object        $registry        Registry object
     * @return    @e void
     */
    
public function __constructipsRegistry $registry 
    {
        
//-----------------------------------------
        // Make shortcuts
        //-----------------------------------------
        
        
$this->registry        $registry;
        
$this->DB            $this->registry->DB();
        
$this->settings        =& $this->registry->fetchSettings();
        
$this->request        =& $this->registry->fetchRequest();
        
$this->member        $this->registry->member();
        
$this->memberData    =& $this->registry->member()->fetchMemberData();
        
$this->cache        $this->registry->cache();
        
$this->caches        =& $this->registry->cache()->fetchCaches();
        
$this->lang            $this->registry->class_localization;
        
        
/* Load language strings.. */
        
$this->lang->loadLanguageFile( array( 'public_list' ), 'members' );
    }
    
    
/**
     * Returns the primary tab key for the navigation bar
     * 
     * @return    @e string
     */
    
public function getPrimaryTab()
    {
        return 
'manage_members';
    }
    
    
/**
     * Returns the secondary tab key for the navigation bar
     * 
     * @return    @e string
     */
    
public function getSecondaryTab()
    {
        return 
'banned';
    }

    
/**
     * Determine if we can view tab
     *
     * @param    array     $permissions    Moderator permissions
     * @return    @e bool
     */
    
public function canView$permissions )
    {
        if( 
$this->memberData['g_is_supmod'] OR ( $this->memberData['is_mod'] AND $permissions['allow_warn'] ) )
        {
            return 
true;
        }
        
        return 
false;
    }

    
/**
     * Execute plugin
     *
     * @param    array     $permissions    Moderator permissions
     * @return    @e string
     */
    
public function executePlugin$permissions )
    {
        
//-----------------------------------------
        // Check permissions
        //-----------------------------------------

        
if( !$this->canView$permissions ) )
        {
            return 
'';
        }
        
        
/* Add some CSS */
        
$this->registry->output->addToDocumentHead'importcss'"{$this->settings['css_base_url']}style_css/{$this->registry->output->skin['_csscacheid']}/ipb_mlist.css" );

        
//-----------------------------------------
        // Get 10 banned members
        //-----------------------------------------
        
        
$members    = array();
        
        
$st            intval($this->request['st']);
        
$total        $this->DB->buildAndFetch( array( 'select' => 'count(*) as members''from' => 'members''where' => "member_banned=1" ) );

        
$this->DB->build( array(
                                
'select'    => 'm.*',
                                
'from'        => array( 'members' => 'm' ),
                                
'order'        => 'm.joined DESC',
                                
'limit'        => array( $st10 ),
                                
'where'        => "m.member_banned=1",
                                
'add_join'    => array(
                                                    array(
                                                        
'select'    => 'pp.*',
                                                        
'from'        => array( 'profile_portal' => 'pp' ),
                                                        
'where'        => 'm.member_id=pp.pp_member_id',
                                                        
'type'        => 'left',
                                                        ),
                                                    ),
                        )        );
        
$outer    $this->DB->execute();
        
        while( 
$r $this->DB->fetch($outer) )
        {
            
$r['_language']    = $this->lang->words['modcp_modq_indef'];

            
$members[]        = IPSMember::buildDisplayData$r );
        }

        
//-----------------------------------------
        // Page links
        //-----------------------------------------
        
        
$pages    $this->registry->output->generatePagination( array(    'totalItems'        => $total['members'],
                                                                        
'itemsPerPage'        => 10,
                                                                        
'currentStartValue'    => $st,
                                                                        
'baseUrl'            => "app=core&amp;module=modcp&amp;fromapp=members&amp;tab=banned",
                                                            )        );

        return 
$this->registry->output->getTemplate('modcp')->membersList'banned'$members$pages );
    }
}
Онлайн: 2
Реклама