Po zamianie, biała strona z błędem Fatal error: Using $this when not in object context. Nadal wskazanie na linie nr 48.
Załączam całą zawartość pliku. Jedynie w funkcji sprawdzającej dostęp jako argument jest $settings. W reszcie this->settings.
<?php
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class public_core_attach_attachiHost extends ipsCommand
{
/**
* Class entry point
*
* @param object Registry reference
* @return @e void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
if ( ! self::checkAccess( $registry, $this->settings, $this->request['fromApp'], array( 'forum' => $this->request['fromForum'] ) ) )
{
return '';
}
$this->lang->loadLanguageFile( array( 'public_ihost' ), 'ihost' );
$data = array();
/* Generate max filesize */
$data['max_size'] = IPSLib::sizeFormat( $this->settings['dp3_ihost_max_size'] * 1024 );
/* Build allowed extensions info */
$data['ext'] = str_replace( ',', ', ', $this->settings['dp3_ihost_ext'] );
/* AJAX Class */
if ( ! $this->registry->isClassLoaded( 'classAjax' ) )
{
require_once( IPS_KERNEL_PATH . 'classAjax.php' );
$this->registry->setClass( 'classAjax', new classAjax() );
}
return $this->registry->classAjax->returnHtml( $this->registry->output->getTemplate('post')->attachiFrameiHost($data) );
}
public static function checkAccess( ipsRegistry $registry, $app, $settings, $extra )
{
/* Check enabled and forum not excluded */
if ( ! $settings['dp3_ihost_enable']
or ( $app == 'forums' and $extra['forum']
and in_array( $extra['forum'], explode( ',', $settings['iHostPostUploadFormExclude'] ) ) ) )
{
return FALSE;
}
/* Load class */
if ( ! $registry->isClassLoaded( 'iHostLibrary' ) )
{
require_once( IPSLib::getAppDir( 'ihost' ) . '/sources/classes/library.php' );
$registry->setClass( 'iHostLibrary', new iHostLibrary( $registry ) );
}
/* Check main access */
if( ! $registry->iHostLibrary->checkAccess() )
{
return FALSE;
}
/* Check main permissions to add */
if( ( $settings['dp3_ihost_access_type'] == 'perm' ) && ! $registry->iHostLibrary->checkPerms( 'add' ) )
{
return FALSE;
}
return TRUE;
}
}