15 function __construct()
17 $this->userlinks
= array(
18 'Log In' => '#login_u'
21 $this->attrcache
= array(
25 'msglist_layout' => 0,
26 'topiclist_layout' => 0,
27 'boardlist_layout' => 0,
33 function __get($varname)
36 if ( array_key_exists($varname, $this->attrcache
) ) {
37 return $this->attrcache
[$varname];
39 throw new OutOfBoundsException('Error in $user->_get('.$varname.'): attribute not available.');
44 if ( ! ($GLOBALS['page']->headers
& page
::Pageheader
) )
45 $GLOBALS['page']->pageheader();
47 if ( ! ($GLOBALS['page']->headers
& page
::Userheader
) ) {
48 echo '<ul id="userheader" class="nl">',"\n";
49 foreach ( $this->userlinks
as $text => $href )
50 echo ' <li><a href="',$href,'">',$text,"</a></li>\n";
52 $GLOBALS['page']->headers |
= page
::Userheader
;
56 function namelink($id, $name = null)
58 if ( empty($this->namecache
[$id]) ) {
60 $this->namecache
[$id] = $GLOBALS['DB']->query('SELECT `alias` FROM `users`
61 WHERE `userid` = '.$id)->fetch_object()->alias
;
63 $this->namecache
[$id] = $name;
65 return $this->namecache
[$id];
68 function fdate($timestamp)
70 return ( $timestamp == 0 ?
'N/A' : date('Y-m-d H:i:s', $timestamp) );