diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2004-01-10 12:23:24 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2004-01-10 12:23:24 +0000 |
| commit | 994973d8ee97dd3fe88a08d9171fb918b90b0c28 (patch) | |
| tree | 66eb93eb31042ae8d3eda522e4305e0b4e741884 /phpBB/includes/session.php | |
| parent | 62429cb9fbec7192478bbdf9148324300445485f (diff) | |
| download | forums-994973d8ee97dd3fe88a08d9171fb918b90b0c28.tar forums-994973d8ee97dd3fe88a08d9171fb918b90b0c28.tar.gz forums-994973d8ee97dd3fe88a08d9171fb918b90b0c28.tar.bz2 forums-994973d8ee97dd3fe88a08d9171fb918b90b0c28.tar.xz forums-994973d8ee97dd3fe88a08d9171fb918b90b0c28.zip | |
custom profile fields.
Not finished, committed to let us discuss about the next steps
-> BartVB
git-svn-id: file:///svn/phpbb/trunk@4740 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/session.php')
| -rw-r--r-- | phpBB/includes/session.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 725957a0c1..185a22546f 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -596,6 +596,42 @@ class user extends session return strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates); } + function get_iso_lang_id() + { + global $config, $db; + + if ($this->lang_id) + { + return $this->lang_id; + } + + if (empty($this->lang_name)) + { + $this->lang_name = $config['default_lang']; + } + + $result = $db->sql_query("SELECT lang_id FROM phpbb_lang WHERE lang_iso = '" . $this->lang_name . "'"); + return (int) $db->sql_fetchfield('lang_id', 0, $result); + } + + // Get profile fields for user + function get_profile_fields($user_id) + { + global $user, $db; + + if (isset($user->profile_fields)) + { + return; + } + + $sql = 'SELECT * FROM + phpbb_profile_fields_data + WHERE user_id = ' . $user_id; + $result = $db->sql_query_limit($sql, 1); + + $user->profile_fields = (!($row = $db->sql_fetchrow($result))) ? array() : $row; + } + function img($img, $alt = '', $width = false, $no_cache = false) { static $imgs; |
