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

Back to archive index

Tadashi Okoshi slash****@users*****
2006年 6月 1日 (木) 21:50:45 JST


Index: affelio/lib/Affelio/SNS/FriendManager.pm
diff -u affelio/lib/Affelio/SNS/FriendManager.pm:1.22 affelio/lib/Affelio/SNS/FriendManager.pm:1.23
--- affelio/lib/Affelio/SNS/FriendManager.pm:1.22	Thu Jun  1 15:34:13 2006
+++ affelio/lib/Affelio/SNS/FriendManager.pm	Thu Jun  1 21:50:45 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.22 2006/06/01 06:34:13 slash5234 Exp $
+# $Id: FriendManager.pm,v 1.23 2006/06/01 12:50:45 slash5234 Exp $
 
 package Affelio::SNS::FriendManager;
 {
@@ -582,18 +582,31 @@
 	my $self = shift;
 	my %param = @_;
 
+	debug_print("FM::get_all_friend_list: where = $param{where}");
+	debug_print("FM::get_all_friend_list: sort  = $param{sort}");
+	debug_print("FM::get_all_friend_list: order = $param{order}");
+	debug_print("FM::get_all_friend_list: type  = $param{type}");
+
 	my $af = $self->{af};
 	my $where = $param{where};
-	my $where_block ="";
-	if($where ne ""){ $where_block = "WHERE $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 $type = $param{type};
+	if($type ne ""){
+	    if($where_block ne ""){
+		$where_block = "$where_block or af_type = '$type' ";
+	    }else{
+		$where_block = "WHERE af_type = '$type' ";
+	    }
+	}
 
 	##############################
 	#retrieve all friend records from DB
-	my $query = "SELECT uid, af_id, nickname, timestamp, password, intro, option_pid, lastupdated, f2list, last_news_in, last_news_out FROM $af->{site__dbtbl_prefix}_CORE_friends  $where_block  order by $sort $order";
+	my $query = "SELECT uid, af_id, nickname, timestamp, password, intro, option_pid, lastupdated, f2list, last_news_in, last_news_out FROM $af->{site__dbtbl_prefix}_CORE_friends  $where_block order by $sort $order";
 	debug_print("FM::get_all_friend_list: query=[$query]");
 	my $sth;
 	eval{


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