From 994973d8ee97dd3fe88a08d9171fb918b90b0c28 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 10 Jan 2004 12:23:24 +0000 Subject: 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 --- phpBB/includes/session.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'phpBB/includes/session.php') 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; -- cgit v1.2.1