From abc8384bf2b70825983dc3f2ddaed6b8de82ae1f Mon Sep 17 00:00:00 2001 From: hanakin Date: Tue, 18 Jan 2011 22:39:50 -0500 Subject: [PATCH] [ticket/10001] Created new Template variable to house class names based on $folder_img value, Modified prosilver template files to utilize class for forum & topic images through out template via the newly created Template variable, Created the new styles within colours.css to handle the displaying of the forum & topic images * Created new Template variable to house class names based on $folder_img value in functions_display.php. * Created new Template variable to house class names based on $folder_img value in mcp_forums.php. * Created new Template variable to house class names based on $folder_img value in ucp_main.php. * Created new Template variable to house class names based on $folder_img value in search.php. * Created new Template variable to house class names based on $folder_img value in ucp_pm_viewfolder.php. * Created new Template variable to house class names based on $folder_img value in search.php. * Created new Template variable to house class names based on $folder_img value in viewforum.php. * Modified forumlist_body.html to utilize class for forum & topic images through out template via the newly created Template variable * Modified mcp_forum.html to utilize class for forum & topic images through out template via the newly created Template variable * Modified search_results.html to utilize class for forum & topic images through out template via the newly created Template variable * Modified ucp_main_bookmarks.html to utilize class for forum & topic images through out template via the newly created Template variable * Modified ucp_main_subscribed.html to utilize class for forum & topic images through out template via the newly created Template variable * Modified ucp_main_front.html to utilize class for forum & topic images through out template via the newly created Template variable * Modified ucp_pm_viewfolder.html to utilize class for forum & topic images through out template via the newly created Template variable * Modified viewforum_body.html to utilize class for forum & topic images through out template via the newly created Template variable * Created the new styles within colours.css to handle the displaying of the forum & topic images - NOTES: This changes are the first step in the revamp of prosilver initiative, this provides the ground work to handle the images via sprites to reduce the amount of HTTP requests by the server PHPBB3-10001 --- phpBB/includes/functions_display.php | 1 + phpBB/includes/mcp/mcp_forum.php | 1 + phpBB/includes/ucp/ucp_main.php | 3 +++ phpBB/includes/ucp/ucp_pm_viewfolder.php | 1 + phpBB/search.php | 1 + phpBB/styles/prosilver/template/forumlist_body.html | 2 +- phpBB/styles/prosilver/template/mcp_forum.html | 2 +- phpBB/styles/prosilver/template/search_results.html | 2 +- phpBB/styles/prosilver/template/ucp_main_bookmarks.html | 2 +- phpBB/styles/prosilver/template/ucp_main_front.html | 2 +- phpBB/styles/prosilver/template/ucp_main_subscribed.html | 4 ++-- phpBB/styles/prosilver/template/ucp_pm_viewfolder.html | 2 +- phpBB/styles/prosilver/template/viewforum_body.html | 2 +- phpBB/viewforum.php | 1 + 14 files changed, 17 insertions(+), 9 deletions(-) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index acaef49fe8..56bc2eabd2 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -463,6 +463,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']), 'TOPICS' => $row['forum_topics'], $l_post_click_count => $post_click_count, + 'FORUM_IMG_STYLE' => $folder_image, 'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt), 'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'), 'FORUM_FOLDER_IMG_ALT' => isset($user->lang[$folder_alt]) ? $user->lang[$folder_alt] : '', diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index b70601b479..9bcfae9264 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -221,6 +221,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) $topic_row = array( 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + 'TOPIC_IMG_STYLE' => $folder_img, 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '', diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index a6f71669ce..f05ae54d7d 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -148,6 +148,7 @@ class ucp_main 'TOPIC_TITLE' => censor_text($row['topic_title']), 'TOPIC_TYPE' => $topic_type, + 'TOPIC_IMG_STYLE' => $folder_img, 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', '') : '', @@ -334,6 +335,7 @@ class ucp_main $template->assign_block_vars('forumrow', array( 'FORUM_ID' => $forum_id, + 'FORUM_IMG_STYLE' => $folder_image, 'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt), 'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'), 'FORUM_IMAGE' => ($row['forum_image']) ? '' . $user->lang[$folder_alt] . '' : '', @@ -811,6 +813,7 @@ class ucp_main 'TOPIC_TYPE' => $topic_type, 'FORUM_NAME' => $row['forum_name'], + 'TOPIC_IMG_STYLE' => $folder_img, 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), 'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt], diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index 6b7172ca2b..df5097cdc6 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -165,6 +165,7 @@ function view_folder($id, $mode, $folder_id, $folder) 'PM_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '' : '', 'PM_ICON_URL' => (!empty($icons[$row['icon_id']])) ? $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] : '', 'FOLDER_IMG' => $user->img($folder_img, $folder_alt), + 'FOLDER_IMG_STYLE' => $folder_img, 'FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), 'PM_IMG' => ($row_indicator) ? $user->img('pm_' . $row_indicator, '') : '', 'ATTACH_ICON_IMG' => ($auth->acl_get('u_pm_download') && $row['message_attachment'] && $config['allow_pm_attach']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', diff --git a/phpBB/search.php b/phpBB/search.php index 2aa61401cf..0c338cfe2b 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -898,6 +898,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) 'PAGINATION' => topic_generate_pagination($replies, $view_topic_url), 'TOPIC_TYPE' => $topic_type, + 'TOPIC_IMG_STYLE' => $folder_img, 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), 'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt], diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index e9ed5d9daf..d6596203e5 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -25,7 +25,7 @@
  • -
    +
    diff --git a/phpBB/styles/prosilver/template/mcp_forum.html b/phpBB/styles/prosilver/template/mcp_forum.html index 2c98f7c9fa..ccda67dbd1 100644 --- a/phpBB/styles/prosilver/template/mcp_forum.html +++ b/phpBB/styles/prosilver/template/mcp_forum.html @@ -34,7 +34,7 @@
  • -
    +
    style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"> [ {L_SELECT_MERGE} ]   {topicrow.TOPIC_TITLE} diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html index f2a4435103..c2dcf1387f 100644 --- a/phpBB/styles/prosilver/template/search_results.html +++ b/phpBB/styles/prosilver/template/search_results.html @@ -51,7 +51,7 @@
  • -
    +
    style="background-image: url({T_ICONS_PATH}{searchresults.TOPIC_ICON_IMG}); background-repeat: no-repeat;"> {NEWEST_POST_IMG} {searchresults.TOPIC_TITLE} {searchresults.ATTACH_ICON_IMG} diff --git a/phpBB/styles/prosilver/template/ucp_main_bookmarks.html b/phpBB/styles/prosilver/template/ucp_main_bookmarks.html index 9d7c4ce1aa..b91b44b215 100644 --- a/phpBB/styles/prosilver/template/ucp_main_bookmarks.html +++ b/phpBB/styles/prosilver/template/ucp_main_bookmarks.html @@ -31,7 +31,7 @@
    -
    +
    style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;" title="{topicrow.TOPIC_FOLDER_IMG_ALT}"> {NEWEST_POST_IMG} {topicrow.TOPIC_TITLE} {topicrow.UNAPPROVED_IMG} diff --git a/phpBB/styles/prosilver/template/ucp_main_front.html b/phpBB/styles/prosilver/template/ucp_main_front.html index 39c5d4f396..dba959c7cc 100644 --- a/phpBB/styles/prosilver/template/ucp_main_front.html +++ b/phpBB/styles/prosilver/template/ucp_main_front.html @@ -13,7 +13,7 @@
    • -
      +
      style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"> {NEWEST_POST_IMG} {topicrow.TOPIC_TITLE}
      {topicrow.PAGINATION} diff --git a/phpBB/styles/prosilver/template/ucp_main_subscribed.html b/phpBB/styles/prosilver/template/ucp_main_subscribed.html index 210537ced8..b37fee8589 100644 --- a/phpBB/styles/prosilver/template/ucp_main_subscribed.html +++ b/phpBB/styles/prosilver/template/ucp_main_subscribed.html @@ -22,7 +22,7 @@
    • -
      +
      {forumrow.FORUM_NAME}
      {forumrow.FORUM_DESC}
      {L_LAST_POST} {L_POST_BY_AUTHOR} {forumrow.LAST_POST_AUTHOR_FULL} {LAST_POST_IMG}
      {forumrow.LAST_POST_TIME}
      @@ -51,7 +51,7 @@
    • -
      +
      style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;" title="{topicrow.TOPIC_FOLDER_IMG_ALT}"> {NEWEST_POST_IMG} {topicrow.TOPIC_TITLE} {topicrow.UNAPPROVED_IMG} diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html index d7e02e405e..5d52f432e4 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html @@ -58,7 +58,7 @@
    • -
      +
      style="background-image: url({messagerow.PM_ICON_URL}); background-repeat: no-repeat;"> diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index 12073a39d2..6c1facc555 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -138,7 +138,7 @@
    • -
      +
      style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;" title="{topicrow.TOPIC_FOLDER_IMG_ALT}">{NEWEST_POST_IMG} {topicrow.TOPIC_TITLE} {topicrow.UNAPPROVED_IMG} {REPORTED_IMG}
      diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 9cfa93f880..b198d47673 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -645,6 +645,7 @@ if (sizeof($topic_list)) 'TOPIC_TITLE' => censor_text($row['topic_title']), 'TOPIC_TYPE' => $topic_type, + 'TOPIC_IMG_STYLE' => $folder_img, 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), 'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt],