July 23rd, 2002

  • ljnp4u

Bugzilla bug 39


(for some reason I am currently unable to write a comment to this bug, I get this:
Only the owner or submitter of the bug, or a sufficiently empowered user, may make that change to the op_sys field.
Old value:
New value: All
So I'm posting it here)

I just went checking into this, there will also be a problem if there are more than 50 screened comments, or 25 screened comments. It will try to show multiple pages or a threaded view, because of this:

my $post_count = 0;
while (my $post = $sth->fetchrow_hashref) {
$post_count++ unless ($post->{'state'} eq "D");
$posts{$post->{'talkid'}} = $post;
push @{$children{$post->{'parenttalkid'}}}, $post->{'talkid'};

Will count everything unless the post was deleted. Screened comments should be taken into account, but not just like this:

$post_count++ unless (($post->{'state'} eq "D") || (post->{'state'} eq "S"));

As some people are indeed allowed to see screened comments.

I'm a bit worried that calling LJ::Talk::can_view_screened that many times to get the real count is going to be overkill.

Would it be acceptable to try and call that function so many times ? it's being done again later actually, and this is just to get the count of items. Like we could drop them into a hash while doing so we don't need to call the function again later.
binary and a cookie to whoever notices
  • xb95

Minor ljviews.pl Patch: nohtml

Have you ever run into the problem with someone posting HTML in their journal that is just totally trashing your friends page? Images you'd rather not see while you're at work? Just dislike people who like to post tables and other such things?

No more!

Okay, enough of the radio announcer crap. I put together a simple (8 line!) patch to ljviews.pl that simply checks for nohtml=1 on lastn and friends view generation. If present, it escapes everything except LiveJournal specific tags. I.e. this comes out as <b>this</b> but the lj-cut they put in there stays and works fine.

It has been tested on my goathack: normal, with nohtml=1.

The patch is simple, 8 lines: