Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -22,6 +22,16 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _Application extends \IPS\Application
|
||||
{
|
||||
/**
|
||||
* @brief Cached advertisement count
|
||||
*/
|
||||
protected $advertisements = NULL;
|
||||
|
||||
/**
|
||||
* @brief Cached clubs pending approval count
|
||||
*/
|
||||
protected $clubs = NULL;
|
||||
|
||||
/**
|
||||
* ACP Menu Numbers
|
||||
*
|
||||
@@ -34,9 +44,21 @@ class _Application extends \IPS\Application
|
||||
switch ( $queryString['controller'] )
|
||||
{
|
||||
case 'advertisements':
|
||||
return \IPS\Db::i()->select( 'COUNT(*)', 'core_advertisements', array( 'ad_active=-1' ) )->first();
|
||||
break;
|
||||
if( $this->advertisements === NULL )
|
||||
{
|
||||
$this->advertisements = \IPS\Db::i()->select( 'COUNT(*)', 'core_advertisements', array( 'ad_active=-1' ) )->first();
|
||||
}
|
||||
return $this->advertisements;
|
||||
|
||||
case 'clubs':
|
||||
if( $this->clubs === NULL )
|
||||
{
|
||||
$this->clubs = \IPS\Db::i()->select( 'COUNT(*)', 'core_clubs', array( 'approved=0' ) )->first();
|
||||
}
|
||||
return $this->clubs;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,6 +89,18 @@ class _Application extends \IPS\Application
|
||||
{
|
||||
return 'cogs';
|
||||
}
|
||||
|
||||
/**
|
||||
* Install Other
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function installOther()
|
||||
{
|
||||
/* Save installed domain to spam defense whitelist */
|
||||
$domain = rtrim( str_replace( 'www.', '', parse_url( \IPS\Settings::i()->base_url, PHP_URL_HOST ) ), '/' );
|
||||
\IPS\Db::i()->insert( 'core_spam_whitelist', array( 'whitelist_type' => 'domain', 'whitelist_content' => $domain, 'whitelist_date' => time(), 'whitelist_reason' => 'Invision Community Domain' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Can view page even when user is a guest when guests cannot access the site
|
||||
@@ -81,7 +115,7 @@ class _Application extends \IPS\Application
|
||||
return (
|
||||
$module->key == 'system'
|
||||
and
|
||||
in_array( $controller, array( 'login', 'register', 'lostpass', 'terms', 'ajax', 'privacy', 'editor', 'language', 'theme' ) )
|
||||
in_array( $controller, array( 'login', 'register', 'lostpass', 'terms', 'ajax', 'privacy', 'editor', 'language', 'theme', 'redirect', 'guidelines' ) )
|
||||
)
|
||||
or
|
||||
(
|
||||
@@ -111,7 +145,9 @@ class _Application extends \IPS\Application
|
||||
) )
|
||||
or
|
||||
(
|
||||
$controller === 'ajax' and $do === 'states' // Makes sure address input still works within the ACP otherwise the form to turn site back online is broken
|
||||
$controller === 'ajax' and
|
||||
( $do === 'states' OR // Makes sure address input still works within the ACP otherwise the form to turn site back online is broken
|
||||
$do === 'passwordStrength' ) // Makes sure the password strength meter still works because it is used in the AdminCP and registration
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -224,7 +260,7 @@ class _Application extends \IPS\Application
|
||||
/* redirect old messenger link */
|
||||
if( isset( \IPS\Request::i()->module ) AND \IPS\Request::i()->module == 'global' AND isset( \IPS\Request::i()->controller ) AND (\IPS\Request::i()->controller == 'register' ) )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=system&controller=register', 'front', 'register', NULL, \IPS\Settings::i()->logins_over_https ) );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=system&controller=register', 'front', 'register' ) );
|
||||
}
|
||||
|
||||
/* redirect old reports */
|
||||
@@ -235,4 +271,25 @@ class _Application extends \IPS\Application
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=modcp&controller=modcp&tab=reports&action=view&id=' . \IPS\Request::i()->rid , 'front', 'modcp_report' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Imports an IN_DEV email template into the database
|
||||
*
|
||||
* @param string $path Path to file
|
||||
* @param object $file DirectoryIterator File Object
|
||||
* @param string|null $namePrefix Name prefix
|
||||
* @return array
|
||||
*/
|
||||
protected function _buildEmailTemplateFromInDev( $path, $file, $namePrefix='' )
|
||||
{
|
||||
$return = parent::_buildEmailTemplateFromInDev( $path, $file, $namePrefix );
|
||||
|
||||
/* Make sure that the email wrapper is pinned to the top of the list */
|
||||
if( $file->getFilename() == 'emailWrapper.phtml' )
|
||||
{
|
||||
$return['template_pinned'] = 1;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user