Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

@@ -2,9 +2,9 @@
/**
* @brief SEO
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @package IPS Community Suite
* @since 07 Jun 2013
* @version SVN_VERSION_NUMBER
*/
@@ -62,23 +62,24 @@ class _seo extends \IPS\Dispatcher\Controller
/* Build tab list */
$tabs = array();
$tabs['urls'] = 'seo_tab_furls';
if ( !\IPS\CIC )
{
$tabs['urls'] = 'seo_tab_furls';
}
$tabs['sitemap'] = 'seo_tab_sitemap';
$tabs['metatags'] = 'seo_tab_metatags';
/* Display */
if ( $activeTabContents )
{
\IPS\Output::i()->sidebar['actions']['ga'] = array(
'title' => 'configure_google_analytics',
'icon' => 'cogs',
'link' => \IPS\Http\Url::internal( "app=core&module=applications&controller=enhancements&do=edit&id=core_GoogleAnalytics" ),
);
{
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('menu__core_promotion_seo');
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->tabs( $tabs, $this->activeTab, $activeTabContents, \IPS\Http\Url::internal( "app=core&module=promotion&controller=seo" ) );
}
\IPS\Output::i()->sidebar['actions']['seo_visitors'] = array(
'title' => 'Посетители с поисковых систем',
'icon' => 'bar-chart-o',
'link' => \IPS\Http\Url::internal( "app=core&module=promotion&controller=seovisitors" ),
);
}
/**
@@ -102,7 +103,8 @@ class _seo extends \IPS\Dispatcher\Controller
{
try
{
$response = \IPS\Http\Url::external( \IPS\Settings::i()->base_url . 'login' )->request( 5, '1.1', FALSE )->get();
$furlDefinition = \IPS\Http\Url::furlDefinition();
$response = \IPS\Http\Url::external( \IPS\Settings::i()->base_url . $furlDefinition['login']['friendly'] )->request( NULL, NULL, FALSE )->get();
if ( !in_array( mb_substr( $response->httpResponseCode, 0, 1 ), array( '2', '3' ) ) and ( \IPS\Settings::i()->site_online OR $response->httpResponseCode != 503 ) )
{
\IPS\Member::loggedIn()->language()->words['htaccess_mod_rewrite_warning'] = \IPS\Member::loggedIn()->language()->get( $isApache ? 'htaccess_mod_rewrite_err' : 'htaccess_mod_rewrite_err_na' );
@@ -122,6 +124,9 @@ class _seo extends \IPS\Dispatcher\Controller
$form->saveAsSettings();
\IPS\Member::clearCreateMenu();
/* Clear front navigation data store, otherwise it could still contain the non-rewrite furl for some items */
unset( \IPS\Data\Store::i()->frontNavigation );
/* Clear guest page caches */
\IPS\Data\Cache::i()->clearAll();
@@ -187,6 +192,11 @@ class _seo extends \IPS\Dispatcher\Controller
try
{
if( !( $values['sitemap_url'] instanceof \IPS\Http\Url ) )
{
throw new \RuntimeException;
}
$response = $values['sitemap_url']->setQueryString( 'testsettings', 1 )->request()->get();
if ( $response->httpResponseCode != 200 or !mb_strpos( $values['sitemap_url'], "sitemap.php" ) )
@@ -195,7 +205,7 @@ class _seo extends \IPS\Dispatcher\Controller
}
}
catch ( \IPS\Http\Request\Exception $e )
catch ( \RuntimeException $e )
{
$form->error = \IPS\Member::loggedIn()->language()->addToStack( 'form_url_bad' );
}
@@ -232,6 +242,9 @@ class _seo extends \IPS\Dispatcher\Controller
/* Are we deleting? */
if ( isset( \IPS\Request::i()->delete ) )
{
/* Make sure the user confirmed the deletion */
\IPS\Request::i()->confirmedDelete();
if( isset( \IPS\Request::i()->root ) )
{
$meta = \IPS\Db::i()->select( '*', 'core_seo_meta', array( 'meta_id=?', (int) \IPS\Request::i()->root ) )->first();
@@ -241,7 +254,7 @@ class _seo extends \IPS\Dispatcher\Controller
}
else
{
\IPS\DB::i()->delete( 'core_seo_meta', array( "meta_id=?", (int) \IPS\Request::i()->delete ) );
\IPS\Db::i()->delete( 'core_seo_meta', array( "meta_id=?", (int) \IPS\Request::i()->delete ) );
}
unset( \IPS\Data\Store::i()->metaTags );
@@ -440,12 +453,12 @@ class _seo extends \IPS\Dispatcher\Controller
$tags[ $data['name'] ] = $data['content'];
}
\IPS\DB::i()->delete( 'core_seo_meta', array( 'meta_url=?', $url ) );
\IPS\DB::i()->delete( 'core_seo_meta', array( 'meta_url=?', \IPS\Request::i()->original_url ) );
\IPS\Db::i()->delete( 'core_seo_meta', array( 'meta_url=?', $url ) );
\IPS\Db::i()->delete( 'core_seo_meta', array( 'meta_url=?', \IPS\Request::i()->original_url ) );
if( $title or count( $tags ) )
{
\IPS\DB::i()->insert( 'core_seo_meta', array( 'meta_url' => $url, 'meta_title' => $title, 'meta_tags' => json_encode( $tags ) ) );
\IPS\Db::i()->insert( 'core_seo_meta', array( 'meta_url' => $url, 'meta_title' => $title, 'meta_tags' => json_encode( $tags ) ) );
}
\IPS\Session::i()->log( 'acplogs__seo_metatag_settings' );
@@ -484,7 +497,7 @@ Options -MultiViews
RewriteEngine On
RewriteBase {$dir}
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \\.(js|css|jpeg|jpg|gif|png|ico)(\\?|$) {$dir}404error.php [L,NC]
RewriteRule \\.(js|css|jpeg|jpg|gif|png|ico|map)(\\?|$) {$dir}404error.php [L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d