ず's WiLiKi

WiLiKi/trackback




TrackBack


tb-standalone の修正

--- tb.cgi.orig Wed Feb 18 00:45:08 2004
+++ tb.cgi      Fri Jul  8 17:24:48 2005
@@ -26,6 +26,22 @@
 
 charset $Charset;
 
+my $i;
+if (open(FH, ">> /tmp/trackback.log")) {
+       print FH "trackback log\n";
+       foreach $i (sort keys %ENV) {
+               print FH "ENV:$i:",$ENV{$i},"\n";
+       }
+       print FH "----\n";
+       print FH "__mode:",param('__mode'),"\n";
+       print FH "title:",param('title'),"\n";
+       print FH "excerpt:",param('excerpt'),"\n";
+       print FH "url:",param('url'),"\n";
+       print FH "blog_name:",param('blog_name'),"\n";
+       print FH "----\n\n\n";
+       close FH;
+}
+
 my $mode = param('__mode');
 unless ($mode) {
     my $tb_id = munge_tb_id(get_tb_id());
@@ -44,6 +60,12 @@
     if ($NotifyEmail) {
        notify_email($NotifyEmail, $i, $tb_id);
     }
+# from here
+    if (open(FH, ">" . catfile($DataDir, $tb_id . '.js'))) {
+       print FH "document.write('(@{[scalar(grep {$_} @$data)]})');\n";
+       close FH; # 追加
+    }
+# to here
     respond_exit();
 } elsif ($mode eq 'list') {
     my $tb_id = munge_tb_id(get_tb_id());
@@ -120,7 +142,7 @@
     my($e, $msg) = $res->content =~ m!<error>(\d+).*<message>(.+?)</message>!s;
     $e ? ping_form_exit("Error: $msg") : ping_form_exit("Ping successfuly sent"
);
 } elsif ($mode eq 'send_form') {
-    ping_form_exit();
+    ping_form_exit2(param('message'));
 } elsif ($mode eq 'login') {
     print header(), login_form();
 } elsif ($mode eq 'do_login') {
@@ -232,15 +254,20 @@
 }
 
 sub ping_form_exit {
+    my $message = encode_url("@_");
+    print redirect(url() . "?__mode=send_form&message=$message");
+}
+
+sub ping_form_exit2 {
     print header(), from_file($Header);
-    print "@_" if @_;
+    print escapeHTML("@_") if @_;
     print <<HTML;
 <h2>Send a TrackBack ping</h2>
 <form method="post"><input type="hidden" name="__mode" value="send_ping" />
 <table border="0" cellspacing="3" cellpadding="0">
 <tr><td>TrackBack Ping URL:</td><td><input name="ping_url" size="60" /></td></t
r>
 <tr><td>&nbsp;</td></tr>
-<tr><td>Title:</td><td><input name="title" size="35" /></td></tr>
+<tr><td>Title:</td><td><input name="title" size="60" /></td></tr>
 <tr><td>Blog name:</td><td><input name="blog_name" size="35" /></td></tr>
 <tr><td>Excerpt:</td><td><input name="excerpt" size="60" /></td></tr>
 <tr><td>Permalink URL:</td><td><input name="url" size="60" /></td></tr>




[トップ] / [最近の更新] [一覧] / [RSS] / [お問い合わせ・情報提供]

本サイトはAmazonアソシエイト等のアフィリエイトサービスを利用しています
running on WiLiKi and Gauche