Users on this server body<= prepare("SELECT userid,user,journaltype,statusvis FROM user ORDER BY $orderby LIMIT $offset,$pagesizeplus1"); $h->execute; my @userids; while (my $row = $h->fetchrow_hashref) { $ss{$row->{'userid'}} = $row; push @userids, $row->{'userid'}; } my $islastpage = 1; if (scalar(@userids) > $pagesize) { pop @userids; $islastpage = 0; } my $inclause = join (",", @userids); $h = $dbr->prepare("SELECT * FROM reluser WHERE userid IN ($inclause)"); $h->execute; while (my $row = $h->fetchrow_hashref) { push @{$ss{$row->{'userid'}}->{'reluser'}}, $row; } # sort bar my $pagearg = $GET{'page'} > 1 ? "&page=$GET{'page'}" : ""; my $pagearg2 = $GET{'page'} > 1 ? "?page=$GET{'page'}" : ""; $ret .= "Sort by: [ User ID | Username | Journal Type | Status Vis ] p?>"; # page bar my $next = $page + 2; $pagearg = $page > 1 ? "&page=$page" : ""; $ret .= " Previous Page " if $page; $ret .= "|" if $page && !$islastpage; $ret .= " Next Page " if !$islastpage; $ret .= "] p?>" if $page || !$islastpage; $ret .= "

"; foreach my $userid (@userids) { my $hr = $ss{$userid}; $ret .= ""; } $ret .= "
User IDUsername T/SReluser Edges
$userid"; $ret .= LJ::ljuser($hr->{'user'}, {type=> $hr->{'journaltype'}}); $ret .= "$hr->{'journaltype'}/$hr->{'statusvis'}"; if ($hr->{'reluser'} && scalar(@{$hr->{'reluser'}})) { my $c = 0; foreach my $t (sort { $a->{'type'} cmp $b->{'type'} } @{$hr->{'reluser'}}) { $ret .= "; " if $c; $ret .= "$t->{'type'}/"; $ret .= LJ::ljuser($ss{$t->{'targetid'}}->{'user'}, {type=> $ss{$t->{'targetid'}}->{'journaltype'}}); $c = 1; } } $ret .= "
"; return $ret; } _code?> page?>