Committer: gprochaev
LJSUP-7052. Backward compatibility for verticalsU branches/r72.1/cgi-bin/LJ/Browse.pm
Modified: branches/r72.1/cgi-bin/LJ/Browse.pm =================================================================== --- branches/r72.1/cgi-bin/LJ/Browse.pm 2010-11-19 08:22:58 UTC (rev 17733) +++ branches/r72.1/cgi-bin/LJ/Browse.pm 2010-11-19 08:35:42 UTC (rev 17734) @@ -239,11 +239,15 @@ sub load_all { my $class = shift; + my $vertical = shift; my $dbh = LJ::get_db_reader() or die "unable to contact global db slave to load categories"; - my $sth = $dbh->prepare("SELECT * FROM category"); + my $vert_id = $vertical ? $vertical->vert_id : 0; + my $where = " WHERE vert_id = $vert_id "; + + my $sth = $dbh->prepare("SELECT * FROM category" . $where); $sth->execute; die $dbh->errstr if $dbh->err;