The uid of the current user is always available in the gloabl $_USER['uid'] variable - unless it's an anonymous user, then it's not set. So you could do something like:
Text Formatted Code
if (COM_isAnonUser()) {
$uid = 1;
} else {
$uid = $_USER['uid'];
}
And don't forget the global $_USER; declaration.
bye, Dirk