a few changes in page.tpl.php
[code]
echo '
<td align="right">'.url('u/'.$client['uname'],$client['uname']).' | '.$friendslink.' | '.msg_unread().' | '.note_unread().' | <span class="sub">'.url('member/logout',t('Logout') ).'</span>
</td>';
[/code]
in common.inc.php
[code]
function msg_unread() {
global $client, $ubase;
if ($client['id']) {
$res = sql_query("select count(*) as num from ".tb()."messages where to_id='{$client['id']}' and from_id>0 and !hasread");
$row = sql_fetch_array($res);
$num = $row['num'];
if ($num) {
return '<span><a style="color:red" href="'.$ubase.'message">'.t('Inbox').' ('.$num.')</a></span>';
}
else {
return '<span>'.url('message',t('Inbox')).'</span>';
}
}
else {
return '<span>'.url('message',t('Inbox')).'</span>';
}
}
function note_unread() {
global $client, $ubase;
if ($client['id']) {
$res = sql_query("select count(*) as num from ".tb()."messages where to_id='{$client['id']}' and from_id=0 and !hasread");
$row = sql_fetch_array($res);
$num = $row['num'];
if ($num) {
return '<span><a style="color:red" href="'.$ubase.'notifications">'.t('Notifications').' ('.$num.')</a></span>';
}
else {
return '<span>'.url('notifications',t('Notifications')).'</span>';
}
}
else {
return '<span>'.url('notifications',t('Notifications')).'</span>';
}
}
[/code] |