mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
- 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
This commit is contained in:
@@ -1900,6 +1900,12 @@ function page_header($page_title = '')
|
||||
'T_TEMPLATE_PATH' => "{$phpbb_root_path}styles/" . $user->theme['primary']['template_path'] . '/template',
|
||||
'T_IMAGESET_PATH' => "{$phpbb_root_path}styles/" . $user->theme['primary']['imageset_path'] . '/imageset',
|
||||
'T_IMAGESET_LANG_PATH' => "{$phpbb_root_path}styles/" . $user->theme['primary']['imageset_path'] . '/imageset/' . $user->data['user_lang'],
|
||||
'T_SMILIES_PATH' => "{$phpbb_root_path}{$config['smilies_path']}/",
|
||||
'T_AVATAR_PATH' => "{$phpbb_root_path}{$config['avatar_path']}/",
|
||||
'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$config['avatar_gallery_path']}/",
|
||||
'T_ICONS_PATH' => "{$phpbb_root_path}{$config['icons_path']}/",
|
||||
'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/",
|
||||
'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/",
|
||||
'T_STYLESHEET_LINK' => (!$user->theme['primary']['theme_storedb']) ? "{$phpbb_root_path}styles/" . $user->theme['primary']['theme_path'] . '/theme/stylesheet.css' : "{$phpbb_root_path}style.$phpEx?sid=$user->session_id&id=" . $user->theme['primary']['theme_id'],
|
||||
'T_STYLESHEET_NAME' => $user->theme['primary']['theme_name'],
|
||||
'T_THEME_DATA' => (!$user->theme['primary']['theme_storedb']) ? '' : $user->theme['primary']['theme_data'])
|
||||
|
@@ -304,7 +304,7 @@ function display_forums($root_data = '', $display_moderators = TRUE)
|
||||
'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'),
|
||||
|
||||
'FORUM_ID' => $row['forum_id'],
|
||||
'FORUM_FOLDER_IMG' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $folder_alt . '" border="0" />' : $user->img($folder_image, $folder_alt),
|
||||
'FORUM_FOLDER_IMG' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $folder_alt . '" />' : $user->img($folder_image, $folder_alt),
|
||||
'FORUM_NAME' => $row['forum_name'],
|
||||
'FORUM_DESC' => $row['forum_desc'],
|
||||
$l_post_click_count => $post_click_count,
|
||||
|
@@ -133,7 +133,7 @@ function mcp_topic_view($id, $mode, $action, $url)
|
||||
'MESSAGE' => $message,
|
||||
'POST_ID' => $row['post_id'],
|
||||
|
||||
'POST_ICON_IMG' => ($row['post_time'] > $user->data['user_lastvisit'] && $user->data['is_registered']) ? $user->img('icon_post_new', $user->lang['NEW_POST']) : $user->img('icon_post', $user->lang['POST']),
|
||||
'MINI_POST_IMG' => ($row['post_time'] > $user->data['user_lastvisit'] && $user->data['is_registered']) ? $user->img('icon_post_new', $user->lang['NEW_POST']) : $user->img('icon_post', $user->lang['POST']),
|
||||
|
||||
'S_CHECKBOX' => $s_checkbox,
|
||||
'S_POST_REPORTED' => ($row['post_reported']) ? true : false,
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user