diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2005-04-20 19:59:59 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2005-04-20 19:59:59 +0000 |
| commit | 8e50cf41856510e9b868b14706b795096c1414a7 (patch) | |
| tree | 16dd3929415d4847a8f4b871a70c7bbe1c5b5940 /phpBB/includes/session.php | |
| parent | f13453056625e480857bcf144144ab751c699523 (diff) | |
| download | forums-8e50cf41856510e9b868b14706b795096c1414a7.tar forums-8e50cf41856510e9b868b14706b795096c1414a7.tar.gz forums-8e50cf41856510e9b868b14706b795096c1414a7.tar.bz2 forums-8e50cf41856510e9b868b14706b795096c1414a7.tar.xz forums-8e50cf41856510e9b868b14706b795096c1414a7.zip | |
- add ability to grab single image params from user::img
git-svn-id: file:///svn/phpbb/trunk@5126 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/session.php')
| -rw-r--r-- | phpBB/includes/session.php | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 097185731d..5df5c227f5 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -804,7 +804,7 @@ class user extends session $db->sql_freeresult($result); } - function img($img, $alt = '', $width = false, $suffix = '') + function img($img, $alt = '', $width = false, $suffix = '', $type = 'full_tag') { static $imgs; global $phpbb_root_path; @@ -832,15 +832,31 @@ class user extends session $imgsrc = str_replace('{SUFFIX}', $suffix, $imgsrc); } - $imgsrc = '"' . $phpbb_root_path . 'styles/' . $this->theme['primary']['imageset_path'] . '/imageset/' . str_replace('{LANG}', $this->img_lang, $imgsrc) . '"'; - $width = ($width) ? ' width="' . $width . '"' : ''; - $height = ($height) ? ' height="' . $height . '"' : ''; - - $imgs[$img . $suffix] = $imgsrc . $width . $height; + $imgs[$img . $suffix]['src'] = $phpbb_root_path . 'styles/' . $this->theme['primary']['imageset_path'] . '/imageset/' . str_replace('{LANG}', $this->img_lang, $imgsrc); + $imgs[$img . $suffix]['width'] = $width; + $imgs[$img . $suffix]['height'] = ($height) ? ' height="' . $height . '"' : ''; } $alt = (!empty($this->lang[$alt])) ? $this->lang[$alt] : $alt; - return '<img src=' . $imgs[$img . $suffix] . ' alt="' . $alt . '" title="' . $alt . '" name="' . $img . '" />'; + + switch ($type) + { + case 'src': + return $imgs[$img . $suffix]['src']; + break; + + case 'width': + return $imgs[$img . $suffix]['width']; + break; + + case 'height': + return $imgs[$img . $suffix]['height']; + break; + + default: + return '<img src="' . $imgs[$img . $suffix]['src'] . '"' . (($imgs[$img . $suffix]['width']) ? ' width="' . $imgs[$img . $suffix]['width'] . '"' : '') . (($imgs[$img . $suffix]['height']) ? ' height="' . $imgs[$img . $suffix]['height'] . '"' : '') . ' alt="' . $alt . '" title="' . $alt . '" />'; + break; + } } // Start code for checking/setting option bit field for user table |
