Version 3.2.3

This commit is contained in:
Neo committed 2025-12-19 00:34:03 -08:00
1 parent ae5c01cc78
commit 78706903a2
2641 files changed
+228363 -201264

No files matched your search

File diff suppressed because it is too large. Load diff
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Ouput format: HTML
* (Matt Mecham)
* Last Updated: $Date: 2010-10-28 12:07:41 -0400 (Thu, 28 Oct 2010) $
* Last Updated: $Date: 2011-10-06 23:44:10 -0400 (Thu, 06 Oct 2011) $
* </pre>
*
* @author $Author: mmecham $
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 9th March 2005 11:03
* @version $Revision: 7063 $
* @version $Revision: 9587 $
*
*/
@@ -25,7 +25,7 @@ interface interface_output
* Prints any header information for this output module
*
* @access public
* @return void Prints header() information
* @return @e void Prints header() information
*/
public function printHeader();
@@ -156,7 +156,7 @@ class coreOutput
*
* @access public
* @param object Registry object
* @return void
* @return @e void
*/
public function __construct( output $output )
{
@@ -174,7 +174,7 @@ class coreOutput
$this->skin = $output->skin;
/* Check for forceDownload */
if ( isset( $_GET['forceDownload'] ) AND $_GET['forceDownload'] AND ( $_GET['_k'] == $this->member->form_hash ) )
if ( !empty( $_GET['forceDownload'] ) AND ( $_GET['_k'] == $this->member->form_hash ) )
{
$this->_forceDownload = true;
}
@@ -253,7 +253,7 @@ class coreOutput
* @param string URL bit (showtopic=x)
* @param string SEO Title (my-test-topic)
* @param string SEO Template (showtopic)
* @return void
* @return @e void
*/
public function addCanonicalTag( $urlBit, $seoTitle, $seoTemplate )
{
@@ -263,7 +263,7 @@ class coreOutput
$url = $this->registry->getClass('output')->buildSEOUrl( $urlBit, 'publicNoSession', $seoTitle, $seoTemplate );
/* Strip off /index$ */
if ( substr( $url, -6 ) == '/index' )
if ( substr( $url, -6 ) == '/index' AND IPS_DEFAULT_PUBLIC_APP == 'forums' )
{
$url = substr_replace( $url, '', -5 );
}
@@ -273,7 +273,7 @@ class coreOutput
if ( $url )
{
$this->registry->getClass('output')->addToDocumentHead( 'raw' , '<link rel="canonical" href="' . $url . '" />' );
$this->registry->getClass('output')->addToDocumentHead( 'raw' , '<link id="ipsCanonical" rel="canonical" href="' . $url . '" />' );
}
}
}
@@ -298,8 +298,9 @@ class coreOutput
* @param string tag content
* @param boolean Encode content
* @param int Length to trim to (default 500)
* @return void
* @return @e void
* @link http://community.invisionpower.com/tracker/issue-22826-case-sensitivity-in-meta-tags/
* @link http://community.invisionpower.com/tracker/issue-32572-bbcode-included-in-meta-description
*/
public function addMetaTag( $tag, $content, $encode='', $trimLen=500 )
{
@@ -312,15 +313,24 @@ class coreOutput
case 'description':
/* Clear out 'Quote' if it's present in the bbcode parsed content */
$content = preg_replace( '/\<p class=\'citation\'\>.+?\<\/p\>/ims', '', $content );
$content = strip_tags( IPSText::stripAttachTag( $content ) );
# Hebrew chars screw up Facebook sharer
if ( $this->member->iAmFacebook )
{
$content = $this->encodeMetaTagContent( $content );
}
# There is no max value, but we trim so we don't bloat the output.
# It's not just search engines that use this, also link sharing services
# pick up the meta description.
$content = IPSText::truncate( strip_tags($content), $trimLen );
$content = IPSText::truncate( $content, $trimLen );
break;
case 'keywords':
if ( $encode === TRUE )
{
$content = IPSText::stripAttachTag( $content );
//Bug #15323 breaks accented characters, etc
//$content = strtolower( preg_replace( "/[^0-9a-zA-Z ]/", "", preg_replace( "/&([^;]+?);/", "", $content ) ) );
$content = str_replace( array( '.', ',', '!', ':', ';', "'", "'", '@', '%', '*', '(', ')' ), '', preg_replace( "/&([^;]+?);/", "", $content ) );
@@ -353,7 +363,25 @@ class coreOutput
break;
}
$this->_metaTags[ $tag ] = ( $encode === TRUE ) ? preg_replace( '/&amp;#(\d+?);/', "&#\\1;", htmlspecialchars( $content ) ) : $content;
$this->_metaTags[ $tag ] = ( $encode === TRUE ) ? $this->encodeMetaTagContent( preg_replace( '/&amp;#(\d+?);/', "&#\\1;", htmlspecialchars( $content ) ) ) : $content;
}
/**
* Encodes meta tag content so its safe for readers, etc
* @param string $content
* @return string
*/
public function encodeMetaTagContent( $content )
{
$content = IPSText::htmlspecialchars( $content );
# Hebrew chars screw up Facebook sharer
if ( IPS_DOC_CHAR_SET == 'UTF-8' && IPSText::isUTF8( $content ) )
{
$content = IPSText::utf8ToEntities( $content );
}
return $content;
}
/**
@@ -443,13 +471,17 @@ class coreOutput
continue;
}
$show = TRUE;
if ( $tab['app'] == 'core' OR $tab['app'] == 'forums' OR $tab['app'] == 'members' )
/* Sort if we can view that tab */
$show = FALSE;
if ( !in_array( $tab['app'], array( 'core', 'forums', 'members' ) ) AND ( !count($tab['groups']) OR IPSMember::hasOtherGroups( $this->memberData, $tab['groups'] ) ) )
{
$show = FALSE;
$show = TRUE;
}
/* Mark tab as active? */
$active = FALSE;
if ( ipsRegistry::$current_application == $tab['app'] )
{
if ( $tab['module'] )
@@ -465,7 +497,9 @@ class coreOutput
}
}
/* Sort out link */
$link = "app={$tab['app']}";
if ( $tab['module'] )
{
$link = "app={$tab['app']}&amp;module={$tab['module']}";
@@ -479,6 +513,7 @@ class coreOutput
'app_link' => $link );
}
return $tabs;
}
@@ -502,7 +537,7 @@ class coreOutput
* @access public
* @param string inline or import
* @param string Data to add
* @return void
* @return @e void
*/
public function addCSS( $type, $data )
{
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Ouput format: HTML
* (Matt Mecham)
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* Last Updated: $Date: 2010-12-17 08:01:38 -0500 (Fri, 17 Dec 2010) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 9th March 2005 11:03
* @version $Revision: 5713 $
* @version $Revision: 7445 $
*
*/
$config = array();
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Ouput format: HTML
* (Matt Mecham)
* Last Updated: $Date: 2010-10-13 09:23:30 -0400 (Wed, 13 Oct 2010) $
* Last Updated: $Date: 2011-10-05 15:30:51 -0400 (Wed, 05 Oct 2011) $
* </pre>
*
* @author $Author: mmecham $
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 9th March 2005 11:03
* @version $Revision: 6966 $
* @version $Revision: 9582 $
*
*/
@@ -45,12 +45,19 @@ class htmlOutput extends coreOutput implements interface_output
*/
protected $_css = array( 'import' => array(), 'inline' => array() );
/**
* Use a minimal wrapper instead of globalTemplate
*
* @var bool
*/
protected $useMinimalWrapper = false;
/**
* Constructor
*
* @access public
* @param object Output object
* @return void
* @return @e void
*/
public function __construct( output $output )
{
@@ -58,7 +65,7 @@ class htmlOutput extends coreOutput implements interface_output
parent::__construct( $output );
/* Print only seems only relevant to html method, so... */
if ( isset( $_GET['forcePrint'] ) AND $_GET['forcePrint'] AND ( $_GET['_k'] == $this->member->form_hash ) )
if ( !empty( $_GET['forcePrint'] ) AND ( $_GET['_k'] == $this->member->form_hash ) )
{
$this->_printOnly = true;
}
@@ -68,7 +75,7 @@ class htmlOutput extends coreOutput implements interface_output
* Prints any header information for this output module
*
* @access public
* @return void Prints header() information
* @return @e void Prints header() information
*/
public function printHeader()
{
@@ -98,17 +105,17 @@ class htmlOutput extends coreOutput implements interface_output
print $buffer;
}
if ( $this->settings['print_headers'] )
{
if ( isset( $_SERVER['SERVER_PROTOCOL'] ) AND strstr( $_SERVER['SERVER_PROTOCOL'], '/1.0' ) )
{
header("HTTP/1.0 " . $this->_headerCode . ' ' . $this->_headerStatus );
}
else
{
header("HTTP/1.1 " . $this->_headerCode . ' ' . $this->_headerStatus );
}
if ( isset( $_SERVER['SERVER_PROTOCOL'] ) AND strstr( $_SERVER['SERVER_PROTOCOL'], '/1.0' ) )
{
header("HTTP/1.0 " . $this->_headerCode . ' ' . $this->_headerStatus );
}
else
{
header("HTTP/1.1 " . $this->_headerCode . ' ' . $this->_headerStatus );
}
if ( $this->settings['print_headers'] )
{
/* Forcing a download? */
if ( $this->_forceDownload )
{
@@ -229,6 +236,8 @@ class htmlOutput extends coreOutput implements interface_output
*/
public function displayBoardOffline( $message )
{
$this->useMinimalWrapper = true;
return $this->registry->getClass('output')->getTemplate('global_other')->displayBoardOffline( $message );
}
@@ -250,8 +259,9 @@ class htmlOutput extends coreOutput implements interface_output
// INIT
//-----------------------------------------
$system_vars_cache = $this->caches['systemvars'];
$pmData = FALSE;
$system_vars_cache = $this->caches['systemvars'];
$pmData = FALSE;
$notificationLatest = array();
//-----------------------------------------
// NORMAL
@@ -263,13 +273,11 @@ class htmlOutput extends coreOutput implements interface_output
// Do we have a notification show?
//-----------------------------------------
$notifications = null;
if ( ! empty( $this->memberData['msg_show_notification'] ) AND $this->memberData['_cache']['show_notification_popup'] )
{
if ( !$this->settings['board_offline'] OR $this->memberData['g_access_offline'] )
{
if ( ! $this->settings['board_offline'] OR $this->memberData['g_access_offline'] )
{
if( strpos( ipsRegistry::$settings['query_string_real'], 'area=notificationlog' ) === false )
if ( strpos( ipsRegistry::$settings['query_string_real'], 'module=messaging' ) === false )
{
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'msg_show_notification' => 0 ) ) );
@@ -278,11 +286,12 @@ class htmlOutput extends coreOutput implements interface_output
$notifyLibrary = new $classToLoad( $this->registry );
$notifyLibrary->setMember( $this->memberData );
$_data = $notifyLibrary->fetchUnreadNotifications( 1, 'notify_sent', 'DESC', true, true );
if ( count( $_data ) )
$tmp = $notifyLibrary->getLatestNotificationForInlinePopUp();
$weNeed = array( 'notify_title', 'member_member_id', 'member_PhotoTag', 'member_members_display_name', 'date_parsed', 'title', 'url', 'type', 'content' );
foreach( $weNeed as $k )
{
$notifications = array_shift( $_data );
$notificationLatest[ $k ] = IPSText::utf8ToEntities( $tmp[ $k ] );
}
}
}
@@ -307,35 +316,66 @@ class htmlOutput extends coreOutput implements interface_output
$task = '';
$system_vars_cache['task_next_run'] = isset( $system_vars_cache['task_next_run'] ) ? $system_vars_cache['task_next_run'] : 0;
if ( time() >= $system_vars_cache['task_next_run'] OR ( defined('FORCE_TASK_KEY') ) )
{
$_url = ( ! $this->registry->getClass('output')->isHTTPS ) ? $this->settings['base_url'] : $this->settings['base_url_https'];
$task = "<div><img src='" . $_url . "app=core&amp;module=task' alt='' style='border: 0px;height:1px;width:1px;' /></div>";
}
//-----------------------------------------
// Grab output
//-----------------------------------------
/* Inline msg */
$inlineMsg = $this->member->sessionClass()->getInlineMessage();
$finalOutput = $this->output->getTemplate('global')->globalTemplate( $output, $documentHeadItems, $this->_css, $jsLoaderItems, $this->_metaTags,
array( 'title' => $title,
'applications' => $this->core_fetchApplicationData(),
'page' => $this->_current_page_title ),
array( 'navigation' => $navigation,
'notifications' => $notifications,
'adHeaderCode' => ! empty( $extraData['adHeaderCode'] ) ? $extraData['adHeaderCode'] : '',
'adFooterCode' => ! empty( $extraData['adFooterCode'] ) ? $extraData['adFooterCode'] : '' ),
array( 'time' => $this->registry->getClass('class_localization')->getDate( time(), 'SHORT', 1 ),
'lang_chooser' => $this->html_buildLanguageDropDown(),
'skin_chooser' => $this->html_fetchSetsDropDown(),
'copyright' => $this->html_fetchCopyright() ),
array( 'ex_time' => ( isset($this->request['faster']) AND $this->request['faster'] == 'yes' ) ? $this->_getFasterText() : sprintf( "%.4f", IPSDebug::endTimer() ),
'gzip_status' => ( $this->settings['disable_gzip'] == 1 ) ? $this->lang->words['gzip_off'] : $this->lang->words['gzip_on'],
'server_load' => ipsRegistry::$server_load,
'queries' => $this->DB->getQueryCount(),
'task' => $task )
);
if ( $this->useMinimalWrapper )
{
$finalOutput = $this->output->getTemplate('global_other')->globalTemplateMinimal( $output, $documentHeadItems, $this->_css, $jsLoaderItems, $this->_metaTags,
array( 'title' => $title,
'applications' => $this->core_fetchApplicationData(),
'page' => $this->_current_page_title,
'notifications' => ( $notificationLatest ) ? json_encode( $notificationLatest ) : '',
'inlineMsg' => $inlineMsg ),
array( 'navigation' => $navigation,
'adHeaderCode' => ! empty( $extraData['adHeaderCode'] ) ? $extraData['adHeaderCode'] : '',
'adFooterCode' => ! empty( $extraData['adFooterCode'] ) ? $extraData['adFooterCode'] : '' ),
array( 'time' => $this->registry->getClass('class_localization')->getDate( time(), 'SHORT', 1 ),
'mark_read_apps' => IPSLib::getEnabledApplications('itemMarking'),
'lang_chooser' => $this->html_buildLanguageDropDown(),
'skin_chooser' => $this->html_fetchSetsDropDown(),
'copyright' => $this->html_fetchCopyright() ),
array( 'ex_time' => ( isset($this->request['faster']) AND $this->request['faster'] == 'yes' ) ? $this->_getFasterText() : sprintf( "%.4f", IPSDebug::endTimer() ),
'gzip_status' => ( $this->settings['disable_gzip'] == 1 ) ? $this->lang->words['gzip_off'] : $this->lang->words['gzip_on'],
'server_load' => ipsRegistry::$server_load,
'queries' => $this->DB->getQueryCount(),
'task' => $task )
);
}
else
{
$finalOutput = $this->output->getTemplate('global')->globalTemplate( $output, $documentHeadItems, $this->_css, $jsLoaderItems, $this->_metaTags,
array( 'title' => $title,
'applications' => $this->core_fetchApplicationData(),
'page' => $this->_current_page_title,
'notifications' => ( $notificationLatest ) ? json_encode( $notificationLatest ) : '',
'inlineMsg' => $inlineMsg ),
array( 'navigation' => $navigation,
'adHeaderCode' => ! empty( $extraData['adHeaderCode'] ) ? $extraData['adHeaderCode'] : '',
'adFooterCode' => ! empty( $extraData['adFooterCode'] ) ? $extraData['adFooterCode'] : '' ),
array( 'time' => $this->registry->getClass('class_localization')->getDate( time(), 'SHORT', 1 ),
'mark_read_apps' => IPSLib::getEnabledApplications('itemMarking'),
'lang_chooser' => $this->html_buildLanguageDropDown(),
'skin_chooser' => $this->html_fetchSetsDropDown(),
'copyright' => $this->html_fetchCopyright() ),
array( 'ex_time' => ( isset($this->request['faster']) AND $this->request['faster'] == 'yes' ) ? $this->_getFasterText() : sprintf( "%.4f", IPSDebug::endTimer() ),
'gzip_status' => ( $this->settings['disable_gzip'] == 1 ) ? $this->lang->words['gzip_off'] : $this->lang->words['gzip_on'],
'server_load' => ipsRegistry::$server_load,
'queries' => $this->DB->getQueryCount(),
'task' => $task )
);
}
}
//-----------------------------------------
@@ -377,8 +417,8 @@ class htmlOutput extends coreOutput implements interface_output
//-----------------------------------------
// Return
//-----------------------------------------
//print IPSLib::sizeFormat( IPSLib::strlenToBytes( strlen( $finalOutput ) ) );
return $this->parseIPSTags( $finalOutput );
return $finalOutput;
}
/**
@@ -389,57 +429,13 @@ class htmlOutput extends coreOutput implements interface_output
*/
public function finishUp()
{
//-----------------------------------------
// Memory usage
//-----------------------------------------
if ( IPS_MEMORY_DEBUG_MODE AND defined( 'IPS_MEMORY_START' ) AND $this->memberData['g_access_cp'] )
{
if ( is_array( IPSDebug::$memory_debug ) )
{
$memory .= "<br />\n<div class='tableborder'>\n<div class='subtitle'>MEMORY USAGE</div><div class='row1' style='padding:6px'>\n";
$memory .= "<table cellpadding='4' cellspacing='0' border='0' width='100%'>\n";
$_c = 0;
foreach( IPSDebug::$memory_debug as $usage )
{
$_col = ( $_c % 2 ) ? '#eee' : '#ddd';
$_c++;
if ( $usage[1] > 500 * 1024 )
{
$_col .= ";color:#D00000";
}
else if ( $usage[1] < 10 * 1024 )
{
$_col .= ";color:darkgreen";
}
else if ( $usage[1] < 100 * 1024 )
{
$_col .= ";color:darkorange";
}
$memory .= "<tr><td width='60%' style='background-color:{$_col}' align='left'>{$usage[0]}</td><td style='background-color:{$_col}' align='left'><strong>".IPSLib::sizeFormat( $usage[1] )."</strong></td></tr>";
}
$memory .= "</table></div></div>";
}
$end = memory_get_usage();
$peak_end = function_exists('memory_get_peak_usage') ? memory_get_peak_usage() : memory_get_usage();
$_used = $end - IPS_MEMORY_START;
$peak_used = $peak_end - IPS_MEMORY_START;
print $memory;
print "Total Memory Used: " . IPSLib::sizeFormat( $_used ) . " (Peak:" . IPSLib::sizeFormat( $peak_used ).")";
}
}
/**
* Adds more items into the document header like CSS / RSS, etc
*
* @access public
* @return void
* @return @e void
*/
public function addHeadItems()
{
@@ -460,9 +456,13 @@ class htmlOutput extends coreOutput implements interface_output
}
else
{
$this->registry->getClass('output')->skin['_css'][ $data['css_group'] ]['attributes'] = 'media="screen"';
$this->registry->getClass('output')->skin['_css'][ $data['css_group'] ]['attributes'] = 'media="screen,print"';
}
}
else if ( $data['css_group'] == 'ipb_print' )
{
continue;
}
$this->registry->getClass('output')->skin['_css'][ $data['css_group'] ]['content'] = str_replace( 'http://', 'https://', $this->registry->getClass('output')->skin['_css'][ $data['css_group'] ]['content'] );
}
@@ -485,9 +485,13 @@ class htmlOutput extends coreOutput implements interface_output
}
else
{
$this->registry->getClass('output')->skin['_css'][ $name ]['attributes'] = 'media="screen"';
$this->registry->getClass('output')->skin['_css'][ $name ]['attributes'] = 'media="screen,print"';
}
}
else if ( $data['css_group'] == 'ipb_print' )
{
continue;
}
/* Did we skip it? */
if ( ! isset( $this->registry->getClass('output')->skin['_css'][ $name ] ) )
@@ -501,13 +505,11 @@ class htmlOutput extends coreOutput implements interface_output
continue;
}
if ( $this->registry->getClass('output')->skin['set_css_inline'] AND @file_exists( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/'. $this->registry->getClass('output')->skin['_csscacheid'] .'/'. $name . '.css' ) )
if ( ! SAFE_MODE_ON && $this->registry->getClass('output')->skin['set_css_inline'] AND @is_file( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/'. $this->registry->getClass('output')->skin['_csscacheid'] .'/'. $name . '.css' ) )
{
$_cssFile = $this->settings['public_dir'] . 'style_css/' . $this->registry->getClass('output')->skin['_csscacheid'] .'/'. $name . '.css';
$this->_css['import'][$_cssFile] = array(
'attributes' => $this->registry->getClass('output')->skin['_css'][ $name ]['attributes'],
'content' => $_cssFile
);
$_cssFile = $this->settings['css_base_url'] . 'style_css/' . $this->registry->getClass('output')->skin['_csscacheid'] .'/'. $name . '.css';
$this->_css['import'][$_cssFile] = array( 'attributes' => $this->registry->getClass('output')->skin['_css'][ $name ]['attributes'],
'content' => $_cssFile );
}
else
{
@@ -520,39 +522,18 @@ class htmlOutput extends coreOutput implements interface_output
// RSS
//-----------------------------------------
$cacheUsed = false;
$rssOutputCache = $this->cache->getCache('rss_output_cache');
if( is_array( $rssOutputCache ) AND count( $rssOutputCache ) )
{
$expires = array_shift( $rssOutputCache );
foreach( $rssOutputCache as $rssEntry )
{
$data = explode( ':|:', $rssEntry );
if( time() < $expires )
{
foreach( $rssOutputCache as $rssEntry )
if( $data[1] )
{
$data = explode( ':|:', $rssEntry );
$this->output->addToDocumentHead( 'rss', array( 'title' => $data[0], 'url' => $data[1] ) );
}
$cacheUsed = true;
}
else
{
$this->cache->rebuildCache( 'rss_output_cache' );
$rssOutputCache = $this->cache->getCache('rss_output_cache');
if( is_array( $rssOutputCache ) AND count( $rssOutputCache ) )
{
foreach( $rssOutputCache as $rssEntry )
{
$data = explode( ':|:', $rssEntry );
$this->output->addToDocumentHead( 'rss', array( 'title' => $data[0], 'url' => $data[1] ) );
}
}
}
}
@@ -587,7 +568,10 @@ class htmlOutput extends coreOutput implements interface_output
# Ensure &amp;s are taken care of
$url = str_replace( "&amp;", "&", $url );
# Dirty hack @todo look at real reason for this - happens when URL is already SEO and passed via buildSEOUrl above
$url = str_replace( "?//", "?/", $url );
# 301?
if ( $send301 === TRUE )
{
@@ -630,7 +614,6 @@ class htmlOutput extends coreOutput implements interface_output
* @access public
* @param string
* @return string
* @todo [Future] Remove the legacy remapping in 3.1. We will assume posts have been rebuilt by then.
*/
public function parseIPSTags( $text )
{
@@ -644,19 +627,13 @@ class htmlOutput extends coreOutput implements interface_output
$text = str_replace( "{style_image_url}" , $this->settings['img_url'] , $text );
$text = str_replace( "{style_images_url}" , $this->settings['img_url'] , $text );
//-----------------------------------------
// Fix legacy emoticon/avatar/images links
//-----------------------------------------
$text = preg_replace( "#img\s+?src=([\"'])(?:{$this->settings['board_url']}[^\"']+?)?(?<!public%2F)style_(images|avatars|emoticons)([^\"']+?)[\"'](.+?)?".">#is", "img src=\\1".$this->settings['public_dir']."style_\\2\\3\\1\\4>", $text );
//-----------------------------------------
// Fix up IPB image url
//-----------------------------------------
if ( $this->settings['ipb_img_url'] )
{
$text = preg_replace( '#img\s+?src=["\']public/style_(images|avatars|emoticons)(.+?)["\'](.+?)?' . '>#is', "img src=\"".$this->settings['ipb_img_url']."public/style_\\1\\2\"\\3>", $text );
$text = preg_replace( '#img\s+?src=["\']' . PUBLIC_DIRECTORY . '/style_(images|avatars|emoticons)(.+?)["\'](.+?)?' . '>#is', "img src=\"".$this->settings['ipb_img_url'] . PUBLIC_DIRECTORY . "/style_\\1\\2\"\\3>", $text );
}
//-----------------------------------------
@@ -674,10 +651,10 @@ class htmlOutput extends coreOutput implements interface_output
/**
* Fetch copyright notice
*
* @access private
* @access protected
* @return string Copyright HTML
*/
private function html_fetchCopyright()
protected function html_fetchCopyright()
{
//-----------------------------------------
// REMOVAL OF THIS WITHOUT PURCHASING COPYRIGHT REMOVAL WILL VIOLATE THE LICENCE YOU AGREED
@@ -692,11 +669,11 @@ class htmlOutput extends coreOutput implements interface_output
/**
* @link http://community.invisionpower.com/tracker/issue-23750-licensed-to-wont-work-if-copyright-removal-purchased/
*/
if ( $this->settings['ipb_reg_show'] and $this->settings['ipb_reg_name'] )
if ( $this->settings['ipb_reg_name'] )
{
$copyright = "<!-- Copyright Information -->
<p id='copyright'>" .
$this->lang->words['licensed_to'] . $this->settings['ipb_reg_name'] .
$this->lang->words['licensed_to'] . ' ' . $this->settings['ipb_reg_name'] .
"</p>\n\t\t<!-- / Copyright -->";
}
else
@@ -708,13 +685,11 @@ class htmlOutput extends coreOutput implements interface_output
{
$copyright = "<!-- Copyright Information -->
<p id='copyright'>
Система для сообществ IP.Board{$version}
<div style='display: none;'><a href='http://prowebber.ru' title='PROWEBBER.RU - всё для вебмастера!'>PROWEBBER.RU - всё для вебмастера!</a></div>
";
<a href='http://hatynka.in/' title='Nulled by Hatynka.in'>Система для сообществ IP.Board{$version}</a>";
if ( $this->settings['ipb_reg_show'] and $this->settings['ipb_reg_name'] )
if ( $this->settings['ipb_reg_name'] )
{
$copyright .= "<br />" . $this->lang->words['licensed_to'] . $this->settings['ipb_reg_name'];
$copyright .= "<br />" . $this->lang->words['licensed_to'] . ' ' . $this->settings['ipb_reg_name'];
}
@@ -727,7 +702,7 @@ class htmlOutput extends coreOutput implements interface_output
/**
* Returns debug data
*
* @access private
* @access protected
* @return string Debug HTML
*/
public function html_showDebugInfo()
@@ -915,14 +890,57 @@ class htmlOutput extends coreOutput implements interface_output
$stats .= "</div>\n</div>";
}
//-----------------------------------------
// Memory usage
//-----------------------------------------
if ( IPS_MEMORY_DEBUG_MODE AND defined( 'IPS_MEMORY_START' ) AND $this->memberData['g_access_cp'] )
{
if ( is_array( IPSDebug::$memory_debug ) )
{
$memory .= "<br />\n<div class='tableborder'>\n<div class='subtitle'>MEMORY USAGE</div><div class='row1' style='padding:6px'>\n";
$memory .= "<table cellpadding='4' cellspacing='0' border='0' width='100%'>\n";
$_c = 0;
foreach( IPSDebug::$memory_debug as $usage )
{
$_col = ( $_c % 2 ) ? '#eee' : '#ddd';
$_c++;
if ( $usage[1] > 500 * 1024 )
{
$_col .= ";color:#D00000";
}
else if ( $usage[1] < 10 * 1024 )
{
$_col .= ";color:darkgreen";
}
else if ( $usage[1] < 100 * 1024 )
{
$_col .= ";color:darkorange";
}
$memory .= "<tr><td width='60%' style='background-color:{$_col}' align='left'>{$usage[0]}</td><td style='background-color:{$_col}' align='left'><strong>".IPSLib::sizeFormat( $usage[1] )."</strong></td></tr>";
}
$memory .= "</table></div></div>";
}
$end = memory_get_usage();
$peak_end = function_exists('memory_get_peak_usage') ? memory_get_peak_usage() : memory_get_usage();
$_used = $end - IPS_MEMORY_START;
$peak_used = $peak_end - IPS_MEMORY_START;
$stats .= $memory;
$stats .= "Total Memory Used: " . IPSLib::sizeFormat( $_used ) . " (Peak:" . IPSLib::sizeFormat( $peak_used ).")";
}
if ( $stats )
{
$stats = "
<div align='center' id='debug_wrapper'>
<div class='row2' style='padding:8px;vertical-align:middle'><a href='#' onclick=\"$('debug').toggle(); return false;\">Скрыть</a></div>
<br />
<div align='center' style='width:92%; margin:120px auto 20px auto; overflow:auto;'>
<div class='tableborder' align='left' id='debug'>
<div class='maintitle'>Отладочная информация</div>
<div class='maintitle'>Debug Information (<a href='#' onclick=\"$('debug').toggle(); return false;\">Hide Debug Information</a>)</div>
<div style='padding:5px;background:#8394B2;'>{$stats}</div>
</div>
</div>";
@@ -934,12 +952,12 @@ class htmlOutput extends coreOutput implements interface_output
/**
* Fetch language drop down box
*
* @access private
* @return string Drop down list.
* @access protected
* @return array
*/
private function html_buildLanguageDropDown()
protected function html_buildLanguageDropDown()
{
$lang_list = "";
$lang_list = array();
$cache = $this->caches['lang_data'];
//-----------------------------------------
@@ -952,14 +970,18 @@ class htmlOutput extends coreOutput implements interface_output
{
if ( $this->member->language_id == $data['lang_id'] )
{
$selected = ' selected="selected"';
$lang_list['options'][] = array( 'id' => $data['lang_id'], 'title' => $data['lang_title'], 'selected' => true );
$lang_list['default'] = $data['lang_title'];
}
else if( !$this->member->language_id AND $data['lang_default'] )
{
$lang_list['options'][] = array( 'id' => $data['lang_id'], 'title' => $data['lang_title'], 'selected' => true );
$lang_list['default'] = $data['lang_title'];
}
else
{
$selected = "";
$lang_list['options'][] = array( 'id' => $data['lang_id'], 'title' => $data['lang_title'], 'selected' => false );
}
$lang_list .= "\n<option value='{$data['lang_id']}'{$selected}>{$data['lang_title']}</option>";
}
}
@@ -971,18 +993,18 @@ class htmlOutput extends coreOutput implements interface_output
*
* Does what is says up there a bit
*
* @access private
* @access protected
* @param int Parent id
* @param int Iteration
* @return string Drop down list. All nicely formatted.
* @return array
*/
private function html_fetchSetsDropDown( $parent=0, $iteration=0 )
protected function html_fetchSetsDropDown( $parent=0, $iteration=0 )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$output = "";
$output = array();
$depthMarkers = "";
if( $iteration )
@@ -1021,14 +1043,14 @@ class htmlOutput extends coreOutput implements interface_output
continue;
}
$_selected = ( $this->skin['set_id'] == $data['set_id'] ) ? 'selected="selected"' : '';
$_selected = ( $this->skin['set_id'] == $data['set_id'] ) ? true : false;
/* Ok to add... */
$output .= "\n<option id='skinSetDD_" . $data['set_id'] . "' " . $_selected . " value=\"". $data['set_id'] . "\">". $depthMarkers . $data['set_name'] . "</option>";
$output[] = array( 'id' => $data['set_id'], 'depth' => $depthMarkers, 'title' => $data['set_name'], 'selected' => $_selected );
if ( is_array( $data['_childTree'] ) AND count( $data['_childTree'] ) )
{
$output .= $this->html_fetchSetsDropDown( $data['set_id'], $iteration + 1 );
$output = array_merge( $output, $this->html_fetchSetsDropDown( $data['set_id'], $iteration + 1 ) );
}
}
@@ -1038,10 +1060,10 @@ class htmlOutput extends coreOutput implements interface_output
/**
* Get faster text
*
* @access private
* @access protected
* @return string
*/
private function _getFasterText()
protected function _getFasterText()
{
$texts = array(
'Zooom',
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -1,28 +0,0 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Ouput format: XML
* (Matt Mecham)
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @link http://www.invisionpower.com
* @since 9th March 2005 11:03
* @version $Revision: 5713 $
*
*/
$config = array();
/* Identifies publicly as... */
$config['identifies_as'] = 'XML';
/* Gateway file? */
$config['gateway_file'] = 'xml.php';
@@ -1,10 +0,0 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,357 +0,0 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Ouput format: HTML
* (Matt Mecham)
* Last Updated: $Date: 2010-09-15 17:14:23 -0400 (Wed, 15 Sep 2010) $
* </pre>
*
* @author $Author: terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @link http://www.invisionpower.com
* @since 9th March 2005 11:03
* @version $Revision: 6881 $
*
*/
class xmlOutput extends coreOutput implements interface_output
{
/**
* Main output class
*
* @access protected
* @var object
*/
protected $output;
/**
* CSS array
*
* @access protected
* @var array
*/
protected $_css = array( 'import' => array(), 'inline' => array() );
/**
* Constructor
*
* @access public
* @param object Output object
* @return void
*/
public function __construct( output $output )
{
/* Make object */
parent::__construct( $output );
}
/**
* Prints any header information for this output module
*
* @access public
* @return null Prints header() information
*/
public function printHeader()
{
//-----------------------------------------
// Start GZIP compression
//-----------------------------------------
if ( $this->settings['disable_gzip'] != 1 )
{
$buffer = "";
if ( count( ob_list_handlers() ) )
{
$buffer = ob_get_contents();
ob_end_clean();
}
@ob_start('ob_gzhandler');
print $buffer;
}
if ( isset( $_SERVER['SERVER_PROTOCOL'] ) AND strstr( $_SERVER['SERVER_PROTOCOL'], '/1.0' ) )
{
header("HTTP/1.0 200 OK" );
}
else
{
header("HTTP/1.1 200 OK" );
}
header( "Content-type: text/xml;charset=" . IPS_DOC_CHAR_SET );
if ( $this->settings['nocache'] )
{
header("Cache-Control: no-cache, must-revalidate, max-age=0");
header("Expires: 0");
header("Pragma: no-cache");
}
}
/**
* Display error
*
* @access public
* @param string Error message
* @param integer Error code
* @return mixed You can print a custom message here, or return formatted data to be sent do registry->output->sendOutput
*/
public function displayError( $message, $code=0 )
{
}
/**
* Display board offline
*
* @access public
* @param string Message
* @return mixed You can print a custom message here, or return formatted data to be sent do registry->output->sendOutput
*/
public function displayBoardOffline( $message )
{
}
/**
* Fetches the output
*
* @access public
* @param string Output gathered
* @param string Title of the document
* @param array Navigation gathered
* @param array Array of document head items
* @param array Array of JS loader items
* @param array Array of extra data
* @return string Output to be printed to the client
*/
public function fetchOutput( $output, $title, $navigation, $documentHeadItems, $jsLoaderItems, $extraData=array() )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$system_vars_cache = $this->caches['systemvars'];
$showPMBox = '';
//-----------------------------------------
// NORMAL
//-----------------------------------------
if ( $this->_outputType == 'normal' )
{
//-----------------------------------------
// Grab output
//-----------------------------------------
$finalOutput = $this->output->getTemplate('global')->globalTemplate( $output, $documentHeadItems, $this->_css, $jsLoaderItems,
array( 'title' => $title,
'applications' => $this->core_fetchApplicationData(),
'page' => $this->_current_page_title ),
array( 'navigation' => $navigation ),
array( 'time' => $this->registry->getClass( 'class_localization')->getDate( time(), 'SHORT', 1 ),
'lang_chooser' => $this->html_buildLanguageDropDown(),
'skin_chooser' => $this->html_fetchSetsDropDown(),
'stats' => $this->html_showDebugInfo(),
'copyright' => $this->html_fetchCopyright() ),
array( 'ex_time' => sprintf( "%.4f", IPSDebug::endTimer() ),
'gzip_status' => ( $this->settings['disable_gzip'] == 1 ) ? $this->lang->words['gzip_off'] : $this->lang->words['gzip_on'],
'server_load' => ipsRegistry::$server_load,
'queries' => $this->DB->getQueryCount() )
);
}
//-----------------------------------------
// Grab output
// REDIRECT
//-----------------------------------------
else if ( $this->_outputType == 'redirect' )
{
# SEO?
if ( $extraData['seoTitle'] )
{
$extraData['url'] = $this->output->buildSEOUrl( $extraData['url'], 'none', $extraData['seoTitle'] );
$extraData['full'] = 1;
}
$finalOutput = $this->output->getTemplate('global')->redirectTemplate( $documentHeadItems, $this->_css, $jsLoaderItems, $extraData['text'], $extraData['url'], $extraData['full'] );
}
//-----------------------------------------
// POP UP
//-----------------------------------------
else if ( $this->_outputType == 'popup' )
{
$finalOutput = $this->output->getTemplate('global')->displayPopUpWindow( $documentHeadItems, $this->_css, $jsLoaderItems, $title, $output );
}
//-----------------------------------------
// Return
//-----------------------------------------
return $this->parseIPSTags( $finalOutput );
}
/**
* Finish / clean up after sending output
*
* @access public
* @return null
*/
public function finishUp()
{
}
/**
* Adds more items into the document header like CSS / RSS, etc
*
* @access public
* @return null
*/
public function addHeadItems()
{
}
/**
* Silent redirect (Redirects without a screen or other notification)
*
* @access public
* @param string URL
* @param string [SEO Title]
* @return mixed
*/
public function silentRedirect( $url, $seoTitle='' )
{
# Ensure &amp;s are taken care of
$url = str_replace( "&amp;", "&", $url );
# SEO?
if ( $seoTitle )
{
$url = $this->registry->getClass('output')->buildSEOUrl( $url, 'none', $seoTitle );
}
if ( $this->settings['header_redirect'] == 'refresh' )
{
@header("Refresh: 0;url=".$url);
}
else if ( $this->settings['header_redirect'] == 'html' )
{
$url = str_replace( '&', '&amp;', str_replace( '&amp;', '&', $url ) );
echo("<html><head><meta http-equiv='refresh' content='0; url=$url'></head><body></body></html>");
exit();
}
else
{
@header( "Location: ".$url );
}
exit();
}
/**
* Replace IPS tags
* Converts over <#IMG_DIR#>, etc
*
* @access public
* @param string Unparsed text
* @return string Parsed text
*/
public function parseIPSTags( $text )
{
$text = str_replace( "<#IMG_DIR#>" , $this->skin['set_image_dir'], $text );
$text = str_replace( "<#EMO_DIR#>" , $this->skin['set_emo_dir'] , $text );
$text = str_replace( "<% CHARSET %>" , IPS_DOC_CHAR_SET , $text );
$text = str_replace( "{style_image_url}", $this->settings['img_url'] , $text );
if ( $this->settings['ipb_img_url'] )
{
$text = preg_replace( "#img\s+?src=[\"']style_(images|avatars|emoticons)(.+?)[\"'](.+?)?".">#is", "img src=\"".$this->settings['ipb_img_url']."style_\\1\\2\"\\3>", $text );
}
return $text;
}
/**
* Fetch copyright notice
*
* @access private
* @return string
*/
private function html_fetchCopyright()
{
//-----------------------------------------
// REMOVAL OF THIS WITHOUT PURCHASING COPYRIGHT REMOVAL WILL VIOLATE THE LICENCE YOU AGREED
// TO WHEN DOWNLOADING THIS PRODUCT. THIS COULD MEAN REMOVAL OF YOUR BOARD AND EVEN
// CRIMINAL CHARGES
//-----------------------------------------
$version = ( $this->settings['ipb_display_version'] AND $this->settings['ipb_display_version'] != 0 ) ? ipsRegistry::$version : '';
if ($this->settings['ipb_copy_number'] && $this->settings['ips_cp_purchase'])
{
$copyright = "";
}
else
{
$copyright = "<!-- Copyright Information -->
<p id='copyright'>
Форум IP.Board
{$version} &copy; ".date("Y")." &nbsp;IPS, <abbr title='Incorporated'>Inc</abbr>.
<div style='display: none;'><a href='http://prowebber.ru' title='PROWEBBER.RU - всё для вебмастера!'>PROWEBBER.RU - всё для вебмастера!</a></div>
";
if ( $this->settings['ipb_reg_show'] and $this->settings['ipb_reg_name'] )
{
$copyright .= "<div>Зарегистрирован на: ". $this->settings['ipb_reg_name']."</div>";
}
$copyright .= "</p>\n\t\t<!-- / Copyright -->";
}
return $copyright;
}
/**
* Returns debug data
*
* @access private
* @return string
*/
public function html_showDebugInfo()
{
}
/**
* Fetch language drop down box
*
* @access private
* @return string
*/
private function html_buildLanguageDropDown()
{
}
/**
* Fetch skin list
*
* Does what is says up there a bit
*
* @access private
* @return HTML Drop down list. All nicely formatted.
*/
private function html_fetchSetsDropDown()
{
}
}
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
File diff suppressed because it is too large. Load diff