fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-02-04 04:30 am

[dw-free] similar interest search doesn't support communities

[commit: http://hg.dwscoalition.org/dw-free/rev/2ee7fedfe5d6]

http://bugs.dwscoalition.org/show_bug.cgi?id=3436

Allow you to find users with interests similar to $community_name.

Patch by [personal profile] kareila.

Files modified:
  • cgi-bin/DW/Controller/Search/Interests.pm
--------------------------------------------------------------------------------
diff -r 274654be3959 -r 2ee7fedfe5d6 cgi-bin/DW/Controller/Search/Interests.pm
--- a/cgi-bin/DW/Controller/Search/Interests.pm	Fri Feb 04 11:34:24 2011 +0800
+++ b/cgi-bin/DW/Controller/Search/Interests.pm	Fri Feb 04 12:28:21 2011 +0800
@@ -122,10 +122,11 @@ sub interest_handler {
             unless $rv->{can_use_findsim};
         my $u = LJ::load_user( $args->{user} )
             or return error_ml( 'error.username_notfound' );
+        my $uitable = $u->is_comm ? 'comminterests' : 'userinterests';
 
         my $dbr = LJ::get_db_reader();
         my $sth = $dbr->prepare( "SELECT i.intid, i.intcount " .
-                                 "FROM userinterests ui, interests i " .
+                                 "FROM $uitable ui, interests i " .
                                  "WHERE ui.userid=? AND ui.intid=i.intid" );
         $sth->execute( $u->userid );
 
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org