diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2005-04-11 21:32:22 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2005-04-11 21:32:22 +0000 |
commit | d92380657d555a3f8267652183d02e2aae87511a (patch) | |
tree | d5e94c57f53ea2ff8fdbda08bf0d9b6692021eba /phpBB/includes/template.php | |
parent | 557d09bb72f7e9848b6fc50ed4e2ba651b89e743 (diff) | |
download | forums-d92380657d555a3f8267652183d02e2aae87511a.tar forums-d92380657d555a3f8267652183d02e2aae87511a.tar.gz forums-d92380657d555a3f8267652183d02e2aae87511a.tar.bz2 forums-d92380657d555a3f8267652183d02e2aae87511a.tar.xz forums-d92380657d555a3f8267652183d02e2aae87511a.zip |
- made path information available to template (T_)
- eased topic/post icon in templates (removing hardcoded img)
- added S_FIRST_ROW and S_LAST_ROW to template engine
git-svn-id: file:///svn/phpbb/trunk@5118 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/template.php')
-rw-r--r-- | phpBB/includes/template.php | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index 3d9e0d605a..90f635f5a0 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -126,7 +126,6 @@ class template return true; } - // Load a compiled template if possible, if not, recompile it function _tpl_load(&$handle) { @@ -265,18 +264,47 @@ class template $str = &$str[sizeof($str) - 1]; } + $vararray['S_ROW_COUNT'] = sizeof($str[$blocks[$blockcount]]); + + // Assign S_FIRST_ROW + if (sizeof($str[$blocks[$blockcount]]) == 0) + { + $vararray['S_FIRST_ROW'] = true; + } + + // Now the tricky part, we always assign S_LAST_ROW and remove the entry before + // This is much more clever than going through the complete template data on display (phew) + $vararray['S_LAST_ROW'] = true; + if (sizeof($str[$blocks[$blockcount]]) > 0) + { + unset($str[$blocks[$blockcount]][sizeof($str[$blocks[$blockcount]]) - 1]['S_LAST_ROW']); + } + // Now we add the block that we're actually assigning to. // We're adding a new iteration to this block with the given // variable assignments. - $vararray['S_ROW_COUNT'] = sizeof($str[$blocks[$blockcount]]); $str[$blocks[$blockcount]][] = &$vararray; } else { // Top-level block. + $vararray['S_ROW_COUNT'] = sizeof($this->_tpldata[$blockname]); + + // Assign S_FIRST_ROW + if (sizeof($this->_tpldata[$blockname]) == 0) + { + $vararray['S_FIRST_ROW'] = true; + } + + // We always assign S_LAST_ROW and remove the entry before + $vararray['S_LAST_ROW'] = true; + if (sizeof($this->_tpldata[$blockname]) > 0) + { + unset($this->_tpldata[$blockname][sizeof($this->_tpldata[$blockname]) - 1]['S_LAST_ROW']); + } + // Add a new iteration to this block with the variable assignments // we were given. - $vararray['S_ROW_COUNT'] = sizeof($this->_tpldata[$blockname]); $this->_tpldata[$blockname][] = &$vararray; } |