Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -1,19 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Ouput format: HTML
|
||||
* (Matt Mecham)
|
||||
* Last Updated: $Date: 2009-12-04 03:16:10 -0500 (Fri, 04 Dec 2009) $
|
||||
* Last Updated: $Date: 2010-10-13 09:23:30 -0400 (Wed, 13 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @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: 5518 $
|
||||
* @version $Revision: 6966 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -27,6 +29,14 @@ class htmlOutput extends coreOutput implements interface_output
|
||||
*/
|
||||
protected $output;
|
||||
|
||||
/**
|
||||
* Print only flag
|
||||
*
|
||||
* @access protected
|
||||
* @var bool
|
||||
*/
|
||||
protected $_printOnly = false;
|
||||
|
||||
/**
|
||||
* CSS array
|
||||
*
|
||||
@@ -46,6 +56,12 @@ class htmlOutput extends coreOutput implements interface_output
|
||||
{
|
||||
/* Make object */
|
||||
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 ) )
|
||||
{
|
||||
$this->_printOnly = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,20 +109,29 @@ class htmlOutput extends coreOutput implements interface_output
|
||||
header("HTTP/1.1 " . $this->_headerCode . ' ' . $this->_headerStatus );
|
||||
}
|
||||
|
||||
header( "Content-type: text/html;charset=" . IPS_DOC_CHAR_SET );
|
||||
/* Forcing a download? */
|
||||
if ( $this->_forceDownload )
|
||||
{
|
||||
header( "Content-type: unknown/unknown" );
|
||||
header( "Content-Disposition: attachment; filename=\"" . IPSText::alphanumericalClean( IPSText::transliterate( mb_strtolower( $this->registry->output->getTitle() ) ) ) . ".html\"" );
|
||||
}
|
||||
else
|
||||
{
|
||||
header( "Content-type: text/html;charset=" . IPS_DOC_CHAR_SET );
|
||||
}
|
||||
|
||||
if ( $this->settings['nocache'] )
|
||||
{
|
||||
$expires = ( $this->_headerExpire ) ? gmdate("D, d M Y H:i:s", time() + $this->_headerExpire ) . " GMT" : 0;
|
||||
$maxAge = $this->_headerExpire;
|
||||
$nocache = ( ! $this->_headerExpire ) ? ',no-cache' : '';
|
||||
$expires = ( $this->_headerExpire ) ? gmdate( "D, d M Y H:i:s", time() + $this->_headerExpire ) . " GMT" : gmdate( "D, d M Y H:i:s", time() - 86400 ) . " GMT";
|
||||
$maxAge = $this->_headerExpire;
|
||||
$nocache = ( ! $this->_headerExpire ) ? 'no-cache,' : '';
|
||||
|
||||
header("Cache-Control: ". $nocache . "must-revalidate, max-age=" . $maxAge);
|
||||
header("Expires: " . $expires);
|
||||
header( "Cache-Control: ". $nocache . "must-revalidate, max-age=" . $maxAge );
|
||||
header( "Expires: " . $expires );
|
||||
|
||||
if ( ! $this->_headerExpire )
|
||||
{
|
||||
header("Pragma: no-cache");
|
||||
header( "Pragma: no-cache" );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -235,27 +260,29 @@ class htmlOutput extends coreOutput implements interface_output
|
||||
if ( $this->_outputType == 'normal' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Do we have a PM show?
|
||||
// Do we have a notification show?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ( $this->memberData['msg_count_reset'] OR $this->memberData['msg_show_notification'] ) AND ! $this->memberData['members_disable_pm'] )
|
||||
$notifications = null;
|
||||
|
||||
if ( ! empty( $this->memberData['msg_show_notification'] ) AND $this->memberData['_cache']['show_notification_popup'] )
|
||||
{
|
||||
if ( ( $this->request['module'] != 'messaging' ) AND ( ! $this->settings['board_offline'] OR $this->memberData['g_access_offline']) )
|
||||
if ( !$this->settings['board_offline'] OR $this->memberData['g_access_offline'] )
|
||||
{
|
||||
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'msg_show_notification' => 0 ) ) );
|
||||
|
||||
/* Grab PM Data. We init if we need to recount... */
|
||||
require_once( IPSLib::getAppDir( "members" ) . '/sources/classes/messaging/messengerFunctions.php' );
|
||||
$messengerFunctions = new messengerFunctions( $this->registry );
|
||||
|
||||
/* Only collect data if we have notifications to show */
|
||||
if ( $this->memberData['msg_show_notification'] )
|
||||
if( strpos( ipsRegistry::$settings['query_string_real'], 'area=notificationlog' ) === false )
|
||||
{
|
||||
$_data = $messengerFunctions->fetchUnreadNotifications( $this->memberData['member_id'] );
|
||||
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'msg_show_notification' => 0 ) ) );
|
||||
|
||||
/* Grab inline notifications... */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
|
||||
$notifyLibrary = new $classToLoad( $this->registry );
|
||||
$notifyLibrary->setMember( $this->memberData );
|
||||
|
||||
$_data = $notifyLibrary->fetchUnreadNotifications( 1, 'notify_sent', 'DESC', true, true );
|
||||
|
||||
if ( count( $_data ) )
|
||||
{
|
||||
$pmData = array_shift( $_data );
|
||||
$notifications = array_shift( $_data );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -266,6 +293,7 @@ class htmlOutput extends coreOutput implements interface_output
|
||||
//-----------------------------------------
|
||||
|
||||
$http = 'http://';
|
||||
|
||||
if ( strpos( $this->settings['board_url'], 'https://' ) === 0 )
|
||||
{
|
||||
$http = 'https://';
|
||||
@@ -291,20 +319,22 @@ class htmlOutput extends coreOutput implements interface_output
|
||||
//-----------------------------------------
|
||||
|
||||
$finalOutput = $this->output->getTemplate('global')->globalTemplate( $output, $documentHeadItems, $this->_css, $jsLoaderItems, $this->_metaTags,
|
||||
array( 'title' => $title,
|
||||
'applications' => $this->core_fetchApplicationData(),
|
||||
array( 'title' => $title,
|
||||
'applications' => $this->core_fetchApplicationData(),
|
||||
'page' => $this->_current_page_title ),
|
||||
array( 'navigation' => $navigation,
|
||||
'pmData' => $pmData ),
|
||||
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' => 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 )
|
||||
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 )
|
||||
);
|
||||
}
|
||||
|
||||
@@ -335,6 +365,15 @@ class htmlOutput extends coreOutput implements interface_output
|
||||
$finalOutput = $this->output->getTemplate('global_other')->displayPopUpWindow( $documentHeadItems, $this->_css, $jsLoaderItems, $title, $output );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set a class on the body for print
|
||||
//-----------------------------------------
|
||||
|
||||
if( $this->_printOnly )
|
||||
{
|
||||
$finalOutput = str_replace( "<body", "<body class='printpreview'", $finalOutput );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return
|
||||
//-----------------------------------------
|
||||
@@ -412,6 +451,19 @@ class htmlOutput extends coreOutput implements interface_output
|
||||
|
||||
foreach( $this->registry->getClass('output')->skin['_cssGroupsArray'] as $position => $data )
|
||||
{
|
||||
/* Print only */
|
||||
if ( $this->_printOnly === true )
|
||||
{
|
||||
if ( $data['css_group'] != 'ipb_print' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->getClass('output')->skin['_css'][ $data['css_group'] ]['attributes'] = 'media="screen"';
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->getClass('output')->skin['_css'][ $data['css_group'] ]['content'] = str_replace( 'http://', 'https://', $this->registry->getClass('output')->skin['_css'][ $data['css_group'] ]['content'] );
|
||||
}
|
||||
}
|
||||
@@ -424,19 +476,32 @@ class htmlOutput extends coreOutput implements interface_output
|
||||
{
|
||||
$name = $data['css_group'];
|
||||
|
||||
/* Print only */
|
||||
if ( $this->_printOnly === true )
|
||||
{
|
||||
if ( $name != 'ipb_print' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->getClass('output')->skin['_css'][ $name ]['attributes'] = 'media="screen"';
|
||||
}
|
||||
}
|
||||
|
||||
/* Did we skip it? */
|
||||
if ( ! isset( $this->registry->getClass('output')->skin['_css'][ $name ] ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Skip IE, print and lo-fi as it's hardcoded in the skin */
|
||||
/* Skip IE, print and lo-fi as it's hardcoded in the skin */
|
||||
if ( $name == 'ipb_ie' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( $this->registry->getClass('output')->skin['set_css_inline'] AND @file_exists( IPS_CACHE_PATH . PUBLIC_DIRECTORY . '/style_css/'. $this->registry->getClass('output')->skin['_csscacheid'] .'/'. $name . '.css' ) )
|
||||
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' ) )
|
||||
{
|
||||
$_cssFile = $this->settings['public_dir'] . 'style_css/' . $this->registry->getClass('output')->skin['_csscacheid'] .'/'. $name . '.css';
|
||||
$this->_css['import'][$_cssFile] = array(
|
||||
@@ -529,7 +594,7 @@ class htmlOutput extends coreOutput implements interface_output
|
||||
/* Strip session URL if there wasn't one */
|
||||
if ( ! IN_ACP AND $this->member->session_type != 'cookie' AND ! $this->request['s'] )
|
||||
{
|
||||
$url = preg_replace( "/\?s=([a-zA-Z0-9]{32})(&|&|$)/", '', $url );
|
||||
$url = preg_replace( '/\?s=([a-zA-Z0-9]{32})(&|&|$)/', '', $url );
|
||||
}
|
||||
|
||||
/* Log it */
|
||||
@@ -591,9 +656,17 @@ class htmlOutput extends coreOutput implements interface_output
|
||||
|
||||
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/style_(images|avatars|emoticons)(.+?)["\'](.+?)?' . '>#is', "img src=\"".$this->settings['ipb_img_url']."public/style_\\1\\2\"\\3>", $text );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Fix up dates
|
||||
//-----------------------------------------
|
||||
|
||||
if ( strstr( $text, '{timestamp:' ) )
|
||||
{
|
||||
$text = preg_replace_callback( '#<!--\{timestamp:(\d+?):([^\}]+?)\}-->#', create_function( '$key', 'return ipsRegistry::getClass(\'class_localization\')->getDate($key[1], \'$key[2]\', 1);' ), $text );
|
||||
}
|
||||
|
||||
|
||||
return $text;
|
||||
}
|
||||
@@ -612,22 +685,36 @@ class htmlOutput extends coreOutput implements interface_output
|
||||
// CRIMINAL CHARGES
|
||||
//-----------------------------------------
|
||||
|
||||
$version = ( $this->settings['ipb_display_version'] AND $this->settings['ipb_display_version'] != 0 ) ? IPB_VERSION : '';
|
||||
$version = ( $this->settings['ipb_display_version'] AND $this->settings['ipb_display_version'] != 0 ) ? ' ' . IPB_VERSION : '';
|
||||
|
||||
if ($this->settings['ipb_copy_number'] && $this->settings['ips_cp_purchase'])
|
||||
{
|
||||
$copyright = "";
|
||||
/**
|
||||
* @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'] )
|
||||
{
|
||||
$copyright = "<!-- Copyright Information -->
|
||||
<p id='copyright'>" .
|
||||
$this->lang->words['licensed_to'] . $this->settings['ipb_reg_name'] .
|
||||
"</p>\n\t\t<!-- / Copyright -->";
|
||||
}
|
||||
else
|
||||
{
|
||||
$copyright = "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$copyright = "<!-- Copyright Information -->
|
||||
<p id='copyright' class='right'>
|
||||
Форум IP.Board {$version} © ".date("Y")." IPS, In<abbr title='Incorporated'>c</abbr>.
|
||||
<p id='copyright'>
|
||||
Система для сообществ IP.Board{$version}
|
||||
<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 .= "<br />Зарегистрирован на: ". $this->settings['ipb_reg_name'];
|
||||
$copyright .= "<br />" . $this->lang->words['licensed_to'] . $this->settings['ipb_reg_name'];
|
||||
}
|
||||
|
||||
|
||||
@@ -769,7 +856,7 @@ class htmlOutput extends coreOutput implements interface_output
|
||||
|
||||
$cache['task_next_run'] = $cache['task_next_run'] ? $cache['task_next_run'] : 0;
|
||||
|
||||
$stats .= "<b>Следующая задача</b> = ".$this->registry->getClass( 'class_localization')->getDate( $cache['task_next_run'], 'LONG' )."\n<br /><b>Time now</b> = ".$this->registry->getClass( 'class_localization')->getDate( time(), 'LONG' );
|
||||
$stats .= "<b>Следующая задача</b> = ".$this->registry->getClass( 'class_localization')->getDate( $cache['task_next_run'], 'LONG' )."\n<br /><b>Время</b> = ".$this->registry->getClass( 'class_localization')->getDate( time(), 'LONG' );
|
||||
$stats .= "<br /><b>Сейчас</b> = ".time();
|
||||
|
||||
$stats .= "<p>Пользователь: last_visit: " . $this->memberData['last_visit'] . " / " . $this->registry->getClass( 'class_localization')->getDate( $this->memberData['last_visit'], 'LONG' ) . "</p>";
|
||||
@@ -831,7 +918,7 @@ class htmlOutput extends coreOutput implements interface_output
|
||||
if ( $stats )
|
||||
{
|
||||
$stats = "
|
||||
<div align='center'>
|
||||
<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 class='tableborder' align='left' id='debug'>
|
||||
@@ -947,4 +1034,33 @@ class htmlOutput extends coreOutput implements interface_output
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get faster text
|
||||
*
|
||||
* @access private
|
||||
* @return string
|
||||
*/
|
||||
private function _getFasterText()
|
||||
{
|
||||
$texts = array(
|
||||
'Zooom',
|
||||
'REALLY fast',
|
||||
'Quick',
|
||||
'Lightning',
|
||||
'Chop chop',
|
||||
'Expeditive',
|
||||
'Flash',
|
||||
'Lickety Split',
|
||||
'On the double',
|
||||
'Rapid',
|
||||
'Velocious',
|
||||
'Pronto',
|
||||
'Speedy Gonzales',
|
||||
'Warp Speed',
|
||||
'Double espresso',
|
||||
);
|
||||
|
||||
return $texts[ array_rand($texts) ];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user