mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
simplify $user->img()
git-svn-id: file:///svn/phpbb/trunk@8859 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
cc5d77e06d
commit
17ec98b834
9 changed files with 16 additions and 16 deletions
|
@ -408,7 +408,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||||
'TOPICS' => $row['forum_topics'],
|
'TOPICS' => $row['forum_topics'],
|
||||||
$l_post_click_count => $post_click_count,
|
$l_post_click_count => $post_click_count,
|
||||||
'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt),
|
'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt),
|
||||||
'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'),
|
'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, 'src'),
|
||||||
'FORUM_FOLDER_IMG_ALT' => isset($user->lang[$folder_alt]) ? $user->lang[$folder_alt] : '',
|
'FORUM_FOLDER_IMG_ALT' => isset($user->lang[$folder_alt]) ? $user->lang[$folder_alt] : '',
|
||||||
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . PHPBB_ROOT_PATH . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',
|
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . PHPBB_ROOT_PATH . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',
|
||||||
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? PHPBB_ROOT_PATH . $row['forum_image'] : '',
|
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? PHPBB_ROOT_PATH . $row['forum_image'] : '',
|
||||||
|
|
|
@ -221,7 +221,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
|
||||||
$topic_row = array(
|
$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']) : '',
|
'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_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
||||||
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
|
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, 'src'),
|
||||||
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
|
'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_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'] : '',
|
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
|
||||||
|
|
|
@ -293,8 +293,8 @@ function mcp_topic_view($id, $mode, $action)
|
||||||
'POSTS_PER_PAGE' => $posts_per_page,
|
'POSTS_PER_PAGE' => $posts_per_page,
|
||||||
'ACTION' => $action,
|
'ACTION' => $action,
|
||||||
|
|
||||||
'REPORTED_IMG' => $user->img('icon_topic_reported', 'POST_REPORTED', false, true),
|
'REPORTED_IMG' => $user->img('icon_topic_reported', 'POST_REPORTED'),
|
||||||
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'POST_UNAPPROVED', false, true),
|
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'POST_UNAPPROVED'),
|
||||||
|
|
||||||
'S_MCP_ACTION' => "$url&i=$id&mode=$mode&action=$action&start=$start",
|
'S_MCP_ACTION' => "$url&i=$id&mode=$mode&action=$action&start=$start",
|
||||||
'S_FORUM_SELECT' => ($to_forum_id) ? make_forum_select($to_forum_id, false, false, true, true, true) : make_forum_select($topic_info['forum_id'], false, false, true, true, true),
|
'S_FORUM_SELECT' => ($to_forum_id) ? make_forum_select($to_forum_id, false, false, true, true, true) : make_forum_select($topic_info['forum_id'], false, false, true, true, true),
|
||||||
|
|
|
@ -2077,7 +2077,7 @@ class user extends session
|
||||||
/**
|
/**
|
||||||
* Specify/Get image
|
* Specify/Get image
|
||||||
*/
|
*/
|
||||||
function img($img, $alt = '', $width = false, $suffix = '', $type = 'full_tag')
|
function img($img, $alt = '', $type = 'full_tag', $width = false)
|
||||||
{
|
{
|
||||||
static $imgs;
|
static $imgs;
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ class ucp_main
|
||||||
'TOPIC_TYPE' => $topic_type,
|
'TOPIC_TYPE' => $topic_type,
|
||||||
|
|
||||||
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
||||||
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
|
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, 'src'),
|
||||||
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', '') : '',
|
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', '') : '',
|
||||||
|
|
||||||
'S_USER_POSTED' => (!empty($row['topic_posted']) && $row['topic_posted']) ? true : false,
|
'S_USER_POSTED' => (!empty($row['topic_posted']) && $row['topic_posted']) ? true : false,
|
||||||
|
@ -332,7 +332,7 @@ class ucp_main
|
||||||
$template->assign_block_vars('forumrow', array(
|
$template->assign_block_vars('forumrow', array(
|
||||||
'FORUM_ID' => $forum_id,
|
'FORUM_ID' => $forum_id,
|
||||||
'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt),
|
'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt),
|
||||||
'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'),
|
'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, 'src'),
|
||||||
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . PHPBB_ROOT_PATH . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',
|
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . PHPBB_ROOT_PATH . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',
|
||||||
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? PHPBB_ROOT_PATH . $row['forum_image'] : '',
|
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? PHPBB_ROOT_PATH . $row['forum_image'] : '',
|
||||||
'FORUM_NAME' => $row['forum_name'],
|
'FORUM_NAME' => $row['forum_name'],
|
||||||
|
@ -804,7 +804,7 @@ class ucp_main
|
||||||
'FORUM_NAME' => $row['forum_name'],
|
'FORUM_NAME' => $row['forum_name'],
|
||||||
|
|
||||||
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
||||||
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
|
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, 'src'),
|
||||||
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
|
'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_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'] : '',
|
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
|
||||||
|
|
|
@ -231,7 +231,7 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||||
'PM_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '<img src="' . $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] . '" width="' . $icons[$row['icon_id']]['width'] . '" height="' . $icons[$row['icon_id']]['height'] . '" alt="" title="" />' : '',
|
'PM_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '<img src="' . $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] . '" width="' . $icons[$row['icon_id']]['width'] . '" height="' . $icons[$row['icon_id']]['height'] . '" alt="" title="" />' : '',
|
||||||
'PM_ICON_URL' => (!empty($icons[$row['icon_id']])) ? $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] : '',
|
'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' => $user->img($folder_img, $folder_alt),
|
||||||
'FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
|
'FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, 'src'),
|
||||||
'PM_IMG' => ($row_indicator) ? $user->img('pm_' . $row_indicator, '') : '',
|
'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']) : '',
|
'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']) : '',
|
||||||
|
|
||||||
|
|
|
@ -799,10 +799,10 @@ if ($keywords || $author || $author_id || $search_id || $submit)
|
||||||
'TOPIC_TYPE' => $topic_type,
|
'TOPIC_TYPE' => $topic_type,
|
||||||
|
|
||||||
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
||||||
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
|
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, 'src'),
|
||||||
'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt],
|
'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt],
|
||||||
'TOPIC_FOLDER_IMG_WIDTH'=> $user->img($folder_img, '', false, '', 'width'),
|
'TOPIC_FOLDER_IMG_WIDTH'=> $user->img($folder_img, '', 'width'),
|
||||||
'TOPIC_FOLDER_IMG_HEIGHT' => $user->img($folder_img, '', false, '', 'height'),
|
'TOPIC_FOLDER_IMG_HEIGHT' => $user->img($folder_img, '', 'height'),
|
||||||
|
|
||||||
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
|
'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_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
|
||||||
|
|
|
@ -635,10 +635,10 @@ if (sizeof($topic_list))
|
||||||
'TOPIC_TYPE' => $topic_type,
|
'TOPIC_TYPE' => $topic_type,
|
||||||
|
|
||||||
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
||||||
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
|
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, 'src'),
|
||||||
'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt],
|
'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt],
|
||||||
'TOPIC_FOLDER_IMG_WIDTH'=> $user->img($folder_img, '', false, '', 'width'),
|
'TOPIC_FOLDER_IMG_WIDTH'=> $user->img($folder_img, '', 'width'),
|
||||||
'TOPIC_FOLDER_IMG_HEIGHT' => $user->img($folder_img, '', false, '', 'height'),
|
'TOPIC_FOLDER_IMG_HEIGHT' => $user->img($folder_img, '', 'height'),
|
||||||
|
|
||||||
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
|
'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_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
|
||||||
|
|
|
@ -828,7 +828,7 @@ if (!empty($topic_data['poll_start']))
|
||||||
'POLL_OPTION_RESULT' => $poll_option['poll_option_total'],
|
'POLL_OPTION_RESULT' => $poll_option['poll_option_total'],
|
||||||
'POLL_OPTION_PERCENT' => $option_pct_txt,
|
'POLL_OPTION_PERCENT' => $option_pct_txt,
|
||||||
'POLL_OPTION_PCT' => round($option_pct * 100),
|
'POLL_OPTION_PCT' => round($option_pct * 100),
|
||||||
'POLL_OPTION_IMG' => $user->img('poll_center', $option_pct_txt, round($option_pct * 250)),
|
'POLL_OPTION_IMG' => $user->img('poll_center', $option_pct_txt, '', round($option_pct * 250)),
|
||||||
'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false)
|
'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue