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";
53 $GLOBALS['page']->headers |
= page
::Userheader
;
57 function namelink($id, $name = null)
59 if ( empty($this->namecache
[$id]) ) {
61 list($name) = $GLOBALS['DB']->query('SELECT `alias` FROM `users`
62 WHERE `userid` = '.$id)->fetch_row();
64 return ($this->namecache
[$id] = $name);
66 return $this->namecache
[$id];
69 function fillnamecache(mysqli_result
$rows)
71 while ( list($a, $b) = $rows->fetch_row() )
72 $this->namecache
[$a] = $c[$a] = $b;
76 function fdate($timestamp)
78 return ( $timestamp == 0 ?
'N/A' : date('Y-m-d H:i:s', $timestamp) );