[Affelio-cvs 780] CVS update: affelio/apps/Mixi

Back to archive index

Tadashi Okoshi slash****@users*****
2005年 11月 21日 (月) 03:54:46 JST


Index: affelio/apps/Mixi/README
diff -u affelio/apps/Mixi/README:1.2 affelio/apps/Mixi/README:1.3
--- affelio/apps/Mixi/README:1.2	Fri Jul  1 11:16:34 2005
+++ affelio/apps/Mixi/README	Mon Nov 21 03:54:46 2005
@@ -3,6 +3,8 @@
 Install
 	1. Put this "Mixi" directory under "apps" directory in your Affelio.
 
+	2. From owner-mode menu, choose "Config Apps".
+	   Install this application from the menu.
 
 Configuration
 	1. Go to "Mixi" application tab.
Index: affelio/apps/Mixi/index.cgi
diff -u affelio/apps/Mixi/index.cgi:1.6 affelio/apps/Mixi/index.cgi:1.7
--- affelio/apps/Mixi/index.cgi:1.6	Fri Jul  1 01:26:41 2005
+++ affelio/apps/Mixi/index.cgi	Mon Nov 21 03:54:46 2005
@@ -1,36 +1,37 @@
 #!/usr/bin/perl
 
-use lib("./extlib/");  #WWW:Mixi
-use WWW::Mixi;
-
+#AFFELIOディレクトリにある外部モジュール
 use lib("../../extlib");  #general
 use HTML::Template;
 use CGI;
 use Cwd;
 use Jcode;
-#
+
+#AffelioAPI利用のため
 use lib("../../lib");  #Affelio
 use AffelioApp;
 use Affelio::misc::CGIError;
-#
-use lib("./extlib/");  #WWW:Mixi
+
+#本アプリ以下のモジュール
+use lib("./extlib/");
 use WWW::Mixi;
 use HTTP::Cookies;
 use HTTP::Request::Common;
-#
 use lib("./lib/"); 
 use AffelioApp::SNSGateway;
 
 ###########################################################################
-#init
+#初期化
 ###########################################################################
 my $cgi = new CGI();
+my $page = $cgi->url_param("page");
 
-#AffelioAppを初期化
+#######################
+#Affelio APIを初期化
+#######################
 my $afap = new AffelioApp(ConfigDir => Cwd::getcwd(),
 			  cgi => $cgi);
 
-my $page = $cgi->url_param("page");
 
 ###########################################################################
 #Output
@@ -39,10 +40,14 @@
 print "Content-type: text/html; charset=UTF-8\n";
 print "Pragma: no-cache", "\n\n"; 
 
+#######################
 #HTML Header Partを出力
+#######################
 print $afap->get_HTML_header("Affelio Mixi Gateway");
 
-# 読み込みアクセス権限をチェックし、内容表示
+#######################
+# 読み込みアクセス権限をチェック
+#######################
 unless ($afap->check_access("DF_access")) {
     print "あなたにはこのページの読み込み権限がありません";
     
@@ -52,16 +57,21 @@
     exit(1);
 }
 
+#######################
+#アクセスユーザのユーザタイプを取得
+#######################
+my $visitor_type = $afap->get_visitor_info("type");
+
+
 ###########################################################################
-#Read configuration file
+#設定ファイルを読み込む
 ###########################################################################
+#Mixiへの認証情報が保存されているconfigファイルを読み込む
 my $userinfo = read_config($afap);
 
-my $visitor_type = $afap->get_visitor_info("type");
-
 
 ###########################################################################
-#Retrieve Mixi HTML
+#MixiのHTMLを取得
 ###########################################################################
 my $err_mesg="";
 
@@ -90,7 +100,6 @@
 if(!($response->is_success)){
     err_exit("Could not get list_friend.pl");
 }
-#print "<PRE>" . $response->content . "</PRE>";
 
 #Parse
 my @friends = $mixi->parse_list_friend( $response );
@@ -102,7 +111,7 @@
 }
 
 ###########################################################################
-#Processing
+#HTML取得後の処理
 ###########################################################################
 $num_friends = @friends;
 
@@ -117,9 +126,6 @@
     }
 } 
 
-
-
-
 my $next_message="";
 my $next_link="";
 my $next = $mixi->parse_list_friend_next( $response );
@@ -138,7 +144,13 @@
     $prev_link = "./index.cgi?page=$2";
 }
 
+###########################################################################
+#画面を出力
+###########################################################################
 
+###############################
+#HTML::Templateã‚’èµ·å‹•
+###############################
 my $tmpl = HTML::Template->new(filename => "./templates/index.tmpl",
 			       die_on_bad_params => 0);
 
@@ -151,14 +163,20 @@
 $tmpl->param(prev_link => $prev_link);
 $tmpl->param(prev_message => $prev_message);
 
+###############################
+#アプリ本体のHTML出力
+###############################
 print $tmpl->output;
 
+###############################
 #HTML Footer Partを出力
+###############################
 print $afap->get_HTML_footer();
 
 exit(1);
 
 
+##########################################################################
 sub err_exit{
     my $err_mesg = shift;
 
@@ -174,3 +192,4 @@
     print $afap->get_HTML_footer();
     exit(1);
 }
+##########################################################################


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