The variables in this code are really hard to read, but it looks like in the context you're working in, the community isn't available as a user object, so you'll have to load it.
There's a line a few lines below the part you're working on that reads:
my $comm = LJ::load_userid( $id );
If you were to paste that directly above your line, you should be able to access the username of the community as $comm->user, if I am reading this correctly.
Of course, you don't want to have to do the same assignment in every block, so it might make sense to move that line even further up where both blocks can access the same value.
no subject
The variables in this code are really hard to read, but it looks like in the context you're working in, the community isn't available as a user object, so you'll have to load it.
There's a line a few lines below the part you're working on that reads:
my $comm = LJ::load_userid( $id );
If you were to paste that directly above your line, you should be able to access the username of the community as $comm->user, if I am reading this correctly.
Of course, you don't want to have to do the same assignment in every block, so it might make sense to move that line even further up where both blocks can access the same value.
Hope that helps!