Version 3.4.5

This commit is contained in:
Neo committed 2025-12-19 00:38:12 -08:00
1 parent fb6b5baabc
commit e4478369d8
1360 files changed
+228921 -179445

No files matched your search

+16 -59
View File
@@ -2,10 +2,10 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Share links library.
* Created by Matt Mecham
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2013-05-08 13:48:52 -0400 (Wed, 08 May 2013) $
* </pre>
*
* @author $Author: bfarber $
@@ -13,7 +13,7 @@
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 12239 $
*
*/
@@ -96,6 +96,13 @@ class share_links
return false;
}
/* Permission Check */
$cache = isset( $this->caches['sharelinks'] ) ? $this->caches['sharelinks'] : ipsRegistry::cache()->getCache('sharelinks');
if ( $cache[ $this->_pluginKey ]['share_groups'] != '*' and !IPSMember::isInGroup( $this->memberData, explode( ',', $cache[ $this->_pluginKey ]['share_groups'] ) ) )
{
return false;
}
/* Ensure title is correctly de-html-ized */
$title = IPSText::UNhtmlspecialchars( $title );
@@ -267,56 +274,6 @@ class share_links
'log_data_primary_id' => intval($urlParts['data_primary_id']),
'log_data_secondary_id' => intval($urlParts['data_secondary_id']) ) );
/* Rebuild caches */
$this->rebuildCaches();
}
/**
* Build some caches of stuff.
*
* @access public
*
*/
public function rebuildCaches()
{
/* INIT */
$caches = array( 'mostitems' => array(), 'mostrecent' => array() );
/* Delete caches */
$this->DB->delete( 'core_share_links_caches', "cache_key IN ('mostitems', 'mostrecent')" );
/* Most shared */
$this->DB->build( array( 'select' => 'COUNT(*) as count, log_data_app, log_data_type, log_data_primary_id',
'from' => 'core_share_links_log',
'group' => 'log_data_app, log_data_type, log_data_primary_id',
'order' => 'count DESC',
'limit' => array( 0, 10 ) ) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$caches['mostitems'][] = $row;
}
/* Most recent shares */
$this->DB->build( array( 'select' => 'log_id, log_data_app, log_data_type, log_data_primary_id',
'from' => 'core_share_links_log',
'order' => 'log_date DESC',
'limit' => array( 0, 10 ) ) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$caches['mostrecent'][] = $row;
}
/* Save 'em */
foreach( $caches as $key => $data )
{
$this->DB->insert( 'core_share_links_caches', array( 'cache_key' => $key, 'cache_date' => time(), 'cache_data' => serialize( $data ) ) );
}
}
/**
@@ -382,13 +339,11 @@ class share_links
$_urlBits = array();
$_toTest = $url;
$templates = array();
/* Grab FURL data... */
if ( ! IN_DEV AND is_file( DOC_IPS_ROOT_PATH . 'cache/furlCache.php' ) )
if ( is_file( FURL_CACHE_PATH ) )
{
$templates = array();
include( DOC_IPS_ROOT_PATH . 'cache/furlCache.php' );/*noLibHook*/
require( FURL_CACHE_PATH );/*noLibHook*/
$_seoTemplates = $templates;
}
else
@@ -400,7 +355,9 @@ class share_links
{
IPSLib::cacheFurlTemplates();
}
catch( Exception $e ) {}
catch( Exception $e )
{
}
}
if ( is_array( $_seoTemplates ) AND count( $_seoTemplates ) )