掲示板の解説


  dispsource.pl




  


sub DspSource {
# ******************************************************************************
# ソースの表示
# ******************************************************************************

print( "<a name=stop></a>\n" );

local($open) = "http://tohoho.wakusei.ne.jp/wwwperl2.htm#open";
local($here_document) = "http://tohoho.wakusei.ne.jp/wwwperl1.htm#EOF";
local($file_test) = "http://flex.ee.uec.ac.jp/texi/perl/perl_22.html#SEC41";
local($file_read) = "http://tohoho.wakusei.ne.jp/wwwperl1.htm#InputFile";
local($unshift) = "http://tohoho.wakusei.ne.jp/wwwperl2.htm#unshift";

local($unless) = "http://tohoho.wakusei.ne.jp/wwwperl1.htm#unless";
local($split) = "http://flex.ee.uec.ac.jp/texi/perl/perl_56.html#SEC91";
local($shift) = "http://flex.ee.uec.ac.jp/texi/perl/perl_53.html#SEC88";

local($style) = "font-weight:bold;font-size:18";
local($headstyle) = "line-height:2;border-style:outset;background-color:skyblue";
local($headbutton) = "&nbsp;&nbsp;&nbsp;<input type=button value='戻る' onClick='history.back();'>";

print "<hr size=1 color=black>\n";
print "<pre>\n";

open( IN, "light.cgi" );
while (<IN>) {


	$_ =~ s/\"/&quot&/g;
	$_ =~ s/</&lt&/g;
	$_ =~ s/>/&gt&/g;
	$_ =~ s/&lt;/&lt&/g;
	$_ =~ s/&gt;/&gt&/g;
	$_ =~ s/&quot;/&quot&/g;

	$_ =~ s/open\(/<a href='$open' style='$style'>open<\/a>\(/g;
	$_ =~ s/print &lt;&lt;/<a href='$here_document' style='$style'>print &lt;&lt;<\/a>/g;
	$_ =~ s/-e/<a href='$file_test' style='$style'>-e<\/a>/g;
	$_ =~ s/@[A-Za-z0-9_]*\s*=\s*&lt;[A-Za-z0-9_]*&gt;/<a href='$file_read' style='$style'>$&<\/a>/g;
	$_ =~ s/unshift\s*\(/<a href='$unshift' style='$style'>unshift<\/a>\(/g;

	$_ =~ s/(unless)\s*\(/<a href='$unless' style='$style'>$1<\/a>\(/g;
	$_ =~ s/(split)\s*\(/<a href='$split' style='$style'>$1<\/a>\(/g;
	$_ =~ s/(shift)\s*\(/<a href='$shift' style='$style'>$1<\/a>\(/g;

	$_ =~ s/sub\s*([A-Za-z0-9_]*)\s*\{/<a name=$1><\/a><h4 style='$headstyle'>&nbsp;&nbsp;sub $1 {$headbutton<\/h4>/g;

	$_ =~ s/&nbsp;/&nbsp&/g;

	$_ =~ s/&([A-Za-z0-9_]+);/<a href='#$1' style='$style'>&$1;<\/a>/g;

	$_ =~ s/&quot&/&quot;/g;
	$_ =~ s/&lt&/&lt;/g;
	$_ =~ s/&gt&/&gt;/g;
	$_ =~ s/&nbsp&/&nbsp;/g;

	print $_;
}

close( IN );
print "</pre>\n";

}

1;
  







  ソースを改造 (1)




  

## LIGHT BOARDのメイン処理
&decode;
#if ($mode eq "howto") { &howto; }
#elsif ($mode eq "find") { &find; }
#elsif ($mode eq "usr_del") { &usr_del; }
#elsif ($mode eq "msg") { &reg;ist; }
#&html_log;

	&get_agent;
	open(LOG,"$logfile") || &error("Can't open $logfile");
	@lines = <LOG>;
	close(LOG);
	$init = $lines[0];
	($head,$title,$t_color,$t_size,$t_face,$bgr,$bgc,$text,$link,
		$vlink,$alink,$home,$max,$subj_color,$name_color,$mail1,$mail2)
								 = split(/<>/,$init);
	shift(@lines);
	&header;

print <<HTML;
<center><font color=$t_color size=$t_size face=$t_face>
<b>$title</b></font><hr width='90%' size=2>
[<a href=$home target=_top>トップにもどる</a>]
[<a href=$script?mode=howto>掲示板の使い方</a>]
[<a href=$script?mode=find>ワード検索</a>]
<hr width=90% size=2></center>
<form method="$method" action="$script">
<input type=hidden name=mode value="msg">
<blockquote><table border=0>
<tr><td nowrap><b>おなまえ</b></td>
<td><input type=text name=name size="$nam_wid" value="$c_name"></td></tr>
<tr><td nowrap><b>Eメール</b></td>
<td><input type=text name=email size="$nam_wid" value="$c_email"></td></tr>
<tr><td nowrap><b>題  名</b></td>
<td><input type=text name=sub size="$subj_wid" value=\"$res_sub\">
 <input type=submit value="投稿する"><input type=reset value="リセット"></td></tr>
<tr><td colspan=2><b>コメント</b><br>
<TEXTAREA cols="$com_wid" rows=7 name=comment wrap="$wrap">$res_comment</TEXTAREA></td></tr>
<tr><td nowrap><b>URL</b></td>
<td><input type=text size="$url_wid" name=url value="http://$c_url"></td></tr>
<tr><td nowrap><b>削除キー</b></td>
<td><input type=password name=pwd size=8 maxlength=8 value="$c_pwd">
<small>(記事削除時に使用。英数字で8文字以内)</small></td></tr>
</table></form></blockquote><hr>
HTML

	while (($key,$val) = each %FORM ) {
		print "$key = $val<br>\n";
	}

  


  ソースを改造 (2)

  

#============#
#  設定完了  #
#============#

## LIGHT BOARDのメイン処理

	&decode;
	&get_agent;

	open(LOG,"$logfile") || &error("Can't open $logfile");
	@lines = <LOG>;
	close(LOG);

	$init = $lines[0];
	($head,$title,$t_color,$t_size,$t_face,$bgr,$bgc,$text,$link,
		$vlink,$alink,$home,$max,$subj_color,$name_color,$mail1,$mail2)
								 = split(/<>/,$init);
	shift(@lines);
	&header;

require './gamen.pl';

#=================================================
	print '入力データの表示<br>' . "\n";
	while (($key,$val) = each %FORM ) {
		print "$key = $val<br>\n";
	}
	print "<hr>\n";

#=================================================
	print '$lines[0]の表示<br>' . "\n";
	print "$init\n";
	print "<hr>\n";

#=================================================
	print '中身の表示<br>' . "\n";
	@work = split(/<>/,$init);
	foreach $target ( @work ) {
		print "$target<br>\n";
	}
	print "<hr>\n";

#=================================================
	unshift(@lines,"$FORM{'name'}<>$FORM{'email'}<>$FORM{'sub'}<>$FORM{'comment'}<>$FORM{'url'}<>$FORM{'pwd'}<>\n");
	unshift(@lines,$init);

#=================================================
	open(LOG,">$logfile") || &error("Can't write $logfile");
	print LOG @lines;
	close(LOG);

#=================================================
	print "入力データを書き込みました<br>\n";
  

  ソースを改造 (3)

  

#=================================================
	$comment = $FORM{'comment'};
	$comment =~ s/\r\n/<br>/g;
	$comment =~ s/\r/<br>/g;
	$comment =~ s/\n/<br>/g;
	unshift(@lines,"$FORM{'name'}<>$FORM{'email'}<>$FORM{'sub'}<>$comment<>$FORM{'url'}<>$FORM{'pwd'}<>\n");
	unshift(@lines,$init);
  

  ソースを改造 (4)

  

#=================================================
	print "入力データを書き込みました<br>\n";

	open(LOG,"$logfile") || &error("Can't open $logfile");
	@lines = <LOG>;
	close(LOG);

	shift(@lines);
	foreach $target (@lines) {
		($name,$email,$subj,$comment,$url,$pwd)
						 = split(/<>/,$target);

		print "<table border=0 cellpadding=0 cellspacing=0><tr>\n";
		print "<td valign=top><font color=$subj_color><b>$subj</b></font> ";
		print "投稿者:<font color=$name_color><b>$name</b></font> ";
		print "<small>投稿日:$date</small></td><td> </td>\n";
		print "<td valign='top'><form action=$script method=$method>\n";
		print "<input type=submit value=返信>\n";
		print "<input type=hidden name=mode value=res>\n";
		print "<input type=hidden name=resmode value=$number>\n";
		print "</td></form></tr></table>\n";
		print "<blockquote>$comment<P>$url</blockquote><hr>\n";

	}

  

  ソースを改造 (5)

  

if ($mode eq "msg") {
#=================================================
	open(LOG,">$logfile") || &error("Can't write $logfile");
	print LOG @lines;
	close(LOG);

#=================================================
	print "入力データを書き込みました<br>\n";
}
  

  ソースを改造 (6)

  

	shift(@lines);
	foreach $target (@lines) {
		($name,$email,$subj,$comment,$url,$pwd)
						 = split(/<>/,$target);
		&print_log;

	}

sub print_log {
	print "<table border=0 cellpadding=0 cellspacing=0><tr>\n";
	print "<td valign=top><font color=$subj_color><b>$subj</b></font> ";
	print "投稿者:<font color=$name_color><b>$name</b></font> ";
	print "<small>投稿日:$date</small></td><td> </td>\n";
	print "<td valign='top'><form action=$script method=$method>\n";
	print "<input type=submit value=返信>\n";
	print "<input type=hidden name=mode value=res>\n";
	print "<input type=hidden name=resmode value=$number>\n";
	print "</td></form></tr></table>\n";
	print "<blockquote>$comment<P>$url</blockquote><hr>\n";
}
  




yahoo  google  MSDN  MSDN(us)  WinFAQ  Win Howto  tohoho  ie_DHTML  vector  wdic  辞書  天気 


[sperl]
Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
24/04/19 20:24:52
InfoBoard Version 1.00 : Language=Perl

1 BatchHelper COMprog CommonSpec Cprog CprogBase CprogSAMPLE CprogSTD CprogSTD2 CprogWinsock Cygwin GameScript HTML HTMLcss InstallShield InstallShieldFunc JScript JScriptSAMPLE Jsfuncs LLINK OldProg OracleGold OracleSilver PRO PRObrowser PROc PROconePOINT PROcontrol PROftpclient PROjscript PROmailer PROperl PROperlCHAT PROphp PROphpLesson PROphpLesson2 PROphpLesson3 PROphpfunction PROphpfunctionArray PROphpfunctionMisc PROphpfunctionString PROsql PROvb PROvbFunction PROvbString PROvbdbmtn PROvbonepoint PROwebapp PROwin1POINT PROwinSYSTEM PROwinYOROZU PROwindows ProjectBoard RealPHP ScriptAPP ScriptMaster VBRealtime Vsfuncs a1root access accreq adsi ajax amazon argus asp aspSample aspVarious aspdotnet aw2kinst cappvariety centura ckeyword classStyle cmaterial cmbin cmdbapp cmenum cmlang cmlistbox cmstd cmstdseed cmtxt cs daz3d db dbCommon dbaccess dnettool dos download flex2 flex3 flex4 framemtn framereq freeWorld freesoft gimp ginpro giodownload google hdml home hta htmlDom ie9svg install java javaSwing javascript jetsql jquery jsp jspTest jspVarious lightbox listasp listmsapi listmsie listmsiis listmsnt listmspatch listmsscript listmsvb listmsvc memo ms msde mysql netbeans oraPlsql oracle oracleWiper oraclehelper orafunc other panoramio pear perl personal pgdojo pgdojo_cal pgdojo_holiday pgdojo_idx pgdojo_ref pgdojo_req php phpVarious phpguide plsql postgres ps r205 realC realwebapp regex rgaki ruby rule sboard sc scprint scquest sdb sdbquest seesaa setup sh_Imagick sh_canvas sh_dotnet sh_google sh_tool sh_web shadowbox shgm shjquery shvbs shweb sjscript skadai skywalker smalltech sperl sqlq src systemdoc tcpip tegaki three toolbox twitter typeface usb useXML vb vbdb vbsfunc vbsguide vbsrc vpc wcsignup webanymind webappgen webclass webparts webtool webwsh win8 winofsql wmi work wp youtube