13 function __construct($dbpointer)
15 $this->DB
= $dbpointer;
16 $this->userlinks
= array(
17 _('Log In') => '#footer'
20 $this->attrcache
= array(
24 'language' => DEFAULT_LANGUAGE
,
25 'msglist_layout' => 0,
26 'topiclist_layout' => 0,
27 'boardlist_layout' => 0,
33 function __get($varname)
35 if ( array_key_exists($varname, $this->attrcache
) ) {
36 return $this->attrcache
[$varname];
38 throw new OutOfBoundsException('Error in $user->_get('.$varname.'): attribute not available.');
43 if ( ! ($this->page
->headers
& page
::Pageheader
) )
44 $this->page
->pageheader();
46 if ( ! ($this->page
->headers
& page
::Userheader
) ) {
47 echo '<ul id="userheader" class="nl">',"\n";
48 foreach ( $this->userlinks
as $text => $href )
49 echo ' <li><a href="',$href,'">',$text,"</a></li>\n";
51 $this->page
->headers |
= page
::Userheader
;
55 function namelink($id, $name = null)
57 if ( empty($this->namecache
[$id]) ) {
59 $this->namecache
[$id] = $this->DB
->query('SELECT `alias` FROM `users` WHERE `userid` = '.$id)->fetch_object()->name
;
61 $this->namecache
[$id] = $name;
63 return $this->namecache
[$id];
66 function fdate($timestamp)
68 return ( $timestamp == 0 ?
'N/A' : date('Y-m-d H:i:s', $timestamp) );