diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 848e97d935..2c77d15aa9 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -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']) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 190d07015e..1454391e9c 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -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']) ? '' . $folder_alt . '' : $user->img($folder_image, $folder_alt), + 'FORUM_FOLDER_IMG' => ($row['forum_image']) ? '' . $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, diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 7d0a0d9cd4..31c79250f1 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -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, 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; } diff --git a/phpBB/search.php b/phpBB/search.php index e218c61a62..9dac6b12ee 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -710,7 +710,9 @@ if ($search_keywords || $search_author || $search_id) 'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'), 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), - 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '' : '', + 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '', + 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '', + 'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '', 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', sprintf($user->lang['TOTAL_ATTACHMENTS'], $row['topic_attachment'])) : '', 'S_TOPIC_TYPE' => $row['topic_type'], diff --git a/phpBB/styles/subSilver/template/mcp_topic.html b/phpBB/styles/subSilver/template/mcp_topic.html index ef772ae36b..c6642b720f 100644 --- a/phpBB/styles/subSilver/template/mcp_topic.html +++ b/phpBB/styles/subSilver/template/mcp_topic.html @@ -104,7 +104,7 @@  {L_POST_REPORTED}    - {postrow.POST_ICON_IMG} + {postrow.MINI_POST_IMG} {L_POSTED}: {postrow.POST_DATE} diff --git a/phpBB/styles/subSilver/template/search_results.html b/phpBB/styles/subSilver/template/search_results.html index 451b9a2406..6701cc12ff 100644 --- a/phpBB/styles/subSilver/template/search_results.html +++ b/phpBB/styles/subSilver/template/search_results.html @@ -30,7 +30,11 @@ {searchresults.TOPIC_FOLDER_IMG} - {searchresults.TOPIC_ICON_IMG} + + + + + {UNAPPROVED_IMG}  diff --git a/phpBB/styles/subSilver/template/viewforum_body.html b/phpBB/styles/subSilver/template/viewforum_body.html index 76d408f506..0f9f4b1829 100644 --- a/phpBB/styles/subSilver/template/viewforum_body.html +++ b/phpBB/styles/subSilver/template/viewforum_body.html @@ -39,7 +39,7 @@ {topicrow.TOPIC_FOLDER_IMG} - {topicrow.TOPIC_ICON_IMG} + @@ -158,7 +158,7 @@ {topicrow.TOPIC_FOLDER_IMG} - {topicrow.TOPIC_ICON_IMG} + diff --git a/phpBB/styles/subSilver/template/viewtopic_body.html b/phpBB/styles/subSilver/template/viewtopic_body.html index e3fa0313a2..502687fb10 100644 --- a/phpBB/styles/subSilver/template/viewtopic_body.html +++ b/phpBB/styles/subSilver/template/viewtopic_body.html @@ -129,7 +129,7 @@ - + diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 14cae34d18..075719393c 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -446,7 +446,9 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) 'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'), 'NEWEST_POST_IMG' => $newest_post_img, 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), - 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '' : '', + 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '', + 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '', + 'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '', 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', sprintf($user->lang['TOTAL_ATTACHMENTS'], $row['topic_attachment'])) : '', 'S_TOPIC_TYPE' => $row['topic_type'], diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index cc0d2a7733..137616ca96 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1251,8 +1251,10 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'EDIT_REASON' => $row['post_edit_reason'], 'BUMPED_MESSAGE'=> $l_bumped_by, - 'MINI_POST_IMG' => ($user->data['is_registered'] && $row['post_time'] > $user->data['user_lastvisit'] && $row['post_time'] > $topic_last_read) ? $user->img('icon_post_new', 'NEW_POST') : $user->img('icon_post', 'POST'), - 'POST_ICON_IMG' => (!empty($row['icon_id'])) ? '' : '', + 'MINI_POST_IMG' => ($user->data['is_registered'] && $row['post_time'] > $user->data['user_lastvisit'] && $row['post_time'] > $topic_last_read) ? $user->img('icon_post_new', 'NEW_POST') : $user->img('icon_post', 'POST'), + 'POST_ICON_IMG' => (!empty($row['icon_id'])) ? $icons[$row['icon_id']]['img'] : '', + 'POST_ICON_IMG_WIDTH' => (!empty($row['icon_id'])) ? $icons[$row['icon_id']]['width'] : '', + 'POST_ICON_IMG_HEIGHT' => (!empty($row['icon_id'])) ? $icons[$row['icon_id']]['height'] : '', 'ICQ_STATUS_IMG' => $user_cache[$poster_id]['icq_status_img'], 'ONLINE_IMG' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? '' : (($user_cache[$poster_id]['online']) ? $user->img('btn_online', 'ONLINE') : $user->img('btn_offline', 'OFFLINE')),
{postrow.POST_ICON_IMG}
 {L_POST_SUBJECT}: {postrow.POST_SUBJECT}
{postrow.MINI_POST_IMG}{L_POSTED}: {postrow.POST_DATE}