[Affelio-cvs 1317] CVS update: affelio/lib/Affelio/Managing

Back to archive index

Yoshihisa Fukuhara higef****@users*****
2006年 6月 3日 (土) 13:00:35 JST


Index: affelio/lib/Affelio/Managing/NewsAggregator.pm
diff -u affelio/lib/Affelio/Managing/NewsAggregator.pm:1.19 affelio/lib/Affelio/Managing/NewsAggregator.pm:1.20
--- affelio/lib/Affelio/Managing/NewsAggregator.pm:1.19	Fri Jun  2 18:55:51 2006
+++ affelio/lib/Affelio/Managing/NewsAggregator.pm	Sat Jun  3 13:00:35 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: NewsAggregator.pm,v 1.19 2006/06/02 09:55:51 slash5234 Exp $
+# $Id: NewsAggregator.pm,v 1.20 2006/06/03 04:00:35 higefuku Exp $
 
 package Affelio::Managing::NewsAggregator;
 {
@@ -99,6 +99,39 @@
 	return($sth);
     }
 
+    #######################################################################
+    #retrieve_ajax_news
+    #######################################################################
+    sub retrieve_ajax_news{
+	my $self = shift;
+	my $sort = shift;
+	my $num = shift;
+	my $af = $self->{af}; 
+
+	debug_print("NewsAggregator::retrieve_ajax_news: start.");
+
+	##############################
+	#retrieve all friend records from DB
+	my $query = "SELECT datetime, af_id, nickname, app_install_name, title, description, creator, URL FROM $af->{site__dbtbl_prefix}_CORE_nghr_news order by";
+	if ($sort eq "user"){
+	    $query .= " nickname, app_install_name,";
+	}elsif($sort eq "subject"){
+	    $query .= " title,";
+	}
+	$query.= " datetime desc limit $num , 10";
+	my $sth;
+	eval{
+	    $sth = $af->getDB->prepare($query);
+	    $sth->execute();
+	};
+	if($@){
+	    throw Affelio::exception::DBException($af->getDB->errstr);
+	}
+	
+	debug_print("NewsAggregator::retrieve_ajax_news: end.");
+	return($sth);
+    }
+
 
     #######################################################################
     #get_one


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