wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r20462: LJSUP-10255: Community directory: Report...

Committer: gprochaev
LJSUP-10255: Community directory: Reports

U   trunk/cgi-bin/LJ/Browse.pm
Modified: trunk/cgi-bin/LJ/Browse.pm
===================================================================
--- trunk/cgi-bin/LJ/Browse.pm	2011-11-01 09:31:39 UTC (rev 20461)
+++ trunk/cgi-bin/LJ/Browse.pm	2011-11-01 10:56:36 UTC (rev 20462)
@@ -1146,6 +1146,20 @@
     return 1;
 }
 
+sub categories_by_comm {
+    my $class = shift;
+    my $comm  = shift;
+    
+    return unless $comm;
+    
+    my $dbh = LJ::get_db_reader();
+    my $cats = $dbh->selectcol_arrayref("SELECT catid FROM categoryjournals WHERE journalid = ?", undef, $comm->userid);
+
+    return map {
+        LJ::Browse->load_by_id($_);
+    } @$cats;
+}
+
 ## Return "path" for selected category
 ## catobj -> par_catobj -> par_par_catobj -> etc... (array)
 ## Param: arrayref to save "path"

Tags: gprochaev, livejournal, pm, wisest-owl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments