Commit info for scoop/lib:

Modified Files:
	Scoop.pm 
Log Message:
Adding new who's online stuff. --j



Index: Scoop.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop.pm,v
retrieving revision 1.126
retrieving revision 1.127
diff -r1.126 -r1.127
1094c1094,1098
< 	
---
> 
> 	# Set the stuff for who's online.
> 	if($self->{UI}->{VARS}->{'use_whosonline'}){
>                 $self->_insert_whos_online($self->{REMOTE_IP}, $self->{UID});
> 		}
2016a2021,2047
> 
> # insert who's online info into the appropriate table
> sub _insert_whos_online {
> 
> 	my $S = shift;
> 	my $ip = shift;
> 	my $uid = shift;
> 
> 	# Try updating first. If that doesn't work, then insert
> 
> 	my ($rv, $sth) = $S->db_update({
> 		WHAT => "whos_online",
> 		SET => "uid = $uid, last_visit = NULL",
> 		WHERE => "ip = '$ip'"});
> 	warn "rv = $rv\n";
> 	
> 	$sth->finish;
> 	if ($rv != 1){
> 		my ($rv2, $sth2) = $S->db_insert({
> 			INTO => 'whos_online',
> 			COLS => 'ip, uid, last_visit',
> 			VALUES => "'$ip', '$uid', NULL"});
> 		$sth2->finish;
> 		}
> 
> 	}
>