FastCGI sent in stderr: "PHP Fatal error: Call to undefined method ...

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
316
Реакции
131
Помог
4 раз(а)
При переходе на site.ru/ppa/bans > "страница не доступна", это можно исправить?
erro logs
PHP:
2017/11/08 16:21:35 [error] 9638#0: *4205 FastCGI sent in stderr: "PHP Fatal error:  Call to undefined method IPS\playerpanelamxx\Table\Db::getSortDirection() in /home/public_html/system/Theme/Theme.php(824) : eval()'d code on line 2440" while reading response header from upstream, client: *, server: site.ru, request: "GET /ppa/bans HTTP/1.1", upstream: "fastcgi://unix:/var/php-nginx/150841743328905.sock/socket:", host: "site.ru"


Db.php
PHP:
<?php
/**
* @brief Table Builder using a database table datasource
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @since 18 Feb 2013
* @version SVN_VERSION_NUMBER
*/

namespace IPS\playerpanelamxx\Table;

/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}

/**
* List Table Builder using a database table datasource
*/
class _Db extends Table
{
protected $identifier;

/**
* @brief Database Table
*/
protected $table;

/**
* @brief Selects
*/
public $selects = array();

/**
* @brief Initial WHERE clause
*/
public $where;

/**
* @brief Initial GROUP BY clause
*/
protected $group;

/**
* @brief Force index clause
*/
protected $index;

/**
* @brief Joins
*/
public $joins = array();

/**
* @brief Key field
*/
public $keyField = NULL;

/**
* @brief Restrict select columns to only those listed - useful when grouping
*/
public $onlySelected = NULL;

/**
* Constructor
*
* @param mixed $identifier Identifier
* @param array $connectionSettings Connection settings (use when initiating a new connection)
* @param array|string $table Database table
* @param \IPS\Http\Url $baseUrl Base URL
* @param array|null $where WHERE clause
* @param string|null $group GROUP clause
* @param array|null $forceIndex Index to force
* @return void
*/
public function __construct( $identifier=NULL, $connectionSettings=array(), $table, \IPS\Http\Url $baseUrl, $where=NULL, $group=NULL, $forceIndex=NULL )
{
/* Did we pass a null value? */
$identifier = ( $identifier === NULL ) ? '__MAIN' : $identifier;

/* Load the default settings if necessary */
if( $identifier === '__MAIN' )
{
require( \IPS\ROOT_PATH . '/conf_global.php' );
$connectionSettings = isset( $INFO ) ? $INFO : [];
}

\IPS\Db::i($identifier, $connectionSettings);

$this->identifier = $identifier;
$this->table = $table;
$this->where = $where;
$this->group = $group;
$this->index = $forceIndex;

return parent::__construct( $baseUrl );
}

/**
* Get rows
*
* @param array $advancedSearchValues Values from the advanced search form
* @return array
*/
public function getRows( $advancedSearchValues )
{
/* Specify filter in where clause */
$where = $this->where ? is_array( $this->where ) ? $this->where : array( $this->where ) : array();

if ( $this->filter and isset( $this->filters[ $this->filter ] ) )
{
$where[] = is_array( $this->filters[ $this->filter ] ) ? $this->filters[ $this->filter ] : array( $this->filters[ $this->filter ] );
}

/* Add quick search term to where clause if necessary */
if ( $this->quickSearch !== NULL and \IPS\Request::i()->quicksearch )
{
if ( is_callable( $this->quickSearch ) )
{
$where[] = call_user_func( $this->quickSearch, trim( \IPS\Request::i()->quicksearch ) );
}
else
{
$columns = is_array( $this->quickSearch ) ? $this->quickSearch[0] : $this->quickSearch;
$columns = is_array( $columns ) ? $columns : array( $columns );

$_where = array();
foreach ( $columns as $c )
{
$_where[] = "LOWER(`{$c}`) LIKE CONCAT( '%', ?, '%' )";
}

$where[] = array_merge( array( '(' . implode( ' OR ', $_where ) . ')' ), array_fill( 0, count( $_where ), mb_strtolower( trim( \IPS\Request::i()->quicksearch ) ) ) );
}
}

/* Add advanced search */
if ( !empty( $advancedSearchValues ) )
{
foreach ( $advancedSearchValues as $k => $v )
{
if ( isset( $this->advancedSearch[ $k ] ) AND $v !== '' )
{
$type = $this->advancedSearch[ $k ];

if ( is_array( $type ) )
{
if ( isset( $type[2] ) )
{
$lambda = $type[2];
$type = SEARCH_CUSTOM;
}
else
{
$options = $type[1];
$type = $type[0];
}
}

switch ( $type )
{
case SEARCH_CUSTOM:
if ( $clause = call_user_func( $lambda, $v ) )
{
$where[] = $clause;
}
break;

case SEARCH_CONTAINS_TEXT:
$where[] = array( "{$k} LIKE ?", '%' . $v . '%' );
break;
case SEARCH_QUERY_TEXT:
switch ( $v[0] )
{
case 'c':
$where[] = array( "{$k} LIKE ?", '%' . $v[1] . '%' );
break;
case 'bw':
$where[] = array( "{$k} LIKE ?", $v[1] . '%' );
break;
case 'eq':
$where[] = array( "{$k}=?", $v[1] );
break;
}
break;
case SEARCH_DATE_RANGE:
$timezone = ( \IPS\Member::loggedIn()->timezone ? new \DateTimeZone( \IPS\Member::loggedIn()->timezone ) : NULL );

if ( $v['start'] )
{
if( !( $v['start'] instanceof \IPS\DateTime ) )
{
$v['start'] = new \IPS\DateTime( $v['start'], $timezone );
}

$where[] = array( "{$k}>?", $v['start']->getTimestamp() );
}
if ( $v['end'] )
{
if( !( $v['end'] instanceof \IPS\DateTime ) )
{
$v['end'] = new \IPS\DateTime( $v['end'], $timezone );
}

$where[] = array( "{$k}<?", $v['end']->getTimestamp() );
}
break;

case SEARCH_SELECT:
if ( isset( $options['multiple'] ) AND $options['multiple'] === TRUE )
{
$where[] = array( \IPS\Db::i($this->identifier)->in( $k, $v ) );
}
else
{
$where[] = array( "{$k}=?", $v );
}
break;

case SEARCH_MEMBER:
if( $v instanceof \IPS\Member )
{
$where[] = array( "{$k}=?", $v->member_id );
}
break;

case SEARCH_NODE:
$nodeClass = $options['class'];
$prop = isset( $options['searchProp'] ) ? $options['searchProp'] : '_id';
if ( !is_array( $v ) )
{
$v = array( $v );
}

$values = array();
foreach ( $v as $_v )
{
if ( !is_object( $_v ) )
{
if ( mb_substr( $_v, 0, 2 ) === 's.' )
{
$nodeClass = $nodeClass::$subnodeClass;
$_v = mb_substr( $_v, 2 );
}
try
{
$_v = $nodeClass::load( $_v );
}
catch ( \OutOfRangeException $e )
{
continue;
}
}
$values[] = $_v->$prop;
}
$where[] = array( \IPS\Db::i($this->identifier)->in( $k, $values ) );
break;

case SEARCH_NUMERIC:
case SEARCH_NUMERIC_TEXT:
switch ( $v[0] )
{
case 'gt':
$where[] = array( "{$k}>?", (float) $v[1] );
break;
case 'lt':
$where[] = array( "{$k}<?", (float) $v[1] );
break;
case 'eq':
$where[] = array( "{$k}=?", (float) $v[1] );
break;
}
break;

case SEARCH_BOOL:
$where[] = array( "{$k}=?", (bool) $v );
break;
}
}
else
{
unset( $advancedSearchValues[ $k ] );
}
}
}

$selects = $this->selects;

if( $this->onlySelected !== NULL )
{
foreach( $this->onlySelected as $column )
{
$selects[] = $column;
}

if( $this->group !== NULL )
{
$this->group = is_array( $this->group ) ? $this->group : array( $this->group );
$this->group = array_unique( array_merge( $this->group, $this->onlySelected ) );
}
}
else
{
if ( count( $this->joins ) )
{
foreach( $this->joins as $join )
{
if ( isset( $join['select'] ) )
{
$selects[] = $join['select'];
}
}
}
}

/* Count results (for pagination) */
$count = \IPS\Db::i($this->identifier)->select( 'count(*)', $this->table, $where );
if ( count( $this->joins ) )
{
foreach( $this->joins as $join )
{
$count->join( $join['from'], ( isset( $join['where'] ) ? $join['where'] : null ), ( isset( $join['type'] ) ) ? $join['type'] : 'LEFT' );
}
}
$count = $count->first();

/* Now get column headers */
$query = \IPS\Db::i($this->identifier)->select( $this->onlySelected ? implode( ', ', $selects ) : '*', $this->table, $where, NULL, array( 0, 1 ), $this->group );

if ( count( $this->joins ) )
{
foreach( $this->joins as $join )
{
$query->join( $join['from'], ( isset( $join['where'] ) ? $join['where'] : null ), ( isset( $join['type'] ) ) ? $join['type'] : 'LEFT' );
}
}

if ( $this->index )
{
$query->forceIndex( $this->index );
}

try
{
$results = $query->first();
}
catch( \UnderflowException $e )
{
$results = array();
}

$this->pages = ceil( $count / $this->limit );

/* What are we sorting by? */
$orderBy = NULL;
if ( $this->_isSqlSort( $results ) )
{
$orderBy = implode( ',', array_map( function( $v )
{
/* This gives you something like "g`.`g_id" which is then turned into "`g`.`g_id`" below */
$v = str_replace( '.', "`.`", $v );

if ( ! mb_strstr( trim( $v ), ' ' ) )
{
$return = ( isset( $this->advancedSearch[$v] ) and $this->advancedSearch[$v] == SEARCH_NUMERIC_TEXT ) ? 'LENGTH(' . '`' . trim( $v ) . '`' . ') ' . $this->sortDirection . ', ' . '`' . trim( $v ) . '` ' : '`' . trim( $v ) . '` ';
}
else
{
list( $field, $direction ) = explode( ' ', $v );
$return = ( isset( $this->advancedSearch[$v] ) and $this->advancedSearch[$v] == SEARCH_NUMERIC_TEXT ) ? 'LENGTH(' . '`' . trim( $field ) . '`' . ') ' . mb_strtolower( $direction ) == 'asc' ? 'asc' : 'desc' . ', ' . '`' . trim( $field ) . '` ' : '`' . trim( $field ) . '` ';
$return .= ( mb_strtolower( $direction ) == 'asc' ? 'asc' : 'desc' );
}
return $return;
}, explode( ',', $this->sortBy ) ) );

$orderBy .= $this->sortDirection == 'asc' ? ' asc' : ' desc';
}

/* Run query */
$rows = array();
$select = \IPS\Db::i($this->identifier)->select(
$this->onlySelected ? implode( ', ', $selects ) : ( ( count( $selects ) ) ? $this->table . '.*, ' . implode( ', ', $selects ) : '*' ),
$this->table,
$where,
$orderBy,
array( ( $this->limit * ( $this->page - 1 ) ), $this->limit ),
$this->group
);

if ( $this->index )
{
$select->forceIndex( $this->index );
}

if ( count( $this->joins ) )
{
foreach( $this->joins as $join )
{
$select->join( $join['from'], $join['where'], ( isset( $join['type'] ) ) ? $join['type'] : 'LEFT' );
}
}
if ( $this->keyField !== NULL )
{
$select->setKeyField( $this->keyField );
}

foreach ( $select as $rowId => $row )
{
/* Add in any 'custom' fields */
$_row = $row;
if ( $this->include !== NULL )
{
$row = array();
foreach ( $this->include as $k )
{
$row[ $k ] = isset( $_row[ $k ] ) ? $_row[ $k ] : NULL;
}

if( !empty( $advancedSearchValues ) )
{
foreach ( $advancedSearchValues as $k => $v )
{
$row[ $k ] = isset( $_row[ $k ] ) ? $_row[ $k ] : NULL;
}
}
}

/* Loop the data */
foreach ( $row as $k => $v )
{
/* Parse if necessary (NB: deliberately do this before removing the row in case we need to do some processing, but don't want the column to actually show) */
if( isset( $this->parsers[ $k ] ) )
{
$v = call_user_func( $this->parsers[ $k ], $v, $_row );
}
else
{
$v = htmlspecialchars( $v, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
}

/* Are we including this one? */
if( ( ( $this->include !== NULL and !in_array( $k, $this->include ) ) or ( $this->exclude !== NULL and in_array( $k, $this->exclude ) ) ) and !array_key_exists( $k, $advancedSearchValues ) )
{
unset( $row[ $k ] );
continue;
}

/* Add to array */
$row[ $k ] = $v;
}

/* Add in some buttons if necessary */
if( $this->rowButtons !== NULL )
{
$row['_buttons'] = call_user_func( $this->rowButtons, $_row );
}

$rows[ $rowId ] = $row;
}

/* If we're sorting on a column not in the DB, do it manually */
if ( $this->sortBy and $this->_isSqlSort( $results ) !== true )
{
$sortBy = $this->sortBy;
$sortDirection = $this->sortDirection;
uasort( $rows, function( $a, $b ) use ( $sortBy, $sortDirection )
{
if( $sortDirection === 'asc' )
{
return strnatcasecmp( mb_strtolower( $a[ $sortBy ] ), mb_strtolower( $b[ $sortBy ] ) );
}
else
{
return strnatcasecmp( mb_strtolower( $b[ $sortBy ] ), mb_strtolower( $a[ $sortBy ] ) );
}
});
}

/* Return */
return $rows;
}

/**
* User set sortBy is suitable for an SQL sort operation
* @param array $count Result of COUNT(*) query with field names included
* @return boolean
*/
protected function _isSqlSort( $count )
{
if ( !$this->sortBy )
{
return false;
}

if ( mb_strstr( $this->sortBy, ',' ) )
{
foreach( explode( ',', $this->sortBy ) as $field )
{
/* Get rid of table alias if there is one */
if( mb_strpos( $field, '.' ) !== FALSE )
{
$field = explode( '.', $field );
$field = $field[1];
}

$field = trim($field);

if ( mb_strstr( $field, ' ' ) )
{
list( $field, $direction ) = explode( ' ', $field );
}

if ( !array_key_exists( trim($field), $count ) )
{
return false;
}
}

return true;
}
elseif ( array_key_exists( preg_replace( "/^.+?\.(.+?)$/", "$1", $this->sortBy ), $count ) )
{
return true;
}

return false;
}

/**
* What custom multimod actions are available
*
* @return array
*/
public function customActions()
{
return array();
}
}
 
В этой теме было размещено решение! Перейти к решению.

Вложения

Сообщения
2,491
Реакции
2,790
Помог
61 раз(а)
покажите лучше /home/public_html/system/Theme/Theme.php
 
Сообщения
316
Реакции
131
Помог
4 раз(а)
fantom, там 5к строк, вот кусок

Код:
    /**
* Get a template
*
* @param string $group Template Group
* @param string $app Application key (NULL for current application)
* @param string $location Template Location (NULL for current template location)
* @return \IPS\Output\Template
* @throws \UnexpectedValueException
*/
public function getTemplate( $group, $app=NULL, $location=NULL )
{
/* Do we have an application? */
if( $app === NULL )
{
$app = \IPS\Dispatcher::i()->application->directory;
}

/* How about a template location? */
if( $location === NULL )
{
$location = \IPS\Dispatcher::i()->controllerLocation;
}

$key = \strtolower( 'template_' . $this->id . '_' . static::makeBuiltTemplateLookupHash( $app, $location, $group ) . '_' . static::cleanGroupName( $group ) );
$cachedObject = NULL;

/* We cannot use isset( static::$calledTemplates[ $key ] ) here because it fails with NULL while in_array does not */
if ( !in_array( $key, array_keys( static::$calledTemplates ) ) )
{
/* First, are we on the front end and using a disk cache? */
if ( static::isUsingTemplateDiskCache() and $location != 'admin' )
{
$cache = new \IPS\Theme\Cache\Template( $app, $location, $group );

if ( $cache->exists() )
{
$cachedObject = $cache->get();
}
else
{
/* If it exists in datastore, use that to write the value */
if ( isset( \IPS\Data\Store::i()->$key ) )
{
try
{
$cache->set( str_replace( 'namespace IPS\Theme;', 'namespace IPS\Theme\Cache;', \IPS\Data\Store::i()->$key ) );
}
catch( \RuntimeException $e )
{
/* Should we log, ignore or collect failures to notify admin? */
}
}
else
{
/* We'll compile it now, but let datastore serve the template this time round */
$this->compileTemplates( $app, $location, $group );
}
}
}

/* If we don't have a compiled template, do that now */
if ( ! $cachedObject and !isset( \IPS\Data\Store::i()->$key ) )
{
/* It can take a few seconds for templates to finish compiling if initiated elsewhere, so let's try a few times sleeping 1 second between attempts
to give the compilation time to finish */
$attempts = 0;
while( $attempts < 6 )
{
if ( $attempts === 5 )
{
/* Rebuild in progress */
\IPS\Log::log( "Template store key: {$key} rebuilding and requested again ({$app}, {$location}, {$group})", "template_store_building" );

/* Since we can't do anything else, this ends up just being an uncaught exception - show the error page right away to avoid the unnecessary logging */
\IPS\IPS::genericExceptionPage();
}

$built = $this->compileTemplates( $app, $location, $group );

if ( $built === NULL )
{
$attempts++;
sleep(1);
}
else
{
break;
}
}

/* Still no key? */
if ( ! isset( \IPS\Data\Store::i()->$key ) )
{
\IPS\Log::log( "Template store key: {$key} missing ({$app}, {$location}, {$group})", "template_store_missing" );

throw new \ErrorException( 'template_store_missing' );
}
}

/* Load compiled template */
if ( $cachedObject )
{
/* Init */
static::$calledTemplates[ $key ] = new \IPS\Theme\SandboxedTemplate( $cachedObject );
}
else
{
$compiledGroup = \IPS\Data\Store::i()->$key;

if ( \IPS\DEBUG_TEMPLATES )
{
static::runDebugTemplate( $key, $compiledGroup );
}
else
{
try
{
if ( @eval( $compiledGroup ) === FALSE )
{
throw new \UnexpectedValueException;
}
}
catch ( \ParseError $e )
{
throw new \UnexpectedValueException;
}
}

/* Hooks */
$class = "\\IPS\\Theme\\" . static::overloadHooks( 'class_' . $app . '_' . $location . '_' . $group );

/* Init */
static::$calledTemplates[ $key ] = new \IPS\Theme\SandboxedTemplate( new $class( $app, $location, $group ) );
}
}

return static::$calledTemplates[ $key ];
}
824 строка if ( @eval( $compiledGroup ) === FALSE )
 
Сообщения
2,491
Реакции
2,790
Помог
61 раз(а)
Eval уже срашно. Туту уже нужно залогировать то что идет на вход этой функции. Например так
file_put_contents(__DIR__.'/temp.log', print_r($compiledGroup, true));
1. Пропишите више этой строкы
2. Убедитись что каталог доступен для записи или измените путь туда где доступ есть
 
Сообщения
316
Реакции
131
Помог
4 раз(а)
fantom,
Код:
namespace IPS\Theme;
class class_playerpanelamxx_front_bans extends \IPS\Theme\Template
{
public $cache_key = 'zdes key';
function banList( $table, $headers, $rows ) {
$return = '';
$return .= <<<CONTENT

<table class='ipsTable ipsTable_responsive ipsTable_zebra'>
<thead>
<tr class='ipsAreaBackground'>
<th>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'gs_ppa_nick', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</th>
<th>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'ban_reason', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</th>
<th>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'date', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</th>
<th>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'gs_ppa_admin', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</th>
<th>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'gs_ppa_ban_length', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</th>
<th>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'status', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</th>
<th style='width: 120px'>&nbsp;</th>
</tr>
</thead>
<tbody>

CONTENT;

foreach ( $rows as $row ):
$return .= <<<CONTENT

<tr class='ipsClearfix'>
<td>
CONTENT;
$return .= htmlspecialchars( $row['player_nick'], ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
$return .= <<<CONTENT
</td>
<td><span data-ipsTooltip title='
CONTENT;
$return .= htmlspecialchars( $row['ban_reason'], ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
$return .= <<<CONTENT
'>
CONTENT;

$return .= htmlspecialchars( mb_substr( html_entity_decode( $row['ban_reason'] ), '0', "25" ), ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ) . ( ( mb_strlen( html_entity_decode( $row['ban_reason'] ) ) > "25" ) ? '&hellip;' : '' );
$return .= <<<CONTENT
</span></td>
<td>
CONTENT;

$val = ( $row['ban_created'] instanceof \IPS\DateTime ) ? $row['ban_created'] : \IPS\DateTime::ts( $row['ban_created'] );$return .= $val->html();
$return .= <<<CONTENT
</td>
<td>
CONTENT;
$return .= htmlspecialchars( $row['admin_nick'], ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
$return .= <<<CONTENT
</td>
<td>
CONTENT;
$return .= htmlspecialchars( $row['ban_length'], ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
$return .= <<<CONTENT
</td>
<td>

CONTENT;

if ( $row['ban_length'] == -1 ):
$return .= <<<CONTENT

<span class='ipsType_success'><i class='fa fa-plus-circle'></i>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'unbanned', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</span>

CONTENT;

elseif ( $row['expired'] == 1 ):
$return .= <<<CONTENT

<span class='ipsType_success'><i class='fa fa-plus-circle'></i>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'inactive', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</span>

CONTENT;

else:
$return .= <<<CONTENT

<span class='ipsType_warning'><i class='fa fa-minus-circle'></i>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'active', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</span>

CONTENT;

endif;
$return .= <<<CONTENT

</td>
<td><a class='ipsButton ipsButton_medium ipsButton_important ipsButton_fullWidth' data-ipsDialog data-ipsDialog-url='
CONTENT;

$return .= str_replace( '&', '&amp;', \IPS\Http\Url::internal( "app=playerpanelamxx&module=panel&controller=panel&area=viewBan&bid={$row['bid']}", null, "ppa_bans_view", array(), 0 ) );
$return .= <<<CONTENT
' data-ipsDialog-title='
CONTENT;
$return .= htmlspecialchars( $row['player_nick'], ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
$return .= <<<CONTENT
' data-ipsDialog-size='medium'>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'app_view_details', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</a></td>
</tr>

CONTENT;

endforeach;
$return .= <<<CONTENT

</tbody>
</table>
CONTENT;

return $return;
}

function myBans( $table, $headers, $rows ) {
$return = '';
$return .= <<<CONTENT

<table class='ipsTable ipsTable_responsive ipsTable_zebra'>
<thead>
<tr class='ipsAreaBackground'>
<th>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'gs_ppa_nick', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</th>
<th>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'ban_reason', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</th>
<th>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'date', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</th>
<th>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'gs_ppa_admin', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</th>
<th>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'gs_ppa_ban_length', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</th>
<th>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'status', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</th>
<th style='width: 120px'>&nbsp;</th>
</tr>
</thead>
<tbody>

CONTENT;

foreach ( $rows as $row ):
$return .= <<<CONTENT

<tr class='ipsClearfix'>
<td>
CONTENT;
$return .= htmlspecialchars( $row['player_nick'], ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
$return .= <<<CONTENT
</td>
<td><span data-ipsTooltip title='
CONTENT;
$return .= htmlspecialchars( $row['ban_reason'], ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
$return .= <<<CONTENT
'>
CONTENT;

$return .= htmlspecialchars( mb_substr( html_entity_decode( $row['ban_reason'] ), '0', "25" ), ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ) . ( ( mb_strlen( html_entity_decode( $row['ban_reason'] ) ) > "25" ) ? '&hellip;' : '' );
$return .= <<<CONTENT
</span></td>
<td>
CONTENT;

$val = ( $row['ban_created'] instanceof \IPS\DateTime ) ? $row['ban_created'] : \IPS\DateTime::ts( $row['ban_created'] );$return .= $val->html();
$return .= <<<CONTENT
</td>
<td>
CONTENT;
$return .= htmlspecialchars( $row['admin_nick'], ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
$return .= <<<CONTENT
</td>
<td>
CONTENT;
$return .= htmlspecialchars( $row['ban_length'], ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
$return .= <<<CONTENT
</td>
<td>

CONTENT;

if ( $row['ban_length'] == -1 ):
$return .= <<<CONTENT

<span class='ipsType_success'><i class='fa fa-plus-circle'></i>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'unbanned', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</span>

CONTENT;

elseif ( $row['expired'] == 1 ):
$return .= <<<CONTENT

<span class='ipsType_success'><i class='fa fa-plus-circle'></i>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'inactive', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</span>

CONTENT;

else:
$return .= <<<CONTENT

<span class='ipsType_warning'><i class='fa fa-minus-circle'></i>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'active', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</span>

CONTENT;

endif;
$return .= <<<CONTENT

</td>
<td><a class='ipsButton ipsButton_medium ipsButton_important ipsButton_fullWidth' data-ipsDialog data-ipsDialog-url='
CONTENT;

$return .= str_replace( '&', '&amp;', \IPS\Http\Url::internal( "app=playerpanelamxx&module=panel&controller=panel&area=viewBan&bid={$row['bid']}", null, "ppa_bans_view", array(), 0 ) );
$return .= <<<CONTENT
' data-ipsDialog-title='
CONTENT;
$return .= htmlspecialchars( $row['player_nick'], ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
$return .= <<<CONTENT
'>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'app_view_details', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</a></td>
</tr>

CONTENT;

endforeach;
$return .= <<<CONTENT

</tbody>
</table>
CONTENT;

return $return;
}

function viewBan( $rows, $canAddAppeal = FALSE, $canUnban = FALSE ) {
$return = '';
$return .= <<<CONTENT


CONTENT;

foreach ( $rows as $row ):
$return .= <<<CONTENT

<table class='ipsTable ipsTable_responsive ipsTable_zebra ipsSpacer_top'>
<tbody>
<tr class='ipsClearfix'>
<td>&nbsp;</td>
<td>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'ip_address', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</td>
<td>{$row['player_ip']}</td>
</tr>
<tr class='ipsClearfix'>
<td>&nbsp;</td>
<td>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'gs_ppa_steamid', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</td>
<td>
CONTENT;
$return .= htmlspecialchars( $row['player_id'], ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
$return .= <<<CONTENT
</td>
</tr>
<tr class='ipsClearfix'>
<td>&nbsp;</td>
<td>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'gs_ppa_server', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</td>
<td>
CONTENT;
$return .= htmlspecialchars( $row['server_name'], ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
$return .= <<<CONTENT
</td>
</tr>
<tr class='ipsClearfix'>
<td>&nbsp;</td>
<td>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'gs_ppa_kicks', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</td>
<td>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->formatNumber( $row['ban_kicks'] );
$return .= <<<CONTENT
</td>
</tr>
<tr class='ipsClearfix'>
<td>&nbsp;</td>
<td>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'gs_ppa_navigation', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</td>
<td>

CONTENT;

if ( $row['expired'] == 0 ):
$return .= <<<CONTENT


CONTENT;

if ( $canAddAppeal ):
$return .= <<<CONTENT

<a href='
CONTENT;

$return .= str_replace( '&', '&amp;', \IPS\Http\Url::internal( "app=playerpanelamxx&module=panel&controller=panel&area=addAppeal&bid={$row['bid']}", null, "ppa_appeals_add", array(), 0 ) );
$return .= <<<CONTENT
'>
<span class='ipsBadge ipsBadge_positive'>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'gs_ppa_post_appeal', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</span>
</a>

CONTENT;

endif;
$return .= <<<CONTENT


CONTENT;

if ( $canUnban ):
$return .= <<<CONTENT

<a href='
CONTENT;

$return .= str_replace( '&', '&amp;', \IPS\Http\Url::internal( "app=playerpanelamxx&module=panel&controller=panel&area=unban&bid={$row['bid']}", null, "ppa_bans_unban", array(), 0 ) );
$return .= <<<CONTENT
'>
<span class='ipsBadge ipsBadge_negative'>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'unban', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</span>
</a>

CONTENT;

endif;
$return .= <<<CONTENT


CONTENT;

else:
$return .= <<<CONTENT

<span class='ipsBadge ipsBadge_neutral'>
CONTENT;

$return .= \IPS\Member::loggedIn()->language()->addToStack( htmlspecialchars( 'gs_ppa_ban_expired', \IPS\HTMLENTITIES, 'UTF-8', FALSE ), TRUE, array( ) );
$return .= <<<CONTENT
</span>

CONTENT;

endif;
$return .= <<<CONTENT

</td>
</tr>
</tbody>
</table>

CONTENT;

endforeach;
$return .= <<<CONTENT

CONTENT;

return $return;
}}
8 Ноя 2017
Theme.php
 
Последнее редактирование модератором:
Сообщения
2,491
Реакции
2,790
Помог
61 раз(а)
alabamaster1337, странно. Ошибка говорит что проблема в строке 2440. А по факту у вас в логе 482 строкы
8 Ноя 2017
А если честно говорить, то я бы не пользовался этим. Установите КСБанс. Так ИМХО проще
 
Сообщения
2,491
Реакции
2,790
Помог
61 раз(а)
alabamaster1337, тут нужно дебагать в дев режиме. а учитывая что там eval то это совсем не просто
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу