Tadashi Okoshi
slash****@users*****
2006年 3月 8日 (水) 15:36:41 JST
Index: affelio/LICENSE-sjis.txt diff -u affelio/LICENSE-sjis.txt:1.1.1.1 affelio/LICENSE-sjis.txt:1.2 --- affelio/LICENSE-sjis.txt:1.1.1.1 Tue Jun 14 12:53:29 2005 +++ affelio/LICENSE-sjis.txt Wed Mar 8 15:36:41 2006 @@ -1,9 +1,11 @@ Affelioã½ããã¦ã§ã¢ã®ã©ã¤ã»ã³ã¹ã«ã¤ã㦠æ¬ã½ããã¦ã§ã¢ã¯ãGPLããã³Affelioã³ãã¼ã·ã£ã«ã©ã¤ã»ã³ã¹ã®ãã¥ã¢ã«ã©ã¤ã»ã³ã¹ -ã§ãã詳ããã¯ãaffelio.jpå ï¼ http://affelio.jp/modules/tinyd5/ ããåç § -ãã ããã +ã§ãã詳ããã¯ãopen.affelio.jpå ï¼ +ãhttp://open.affelio.jp/modules/tinyd5/ ããåç §ãã ããã + +ã³ãã¼ã·ã£ã«ã©ã¤ã»ã³ã¹ãã¼ã¸ã§ã³ã¯ãAffelioæ ªå¼ä¼ç¤¾ http://affelio.jp +ãã販売ãããã¦ããã¾ãã Affelio Project -April 2005 Index: affelio/README-sjis.txt diff -u affelio/README-sjis.txt:1.9 affelio/README-sjis.txt:1.10 --- affelio/README-sjis.txt:1.9 Mon Jul 4 11:31:19 2005 +++ affelio/README-sjis.txt Wed Mar 8 15:36:41 2006 @@ -1,6 +1,14 @@ -Affelio: The Open Social Network +AffelioCore Snapshot + + ±ÌpbP[WÍAAffelioCoreÌXibvVbgÅ·B + JÍ http://open.affelio.jp ÉÄsíêĢܷB + + AffelioCoreÍAèúIÉ"snapshot"ðA.zipÆ.tar.gzÌA[JCu + `®ÉÄAhttp://open.affelio.jp ÉÄzzµÄ¨èÜ·B - Version: 1.0.0 July 4, 2005 + æèÅVÌJo[Wðüè³ê½¢êÍA + http://sourceforge.jp/projects/affelio@É éCVSc[ð + üèµÄ¾³¢B ±Ìo[WÉ¢ÄÌ²Ó @@ -42,7 +50,6 @@ ܽAoOñà½}¢½µÜ·Bhttp://affelio.jp àuoOñv R[i[ÜÅæëµ¨è¢¢½µÜ·B - CXg[v EUnixnWebT[o @@ -57,7 +64,6 @@ DBD::mysql (MySQL4.1È~ðf[^x[XƵÄgp·éê) DBD::SQLite (SQLiteðf[^x[XƵÄgp·éê) - CXg[û@ (1)SÌt@CðFTPÅWebT[oãÉAbv[hµÄ¾³¢B @@ -69,25 +75,25 @@ @ ªJnµÜ·ÌÅAw¦É]ÁÄiñž³¢B ÚµÍȺÌURL𲺳¢Ü¹B - http://affelio.jp/modules/tinyd9/ + http://open.affelio.jp/modules/tinyd9/ g¢û CXg[ãÌAffelioÌg¢ûÉÖµÄÍAAffelio^cTCg - http://affelio.jp àA¶¤Ìj [æèug¢ûvðA²QÆ + http://open.affelio.jp àA¶¤Ìj [æèug¢ûvðA²QÆ º³¢B T|[g T|[gÍAAffelio^cTCgÉÄsÁĨèÜ·BTCgãÌf¦Â ÜÅCyÉANZXµÄ¾³¢B - + http://open.affelio.jp CZXEpKñ AffelioÍAGPL¨æÑAffelioR}[VCZXÌf A CZXÅ·BA{o[WÍGPLo[WÅ·B - CZXEpKñÉÖµÄÚµÍAaffelio.jpà - http://affelio.jp/modules/tinyd5/ ð²Qƾ³¢B + CZXEpKñÉÖµÄÚµÍAopen.affelio.jpà + http://open.affelio.jp/modules/tinyd5/ ð²Qƾ³¢B ì E¤W Index: affelio/README.txt diff -u affelio/README.txt:1.4 affelio/README.txt:1.5 --- affelio/README.txt:1.4 Mon Jul 4 11:09:35 2005 +++ affelio/README.txt Wed Mar 8 15:36:41 2006 @@ -1,8 +1,3 @@ -Affelio: The Open Social Network - - Version: 1.0.0 July 4, 2005 - - Caution! This version is a "RC" (Release Candidate) version of Affelio. Users need to understand following points. Index: affelio/upgrade.cgi diff -u /dev/null affelio/upgrade.cgi:1.5 --- /dev/null Wed Mar 8 15:36:41 2006 +++ affelio/upgrade.cgi Wed Mar 8 15:36:41 2006 @@ -0,0 +1,269 @@ +#!/usr/bin/perl + +use strict; + +use CGI qw(-unique_headers); +use Cwd; +use DBI; +use lib("./extlib"); +use HTML::Template; +use Error qw(:try); +use lib("./lib"); +use Affelio; +use Affelio::misc::Debug qw(debug_print); + +############################################################################ +#Main +############################################################################ +my $g_username=""; +my $g_password=""; +my $g_nickname=""; +my $g_email=""; +my $q = new CGI; +my $g_fsroot = cwd(); +my $g_webroot = $q->self_url(); + +######################################################################### +#1st screen +######################################################################### +if($q->url_param("mode") ne "go"){ + print "Content-type: text/html; charset=UTF-8\n"; + print "Pragma: no-cache", "\n\n"; + print <<EOM; +<HTML> +<h1>Affelio Upgrade Script</h1> +<P> +<H2>1. Copy your affelio.cfg to config/affelio.cfg</H2> +Location of <B>affelio.cfg</B> file changed. Create <B>config/</B> +directory and move <b>affelio.cfg</b> to <B>config/</B> directory. +<P> +<H2>2. Upgrade your Affelio data</H2> +Push the button below and upgrade your data! +<P> +<FORM ACTION="upgrade.cgi?mode=go" method=POST> +<INPUT TYPE="submit" VALUE="Upgrade"> +</FORM> +</HTML> +EOM +exit(1); + + +######################################################################### +#Do upgrade +######################################################################### +}else{ + print "Content-type: text/html; charset=UTF-8\n"; + print "Pragma: no-cache", "\n\n"; + + ################################ + #Start Affelio + ################################ + my $af; + try{ + $af = new Affelio(ConfigDir => "./config/", + Mode => "init"); + }catch Error with{ + my $e = shift; + print("Affelio load error.\n" . $e->stacktrace); + exit(1); + }; + + ################################ + #Create application table + ################################ + { + my $query = 'SELECT * from AFuser_CORE_apps'; + my $sth; + eval{ + $sth = $af->getDB->prepare($query); + $sth->execute; + }; + if($@){ + print "We confirmed that the app table does not exist.<BR>"; + print "So, We will make it<BR>"; + my $query = <<EOT; +CREATE TABLE AFuser_CORE_apps(appid INTEGER PRIMARY KEY AUTOINCREMENT, + install_name TEXT, + install_title TEXT, + app_URI TEXT, + app_name TEXT, + app_version TEXT, + app_desc TEXT, + app_author TEXT, + guest_index TEXT, + owner_index TEXT, + action_types TEXT, + action_types_desc TEXT) +EOT + my $sth; + eval{ + $sth = $af->getDB->prepare($query); + $sth->execute; + }; + if($@){ + print 'Error occured in creating the table<BR><BR>' . $@; + exit(1); + } + + }else{ + #Application table already exists. + #So, do nothing. + print 'We confirmed that the app table already exists.<BR>'; + print 'So, We will do nothing.<BR>'; + } + }#block + + ################################ + #Create nghr_news + ################################ + { + my $query = 'SELECT * from AFuser_CORE_nghr_news'; + my $sth; + eval{ + $sth = $af->getDB->prepare($query); + $sth->execute; + }; + if($@){ + print "We confirmed that nghr_news table does not exist.<BR>"; + print "So, We will make it<BR>"; + my $query = <<EOT; +CREATE TABLE AFuser_CORE_nghr_news(nid INTEGER PRIMARY KEY AUTOINCREMENT, + datetime INTEGER, + af_id TEXT, + nickname TEXT, + app_install_name TEXT, + title TEXT, + description TEXT, + creator TEXT, + URL TEXT) +EOT + my $sth; + eval{ + $sth = $af->getDB->prepare($query); + $sth->execute; + }; + if($@){ + print 'Error occured in creating the table<BR><BR>' . $@; + exit(1); + } + + }else{ + #Application table already exists. + #So, do nothing. + print 'We confirmed that nghr_news table already exists.<BR>'; + print 'So, We will do nothing.<BR>'; + } + }#block + + ################################ + #Create my_news + ################################ + { + my $query = 'SELECT * from AFuser_CORE_my_news'; + my $sth; + eval{ + $sth = $af->getDB->prepare($query); + $sth->execute; + }; + if($@){ + print "We confirmed that my_news table does not exist.<BR>"; + print "So, We will make it<BR>"; + my $query = <<EOT; +CREATE TABLE AFuser_CORE_my_news(nid INTEGER PRIMARY KEY AUTOINCREMENT, + datetime INTEGER, + app_install_name TEXT, + title TEXT, + description TEXT, + creator TEXT, + URL TEXT) +EOT + my $sth; + eval{ + $sth = $af->getDB->prepare($query); + $sth->execute; + }; + if($@){ + print 'Error occured in creating the table<BR><BR>' . $@; + exit(1); + } + + }else{ + #Application table already exists. + #So, do nothing. + print 'We confirmed that my_news table already exists.<BR>'; + print 'So, We will do nothing.<BR>'; + } + }#block + + ################################ + #Add columns to friend tale + ################################ + add_column($af, 'AFuser_CORE_friends', 'last_news_in', "INTEGER", 0); + add_column($af, 'AFuser_CORE_friends', 'last_news_out', "INTEGER", 0); + # + add_column($af, 'AFuser_CORE_friends', 'last_access', "INTEGER", 0); + add_column($af, 'AFuser_CORE_friends', 'count_access', "INTEGER", 0); + # + add_column($af, 'AFuser_CORE_friends', 'last_incoming', "INTEGER", 0); + add_column($af, 'AFuser_CORE_friends', 'count_incoming', "INTEGER", 0); + # + add_column($af, 'AFuser_CORE_friends', 'last_outgoing', "INTEGER", 0); + add_column($af, 'AFuser_CORE_friends', 'count_outgoing', "INTEGER", 0); + # + add_column($af, 'AFuser_CORE_friends', 'apps', "TEXT", "' '"); + + ################################ + #Create small images + ################################ + print "We will make resized profile images..."; + eval{ + require Affelio::misc::ImageEditor; + Affelio::misc::ImageEditor::resize_image("$af->{site__user_dir}/profile_face.jpg", "$af->{site__user_dir}/profile_face_100x100.jpg", 100); + Affelio::misc::ImageEditor::resize_image("$af->{site__user_dir}/profile_face.jpg", "$af->{site__user_dir}/profile_face_150x150.jpg", 150); + }; + if($@){ + print 'Error occured in creating resized images...<BR><BR>' . $@; + exit(1); + } + + print "Done.<BR>"; + + print '<h2>OK. Successfuly done.</H2><P><B>Delete this CGI immediately!!</B>'; + exit(1); +} + + + +sub add_column{ + my $af= shift; + my $table = shift; + my $col = shift; + my $type = shift; + my $def = shift; + + my $query = "SELECT $col from $table"; + my $sth; + eval{ + $sth = $af->getDB->prepare($query); + $sth->execute; + }; + if($@){ + print "We confirmed that table [$table] needs column [$col]<BR>"; + my $query2 = "ALTER TABLE $table ADD COLUMN $col $type DEFAULT $def"; + my $sth; + eval{ + $af->getDB->do($query2); + }; + if($@){ + print 'Error occured in modifying the table<BR><BR>' . $@; + exit(1); + } + print "Successfully added [$col].<BR>"; + + }else{ + #Application table already exists. + #So, do nothing. + print "We confirmed that table [$table] already has [$col]<BR>"; + print 'So, We will do nothing.<BR>'; + } +}