|
From: Paul S. O. <ps...@us...> - 2002-01-28 17:20:36
|
Update of /cvsroot/phpbb/phpBB2/includes
In directory usw-pr-cvs1:/tmp/cvs-serv5423/includes
Modified Files:
template.php
Log Message:
Fix various var not set warnings ... many thanks go to The Horta for pointing out and offering fixes for many of these
Index: template.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/template.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** template.php 2001/08/31 20:59:12 1.5
--- template.php 2002/01/28 17:20:31 1.6
***************
*** 145,148 ****
--- 145,149 ----
// Compile it, with the "no echo statements" option on.
+ $_str = "";
$code = $this->compile($this->uncompiled_code[$handle], true, '_str');
***************
*** 304,308 ****
// This will handle the remaining root-level varrefs
! $code = preg_replace('#\{([a-z0-9\-_]*?)\}#is', '\' . $this->_tpldata[\'.\'][0][\'\1\'] . \'', $code);
// Break it up into lines.
--- 305,309 ----
// This will handle the remaining root-level varrefs
! $code = preg_replace('#\{([a-z0-9\-_]*?)\}#is', '\' . ( ( isset($this->_tpldata[\'.\'][0][\'\1\']) ) ? $this->_tpldata[\'.\'][0][\'\1\'] : \'\' ) . \'', $code);
// Break it up into lines.
***************
*** 324,328 ****
// Added: dougk_ff7-Keeps templates from bombing if begin is on the same line as end.. I think. :)
! if (preg_match('#<!-- END (.*?) -->#', $code_lines[$i], $n))
{
$block_nesting_level++;
--- 325,329 ----
// Added: dougk_ff7-Keeps templates from bombing if begin is on the same line as end.. I think. :)
! if ( preg_match('#<!-- END (.*?) -->#', $code_lines[$i], $n) )
{
$block_nesting_level++;
***************
*** 331,335 ****
{
// Block is not nested.
! $code_lines[$i] = '$_' . $a[1] . '_count = sizeof($this->_tpldata[\'' . $n[1] . '.\']);';
$code_lines[$i] .= "\n" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1] . '_count; $_' . $n[1] . '_i++)';
$code_lines[$i] .= "\n" . '{';
--- 332,336 ----
{
// Block is not nested.
! $code_lines[$i] = '$_' . $a[1] . '_count = ( isset($this->_tpldata[\'' . $n[1] . '.\']) ) ? sizeof($this->_tpldata[\'' . $n[1] . '.\']) : 0;';
$code_lines[$i] .= "\n" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1] . '_count; $_' . $n[1] . '_i++)';
$code_lines[$i] .= "\n" . '{';
***************
*** 347,351 ****
$varref = $this->generate_block_data_ref($namespace, false);
// Create the for loop code to iterate over this block.
! $code_lines[$i] = '$_' . $a[1] . '_count = sizeof(' . $varref . ');';
$code_lines[$i] .= "\n" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1] . '_count; $_' . $n[1] . '_i++)';
$code_lines[$i] .= "\n" . '{';
--- 348,352 ----
$varref = $this->generate_block_data_ref($namespace, false);
// Create the for loop code to iterate over this block.
! $code_lines[$i] = '$_' . $a[1] . '_count = ( isset(' . $varref . ') ) ? sizeof(' . $varref . ') : 0;';
$code_lines[$i] .= "\n" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1] . '_count; $_' . $n[1] . '_i++)';
$code_lines[$i] .= "\n" . '{';
***************
*** 367,371 ****
{
// Block is not nested.
! $code_lines[$i] = '$_' . $m[1] . '_count = sizeof($this->_tpldata[\'' . $m[1] . '.\']);';
$code_lines[$i] .= "\n" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1] . '_count; $_' . $m[1] . '_i++)';
$code_lines[$i] .= "\n" . '{';
--- 368,372 ----
{
// Block is not nested.
! $code_lines[$i] = '$_' . $m[1] . '_count = ( isset($this->_tpldata[\'' . $m[1] . '.\']) ) ? sizeof($this->_tpldata[\'' . $m[1] . '.\']) : 0;';
$code_lines[$i] .= "\n" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1] . '_count; $_' . $m[1] . '_i++)';
$code_lines[$i] .= "\n" . '{';
***************
*** 383,387 ****
$varref = $this->generate_block_data_ref($namespace, false);
// Create the for loop code to iterate over this block.
! $code_lines[$i] = '$_' . $m[1] . '_count = sizeof(' . $varref . ');';
$code_lines[$i] .= "\n" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1] . '_count; $_' . $m[1] . '_i++)';
$code_lines[$i] .= "\n" . '{';
--- 384,388 ----
$varref = $this->generate_block_data_ref($namespace, false);
// Create the for loop code to iterate over this block.
! $code_lines[$i] = '$_' . $m[1] . '_count = ( isset(' . $varref . ') ) ? sizeof(' . $varref . ') : 0;';
$code_lines[$i] .= "\n" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1] . '_count; $_' . $m[1] . '_i++)';
$code_lines[$i] .= "\n" . '{';
***************
*** 473,475 ****
}
! ?>
--- 474,476 ----
}
! ?>
\ No newline at end of file
|