Version 3.4.5
This commit is contained in:
1 parent
fb6b5baabc
commit
e4478369d8
1360 files changed
+228921
-179445
No files matched your search
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* IP.Board v3.4.5
|
||||
* Skin Caching Functions
|
||||
* Last Updated: $Date: 2012-06-22 07:55:48 -0400 (Fri, 22 Jun 2012) $
|
||||
* Last Updated: $Date: 2013-05-20 16:38:23 -0400 (Mon, 20 May 2013) $
|
||||
* </pre>
|
||||
*
|
||||
* Owner: Matt
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 9th July 2008
|
||||
* @version $Revision: 10969 $
|
||||
* @version $Revision: 12261 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -573,7 +573,7 @@ EOF;
|
||||
continue;
|
||||
}
|
||||
|
||||
$_path = DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/css_' . $_setID;
|
||||
$_path = IPS_PUBLIC_PATH . 'style_css/css_' . $_setID;
|
||||
|
||||
if ( is_dir( $_path ) )
|
||||
{
|
||||
@@ -748,7 +748,7 @@ EOF;
|
||||
* @return boolean
|
||||
*/
|
||||
public function rebuildCSSCache( $setID, $forceRebuild=FALSE )
|
||||
{
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
@@ -878,7 +878,7 @@ EOF;
|
||||
|
||||
/* Recache skin sets */
|
||||
$this->rebuildSkinSetsCache();
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -943,9 +943,9 @@ EOF;
|
||||
|
||||
$replacements = array();
|
||||
include( $dir . '/_replacements.inc' );/*noLibHook*/
|
||||
|
||||
|
||||
if ( !is_array($replacements) || !count($replacements) )
|
||||
{
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -968,7 +968,7 @@ EOF;
|
||||
foreach( $replacements as $k => $v )
|
||||
{
|
||||
$messages[] = $this->lang->words['basicimportedpre'] . $k;
|
||||
|
||||
|
||||
$this->DB->insert( 'skin_replacements', array( 'replacement_key' => $k,
|
||||
'replacement_content' => $v,
|
||||
'replacement_master_key' => $set_key,
|
||||
@@ -995,7 +995,7 @@ EOF;
|
||||
{
|
||||
/* Set directory */
|
||||
$setId = is_numeric( $setId ) ? intval( $setId ) : trim( $setId );
|
||||
$cssDir = DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/' . $this->remapData['css'][ $setId ];
|
||||
$cssDir = IPS_PUBLIC_PATH . 'style_css/' . $this->remapData['css'][ $setId ];
|
||||
$messages = array();
|
||||
$css = array();
|
||||
|
||||
@@ -1450,8 +1450,7 @@ EOF;
|
||||
* @return boolean
|
||||
*/
|
||||
public function __rebuildSkinSetsCache()
|
||||
{
|
||||
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
@@ -1478,6 +1477,18 @@ EOF;
|
||||
|
||||
$this->cache->setCache( 'skinsets', $cache, array( 'array' => 1, 'donow' => 1 ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set that it's done
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->update( 'skin_collections', array( 'set_updated' => time() ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Flush IPS CDN
|
||||
//-----------------------------------------
|
||||
|
||||
$this->flushipscdn();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1538,7 +1549,7 @@ EOF;
|
||||
{
|
||||
/* Set directory */
|
||||
$css = array();
|
||||
$cssDir = DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/' . $dir;
|
||||
$cssDir = IPS_PUBLIC_PATH . 'style_css/' . $dir;
|
||||
$messages = array();
|
||||
|
||||
if ( ! is_dir( $cssDir ) )
|
||||
@@ -1622,7 +1633,7 @@ EOF;
|
||||
|
||||
$setData = $this->fetchSkinData( $id );
|
||||
|
||||
$path = DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/' . $dir;
|
||||
$path = IPS_PUBLIC_PATH . 'style_css/' . $dir;
|
||||
$msgs = array();
|
||||
|
||||
if ( ! isset( $setData['set_id'] ) )
|
||||
@@ -1956,34 +1967,34 @@ EOF;
|
||||
{
|
||||
$good_to_go = 1;
|
||||
|
||||
if ( is_writeable( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/' ) === TRUE )
|
||||
if ( is_writeable( IPS_PUBLIC_PATH . 'style_css/' ) === TRUE )
|
||||
{
|
||||
$good_to_go = 1;
|
||||
|
||||
if ( ! is_dir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/css_' . $setID ) )
|
||||
if ( ! is_dir( IPS_PUBLIC_PATH . 'style_css/css_' . $setID ) )
|
||||
{
|
||||
if ( ! @ mkdir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/css_' . $setID, IPS_FOLDER_PERMISSION ) )
|
||||
if ( ! @ mkdir( IPS_PUBLIC_PATH . 'style_css/css_' . $setID, IPS_FOLDER_PERMISSION ) )
|
||||
{
|
||||
$this->_addErrorMessage( sprintf( $this->lang->words['couldnotcreatecssdir'], $setID ) );
|
||||
return $this->_errorMsgs;
|
||||
}
|
||||
else
|
||||
{
|
||||
@file_put_contents( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/css_' . $setID . '/index.html', '' );
|
||||
@chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/css_'.$setID, IPS_FOLDER_PERMISSION );
|
||||
@file_put_contents( IPS_PUBLIC_PATH . 'style_css/css_' . $setID . '/index.html', '' );
|
||||
@chmod( IPS_PUBLIC_PATH . 'style_css/css_'.$setID, IPS_FOLDER_PERMISSION );
|
||||
$good_to_go = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( is_writable( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/css_' . $setID ) !== TRUE )
|
||||
if ( is_writable( IPS_PUBLIC_PATH . 'style_css/css_' . $setID ) !== TRUE )
|
||||
{
|
||||
$this->_addErrorMessage( sprintf( $this->lang->words['cssdirnotwritaaaable'], $setID ) );
|
||||
$good_to_go = 0;
|
||||
}
|
||||
else if ( is_file( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/css_'.$setID.'/'.$css_group.'.css' ) )
|
||||
else if ( is_file( IPS_PUBLIC_PATH . 'style_css/css_'.$setID.'/'.$css_group.'.css' ) )
|
||||
{
|
||||
if ( is_writable( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/css_'.$setID.'/'.$css_group.'.css' ) !== TRUE )
|
||||
if ( is_writable( IPS_PUBLIC_PATH . 'style_css/css_'.$setID.'/'.$css_group.'.css' ) !== TRUE )
|
||||
{
|
||||
$this->_addErrorMessage( sprintf( $this->lang->words['cssfilenotwriteable'], $setID, $css_group ) );
|
||||
$good_to_go = 0;
|
||||
@@ -2017,11 +2028,11 @@ EOF;
|
||||
|
||||
if ( $good_to_go )
|
||||
{
|
||||
if ( $FH = @fopen( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/css_'.$setID.'/'.$css_group.'.css', 'w' ) )
|
||||
if ( $FH = @fopen( IPS_PUBLIC_PATH . 'style_css/css_'.$setID.'/'.$css_group.'.css', 'w' ) )
|
||||
{
|
||||
fwrite( $FH, $css_content, strlen($css_content) );
|
||||
fclose( $FH );
|
||||
@chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/css_'.$setID.'/'.$css_group.'.css', IPS_FILE_PERMISSION );
|
||||
@chmod( IPS_PUBLIC_PATH . 'style_css/css_'.$setID.'/'.$css_group.'.css', IPS_FILE_PERMISSION );
|
||||
|
||||
$this->_addMessage( $this->lang->words['basicwrittenpre']. "skin_cache/css_{$setID}/{$css_group}.css" );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user