[Affelio-cvs 1425] CVS update: affelio/lib/Affelio/SNS

Back to archive index

Tadashi Okoshi slash****@users*****
2006年 8月 15日 (火) 00:40:37 JST


Index: affelio/lib/Affelio/SNS/FriendManager.pm
diff -u affelio/lib/Affelio/SNS/FriendManager.pm:1.28 affelio/lib/Affelio/SNS/FriendManager.pm:1.29
--- affelio/lib/Affelio/SNS/FriendManager.pm:1.28	Thu Jun 29 03:12:49 2006
+++ affelio/lib/Affelio/SNS/FriendManager.pm	Tue Aug 15 00:40:37 2006
@@ -14,7 +14,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #
-# $Id: FriendManager.pm,v 1.28 2006/06/28 18:12:49 slash5234 Exp $
+# $Id: FriendManager.pm,v 1.29 2006/08/14 15:40:37 slash5234 Exp $
 
 package Affelio::SNS::FriendManager;
 {
@@ -597,30 +597,33 @@
 	debug_print("FM::get_all_friend_list: type  = $param{type}");
 
 	my $af = $self->{af};
-	my $where = $param{where};
 	my $sort = $param{sort};
 	if($sort eq ""){ $sort = "uid";}
 	my $order = $param{order};
 	if($order eq ""){ $order = "asc";}
-	my $where_block ="";
-	if($where ne ""){ $where_block = "WHERE $where";}
+	my $where_block = $param{where};
 	my $type = $param{type};
+
+
 	if($type eq "ANY"){
 	    #Do nothing
 	}elsif($type ne ""){
-	    if($where_block ne ""){
-		$where_block = "$where_block or af_type = '$type' ";
+	    if($where_block eq ""){
+		$where_block = " af_type = '$type' ";
 	    }else{
-		$where_block = "WHERE af_type = '$type' ";
+		$where_block = " ($where_block) AND af_type = '$type' ";
 	    }
 	}else{
 	    #In case type="", we assume type="Personal or Standalone"
-	    if($where_block ne ""){
-		$where_block = "$where_block or af_type = 'Personal' or af_type = 'Standalone'  or af_type = '' or af_type IS NULL ";
+	    if($where_block eq ""){
+		$where_block = " (af_type = 'Personal' or af_type = 'Standalone' or af_type= '' or af_type IS NULL) ";
 	    }else{
-		$where_block = "WHERE af_type = 'Personal' or af_type = 'Standalone' or af_type= '' or af_type IS NULL ";
+		$where_block = " ($where_block) AND (af_type = 'Personal' or af_type = 'Standalone'  or af_type = '' or af_type IS NULL) ";
 	    }
+	}
 
+	if($where_block ne ""){
+	    $where_block = "WHERE $where_block";
 	}
 
 	##############################


Affelio-cvs メーリングリストの案内
Back to archive index