Version 2.2.0 RC-1
This commit is contained in:
1 parent
f73f8bff6d
commit
22f1b963ee
1034 files changed
+178610
-70897
No files matched your search
@@ -2,24 +2,14 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.1.7
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Tuesday 18th of July 2006 05:56:00 PM
|
||||
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-10-10 14:03:20 +0100 (Mon, 10 Oct 2005) $
|
||||
| > $Revision: 22 $
|
||||
@@ -89,6 +79,11 @@ class class_template
|
||||
*/
|
||||
var $foreach_blocks = array();
|
||||
|
||||
/**
|
||||
* Allow PHP code to execute
|
||||
*/
|
||||
var $allow_php_code = 1;
|
||||
|
||||
|
||||
function class_template()
|
||||
{
|
||||
@@ -109,6 +104,12 @@ class class_template
|
||||
*/
|
||||
function convert_cache_to_eval($data='', $full_class_name='')
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$final_content = '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Remove PHP tags
|
||||
//-----------------------------------------
|
||||
@@ -219,19 +220,30 @@ class class_template
|
||||
|
||||
if ( $compile )
|
||||
{
|
||||
$_func_code = '"' . $this->compile_html_to_php( $func_html, $func_data ) . '"';
|
||||
$_func_code = '"' . $this->compile_html_to_php( trim( $func_html ), $func_data ) . '"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$_func_code = "<<<EOF\n" . $this->unconvert_tags( $func_html ) . "\nEOF";
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Make safe.. clear up any potential escapes
|
||||
//-----------------------------------------
|
||||
|
||||
$_func_code = preg_replace( "#\\\{1,}\"#s", '\\"', $_func_code );
|
||||
|
||||
//-----------------------------------------
|
||||
// Continue...
|
||||
//-----------------------------------------
|
||||
|
||||
$top = "//===========================================================================\n".
|
||||
"// <ips:{$func_name}:desc:{$func_desc}:trigger:{$com_bit_update_trigger}>\n".
|
||||
"//===========================================================================\n";
|
||||
|
||||
$start = "function {$func_name}($func_data) {\n\$IPBHTML = \"\";\n//--starthtml--//\n";
|
||||
$middle = '$IPBHTML .= '.$_func_code.';';
|
||||
|
||||
$end = "\n//--endhtml--//\nreturn \$IPBHTML;\n}\n";
|
||||
|
||||
//-------------------------------
|
||||
@@ -250,13 +262,31 @@ class class_template
|
||||
{
|
||||
$end = preg_replace( "#<xxforeach_([^>]+?)xx>(.+?)</xxforeach_\\1xx>#si", "\".\\2.\"", $end );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Remove raw PHP tags
|
||||
//-----------------------------------------
|
||||
|
||||
$end = preg_replace( "#<php>(.+?)</php>#si", "", $end );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Sort out the rest of the PHP tags
|
||||
//-----------------------------------------
|
||||
|
||||
$php_tags = $this->_process_raw_php_tags( $_func_code );
|
||||
|
||||
//-----------------------------------------
|
||||
// Remove raw PHP tags
|
||||
//-----------------------------------------
|
||||
|
||||
$middle = preg_replace( "#<php>(.+?)</php>#si", "", $middle );
|
||||
|
||||
//-------------------------------
|
||||
// Return
|
||||
//-------------------------------
|
||||
|
||||
return $top.$start.$middle.$end;
|
||||
return $top.$start.$php_tags.$middle.$end;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -341,7 +371,7 @@ class class_template
|
||||
{
|
||||
$text = str_replace('\\\\$', '\\$', $text);
|
||||
}
|
||||
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
@@ -596,6 +626,8 @@ class class_template
|
||||
$function_name = '__foreach_loop__'. uniqid( 'id_' );
|
||||
$php_statement = '<xxforeach_'.$function_name.'xx>$this->'.$function_name.'('.$clean_func_data.')</xxforeach_'.$function_name.'xx>';
|
||||
$php_block = $this->_process_raw_html_logic( addslashes($block) );
|
||||
$php_tags = $this->_process_raw_php_tags( $block );
|
||||
|
||||
|
||||
$this->foreach_blocks[] = <<<EOF
|
||||
//===========================================================================
|
||||
@@ -605,8 +637,10 @@ class class_template
|
||||
function {$function_name}($normal_func_data)
|
||||
{
|
||||
\$_ips___x_retval = '';
|
||||
|
||||
foreach( $statement )
|
||||
{
|
||||
{$php_tags}
|
||||
\$_ips___x_retval .= "{$php_block}";
|
||||
}
|
||||
|
||||
@@ -621,6 +655,52 @@ EOF;
|
||||
return str_replace("\\'", "'", $template);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Convert HTML PHP tags
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function _process_raw_php_tags( $text )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$php = "";
|
||||
|
||||
//-----------------------------------------
|
||||
// Allow PHP code in templates?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->allow_php_code )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// EXTRACT!
|
||||
//-----------------------------------------
|
||||
|
||||
preg_match_all( "#<php>(.+?)</php>#si", $text, $match );
|
||||
|
||||
for ( $i = 0; $i < count($match[0]); $i++ )
|
||||
{
|
||||
$php_code = trim( $match[1][$i] );
|
||||
$complete_tag = $match[0][$i];
|
||||
|
||||
$str_find = array('\\"', '\\\\');
|
||||
$str_replace = array('"' , '\\' );
|
||||
|
||||
$str_find[] = "\\'";
|
||||
$str_replace[] = "'";
|
||||
|
||||
$php_code = str_replace($str_find, $str_replace, $php_code);
|
||||
|
||||
$php .= "\n".$php_code."\n";
|
||||
}
|
||||
|
||||
return $php;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Convert HTML logic to cached PHP (work function)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -653,6 +733,12 @@ EOF;
|
||||
|
||||
while ( 1 == 1 )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Update template length
|
||||
//-----------------------------------------
|
||||
|
||||
$total_length = strlen( $template );
|
||||
|
||||
$_end = 0;
|
||||
|
||||
//----------------------------------------
|
||||
@@ -936,9 +1022,9 @@ EOF;
|
||||
$t = preg_replace( "/\{ips\.vars\[(['\"])?(sql_driver|sql_host|sql_database|sql_pass|sql_user|sql_port|sql_tbl_prefix|smtp_host|smtp_port|smtp_user|smtp_pass|html_dir|base_dir|upload_dir)(['\"])?\]\}/", "" , $t );
|
||||
|
||||
# IPB 2.1+ Kernel
|
||||
$t = preg_replace( "/{ips\.script_url}/i" , '{$this->ipsclass->base_url}' , $t);
|
||||
$t = preg_replace( "/{ips\.session_id}/i" , '{$this->ipsclass->session_id}', $t);
|
||||
$t = preg_replace( "#ips\.(member|vars|skin|lang|input)#i", '$this->ipsclass->\\1' , $t );
|
||||
$t = preg_replace( "/{ip(s|b|d)\.script_url}/i" , '{$this->ipsclass->base_url}' , $t);
|
||||
$t = preg_replace( "/{ip(s|b|d)\.session_id}/i" , '{$this->ipsclass->session_id}', $t);
|
||||
$t = preg_replace( "#ip(?:s|b|d)\.(member|vars|skin|lang|input)#i", '$this->ipsclass->\\1' , $t );
|
||||
|
||||
return $t;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user