11 function __construct()
13 $this->userlinks
= array(
14 'Log In' => '#login_u'
17 $this->attrcache
= array(
21 'msglist_layout' => 0,
22 'topiclist_layout' => 0,
23 'boardlist_layout' => 0,
29 function __get($varname)
31 if ( array_key_exists($varname, $this->attrcache
) ) {
32 return $this->attrcache
[$varname];
34 throw new OutOfBoundsException('Error in $user->_get('.$varname.'): attribute not available.');
39 if ( ! ($GLOBALS['page']->headers
& page
::Pageheader
) )
40 $GLOBALS['page']->pageheader();
42 if ( ! ($GLOBALS['page']->headers
& page
::Userheader
) ) {
43 echo '<ul id="userheader" class="nl">',"\n";
44 foreach ( $this->userlinks
as $text => $href )
45 echo ' <li><a href="',$href,'">',$text,"</a></li>\n";
47 $GLOBALS['page']->headers |
= page
::Userheader
;
51 function namelink($id, $name = null)
53 if ( empty($this->namecache
[$id]) ) {
55 $this->namecache
[$id] = $GLOBALS['DB']->query('SELECT `alias` FROM `users`
56 WHERE `userid` = '.$id)->fetch_object()->alias
;
58 $this->namecache
[$id] = $name;
60 return $this->namecache
[$id];
63 function fdate($timestamp)
65 return ( $timestamp == 0 ?
'N/A' : date('Y-m-d H:i:s', $timestamp) );