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

[livejournal] r17859: LJSUP-7453. Search don't work

Committer: gprochaev
LJSUP-7453. Search don't work

U   trunk/cgi-bin/LJ/Browse.pm
U   trunk/htdocs/admin/browse/add_community.bml
U   trunk/htdocs/admin/browse/featured_communities.bml
U   trunk/htdocs/admin/browse/load_all_structure.bml
Modified: trunk/cgi-bin/LJ/Browse.pm
===================================================================
--- trunk/cgi-bin/LJ/Browse.pm	2010-12-03 07:36:10 UTC (rev 17858)
+++ trunk/cgi-bin/LJ/Browse.pm	2010-12-03 10:49:38 UTC (rev 17859)
@@ -1004,8 +1004,11 @@
 sub add_community {
     my $self = shift;
     my $uid  = shift;
-    my $tags = shift;
+    my $opts = shift;
 
+    my $tags             = $opts->{'tags'};
+    my $not_need_approve = $opts->{'not_need_approve'} || 0;
+
     my $dbh = LJ::get_db_writer()
         or die "unable to contact global db master to create category";
 
@@ -1016,7 +1019,8 @@
 
     LJ::Browse->add_approved_community( comm  => LJ::want_user($uid),
                                         mod_u => LJ::get_remote(),
-                                        catid => $self->catid, );
+                                        catid => $self->catid, )
+        unless $not_need_approve;
 
     $self->clear_journals_memcache;
 

Modified: trunk/htdocs/admin/browse/add_community.bml
===================================================================
--- trunk/htdocs/admin/browse/add_community.bml	2010-12-03 07:36:10 UTC (rev 17858)
+++ trunk/htdocs/admin/browse/add_community.bml	2010-12-03 10:49:38 UTC (rev 17859)
@@ -54,7 +54,7 @@
             next if @errors;
 
             # Add journal to category
-            if ($category->add_community($uid, \@tags)) {
+            if ($category->add_community($uid, { tags => \@tags, not_need_approve => 1 })) {
                 $ret .= "<span class='super notice'>Communities successfully added to category.</span>";
             } else {
                 $ret .= "<span class='super notice'>Communities not added.</span>";

Modified: trunk/htdocs/admin/browse/featured_communities.bml
===================================================================
--- trunk/htdocs/admin/browse/featured_communities.bml	2010-12-03 07:36:10 UTC (rev 17858)
+++ trunk/htdocs/admin/browse/featured_communities.bml	2010-12-03 10:49:38 UTC (rev 17859)
@@ -94,13 +94,14 @@
             my $c = LJ::load_userid($comm->{journalid});
             next unless $c;
             my $userpic = $c->userpic;
-            my $descr = $c->prop('comm_theme') || '';
+            my $descr = $c->prop('comm_theme') || $c->{'name'};
             my $descr_trimmed = LJ::html_trim($descr, 50);
             push @top_comms, {
                 username        => $c->display_name,
                 userpic         => $userpic ? $userpic->url : '',
                 community       => $c->user,
                 bio             => $descr_trimmed,
+                ljuser          => LJ::ljuser($c->user),
                 is_subtitle_trimmed => $descr ne $descr_trimmed ? 1 : 0,
             };
         }

Modified: trunk/htdocs/admin/browse/load_all_structure.bml
===================================================================
--- trunk/htdocs/admin/browse/load_all_structure.bml	2010-12-03 07:36:10 UTC (rev 17858)
+++ trunk/htdocs/admin/browse/load_all_structure.bml	2010-12-03 10:49:38 UTC (rev 17859)
@@ -78,7 +78,7 @@
             my $subcat_url = $columns[6];
 
             if ($subcat_name && $subcat_url) {
-                my $subcat = LJ::Browse->load_by_url ("/browse" . $cat->url_path . $subcat_url, $v);
+                $subcat = LJ::Browse->load_by_url ("/browse" . $cat->url_path . $subcat_url, $v);
                 unless ($subcat) {
                     $subcat = LJ::Browse->create ( pretty_name => $subcat_name, url_path => $subcat_url, parentcatid => $cat->catid, vertical => $cat->vertical );
                 }
@@ -91,7 +91,7 @@
             ## #7 - Full path for sanity check 
 
             ## Tags for community
-            my $comm_tags = $columns[8];
+            my $comm_tags = $subcat_name ? $columns[8] : $columns[7];
             my @tags = split /,\s*/, $comm_tags;
 
             my $comm_id = LJ::get_userid($comm_name);
@@ -103,8 +103,8 @@
             }
 
             my $is_add = $subcat
-                ? $subcat->add_community($comm_id, \@tags)
-                : $cat->add_community($comm_id, \@tags);
+                ? $subcat->add_community($comm_id, { tags => \@tags, not_need_approve => 1 })
+                : $cat->add_community($comm_id, { tags => \@tags, not_need_approve => 1 });
 
         }
     }

Tags: bml, 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