⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 donewreply.pl

📁 这个社区是虚拟社区使用的程序
💻 PL
字号:
################################################################################ DoNewReply.pl                                                               ################################################################################# UltraBoard Ver. 1.61 by UltraScripts.com                                    ## Scripts written by Jacky W.W. Yung, WebMaster@UltraScripts.com              ## Available from http://www.UltraScripts.com/UltraBoard/                      ## --------------------------------------------------------------------------- ## PROGRAM NAME : UltraBoard                                                   ## VERSION : 1.61                                                              ## LAST MODIFIED : 30/06/1999                                                  ## =========================================================================== ## COPYRIGHT NOTICE :                                                          ##                                                                             ## Copyright (c) 1999 Jacky Yung. All Rights Reserved.                         ##                                                                             ## This program is free software; you can change or modify it as you see fit.  ## However, modified versions cannot be sold or distributed.  You cannot alter ## the copyright and "powered by" notices throughout the scripts. These        ## notices must be clearly visible to the end users.                           ##                                                                             ## WARRANTY DISCLAIMER:                                                        ##                                                                             ## THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ## ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR       ## FITNESS FOR A PARTICULAR PURPOSE.                                           ################################################################################################################################################################ DoNewReply                                                                  ################################################################################sub DoNewReply {	&ShowError("粘贴错误","您必须输入主题。") if (!$in{'Subject'});	&ShowError("粘贴错误","您必须输入内容。") if (!$in{'Message'});	&ShowError("粘贴错误","您的主题不能多于 $MaxSubjectLen 个字符。") if (length($in{'Subject'}) > $MaxSubjectLen);	unless (-e "$DBPath/$in{'Board'}/board.list") {		&ShowError("POSTING PROBLEM","The board that you want to reply topic is not found.<br>Please contact the webmaster (".&Link("mailto:$EmailAddress","","").$EmailAddress."</a>".") for more information.");	}	unless (-e "$DBPath/$in{'Board'}/$in{'Post'}.post") {		&ShowError("POSTING PROBLEM","The topic that you want to reply is not found.<br>Please contact the webmaster (".&Link("mailto:$EmailAddress","","").$EmailAddress."</a>".") for more information.");	}	open(BOARD,"$DBPath/$in{'Board'}/board.list")||&CGIError("Couldn't open/read the board.list file<br>\nPath: $DBPath/$in{'Board'}<br>\nReason : $!");		flock(BOARD,1) if ($FLock);		$BOARD_DATA=<BOARD>;	close(BOARD);	@BoardInfo=&DecodeDBOutput($BOARD_DATA);	if ($Group eq "Guest") {		&ShowError("错误","您必须输入别名。") if (!$in{'NickName'});		&ShowError("错误","别名最少4个字符(2个汉字),最多20个字符(10个汉字)。") if (length($in{'NickName'}) < 4);		&ShowError("错误","别名最少4个字符(2个汉字),最多20个字符(10个汉字)。") if (length($in{'NickName'}) > 20);################################################################################################################################################################				open(DB,"$MembersPath/Members.nickname")||&CGIError("Couldn't open/read the Members.nickname file<br>\nPath: $MembersPath<br>\nReason : $!");			flock(DB,1) if ($FLock);			@REG_NickName=<DB>;		close(DB);		for (my($i)=0;$i<=$#REG_NickName;$i++) {			chomp($REG_NickName[$i]);			if ($REG_NickName[$i] =~/^$in{'NickName'}$/i) {				&ShowError("粘贴错误","您选择的别名已经注册了。");			}		}#################################################################################################################################################################		}	if ($Group ne "administrator") {		if ($BoardInfo[5] ne "Active") {			&ShowError("ACCESS DENIED","The \"$BoardInfo[1]\" board is currently inactive.<br>Please contact the webmaster (".&Link("mailto:$EmailAddress","","").$EmailAddress."</a>".") for more information.");		}		if (($BoardInfo[6] ne "Public")&&($Group eq "Guest")) {			print "Location: UltraBoard.$Ext?Action=SignIn&Ref=NewReply&Post=$in{'Post'}&Board=$in{'Board'}&Idle=$in{'Idle'}&Sort=$in{'Sort'}&Order=$in{'Order'}&Page=$in{'Page'}\n\n";		}elsif ($BoardInfo[6] eq "Private") {			require "$DBPath/$in{'Board'}/Access.db";			if ($Access{$MemberData[3]} ne "FullAccess") {				print "Location: UltraBoard.$Ext?Action=SignIn&Ref=NewReply&Post=$in{'Post'}&Board=$in{'Board'}&Idle=$in{'Idle'}&Sort=$in{'Sort'}&Order=$in{'Order'}&Page=$in{'Page'}\n\n";			}		}	}###############################################################################	if (($ENV{'REMOTE_HOST'})&&($TrackIP=~/Host/)) {		$IP=$ENV{'REMOTE_HOST'};	}elsif ($TrackIP=~/IP/){		$IP=$ENV{'REMOTE_ADDR'};	}    open(POST,"$DBPath/$in{'Board'}/$in{'Post'}.post")||&CGIError("Couldn't open/read the $in{'Post'}.post file<br>\nPath: $DBPath/$in{'Board'}<br>\nReason : $!");		flock(POST,1) if ($FLock);		@POST_DATA=<POST>;	close(POST);    @TopicInfo=&DecodeDBOutput($POST_DATA[0]);    if ($TopicInfo[8] ne "") {        &ShowError("错误","此讨论已经被关闭。");    }	$PostTime = time;	$NickName=$in{'NickName'};	if ($in{'Method'} eq "Preview") {		$NickName=&RemoveCensorWords(&DecodeHTML($NickName));		$in{'Subject'}=&RemoveCensorWords(&DecodeHTML($in{'Subject'}));		$in{'Description'}=&RemoveCensorWords(&DecodeHTML($in{'Description'}));		$in{'Message'}=&RemoveCensorWords(&DecodeUBCodes(&DecodeHTML($in{'Message'})));	}	$mark=0;	for ($i=2;$i<=$#POST_DATA;$i++) {		@PostInfo=&DecodeDBOutput($POST_DATA[$i]);		if ($PostInfo[6] eq $IP) {			$mark=1;		}	}###############################################################################	open(COUNT,"$DBPath/$in{'Board'}/board.count")||&CGIError("Couldn't open/read the board.count file<br>\nPath: $DBPath/$in{'Board'}<br>\nReason : $!");		flock(COUNT,1) if ($FLock);		@COUNT_DATA=&DecodeDBOutput(<COUNT>);	close(COUNT);	$COUNT_DATA[2]++;	$COUNT_DATA[3]=$PostTime;	open(COUNT,">$DBPath/$in{'Board'}/board.count")||&CGIError("Couldn't create/write the board.count file<br>\nPath: $DBPath/$in{'Board'}<br>\nReason : $!");		flock(COUNT,2) if ($FLock);			print COUNT &EncodeDBInput(@COUNT_DATA);		flock(COUNT,8) if ($FLock);	close(COUNT);###############################################################################	@PostStat=&DecodeDBOutput($POST_DATA[1]);	$PostStat[0]++;	$PostStat[2]=$PostTime;	$POST_DATA[1]=&EncodeDBInput(@PostStat);	$InLine=	&EncodeDBInput(					#$PostStat[0],                                           #Reply ID					&RemoveCensorWords($in{'Subject'}),						#Subject					$NickName,												#NickName					$UserName,												#UserName					$in{'Nodify'},											#Nodify member when someone reply their message					$in{'UseSignature'},									#Use Signarture in their message or not					$PostTime,												#Post Time					$IP														#IP Address				);	chomp $InLine;	push	(@POST_DATA,	$InLine.$Spliter.&EncodeUBCodes(&RemoveCensorWords($in{'Message'})).$Spliter."0\n");	open(POST,">$DBPath/$in{'Board'}/$in{'Post'}.post")||&CGIError("Couldn't create/write the $in{'Post'}.post file<br>\nPath: $DBPath/$in{'Board'}<br>\nReason : $!");		flock(POST,2) if ($FLock);			print POST @POST_DATA;		flock(POST,8) if ($FLock);	close(POST);###############################################################################	open(BOARD,"$DBPath/$in{'Board'}/board.list")||&CGIError("Couldn't open/read the board.list file<br>\nPath: $DBPath/$in{'Board'}<br>\nReason : $!");		flock(BOARD,1) if ($FLock);		@BOARD_DATA=<BOARD>;	close(BOARD);	for (my ($i)=1;$i<=$#BOARD_DATA;$i++) {		@PostInfo=&DecodeDBOutput($BOARD_DATA[$i]);		if ($PostInfo[1] eq $in{'Post'}) {			$PostInfo[0]=$PostTime;			$PostInfo[2]++;			$BOARD_DATA[$i]=&EncodeDBInput(@PostInfo);		}	}	open(BOARD,">$DBPath/$in{'Board'}/board.list")||&CGIError("Couldn't create/write the board.list file<br>\nPath: $DBPath/$in{'Board'}<br>\nReason : $!");		flock(BOARD,2) if ($FLock);			print BOARD @BOARD_DATA;		flock(BOARD,8) if ($FLock);	close(BOARD);###############################################################################	if ($UserName) {		$MemberData[5]++;		$MemberData[7]=$PostTime;		$MemberData[18]+=3 if ((length($in{'Message'}) > 50) && $mark==0);		&SaveMemberData($UserName,@MemberData);	}###############################################################################	@BoardInfo=&DecodeDBOutput($BOARD_DATA[0]);	open(CATEGORY,"$DBPath/$BoardInfo[3].cat")||&CGIError("Couldn't open/read the $BoardInfo[3].cat file<br>\nPath: $DBPath<br>\nReason : $!");		flock(CATEGORY,1) if ($FLock);		$CATEGORY_DATA=<CATEGORY>;		@CategoryInfo=&DecodeDBOutput($CATEGORY_DATA);	close(CATEGORY);	my ($Subject, $Message);	if ($Group eq "Guest") {        $From = "$NickName (Guest)";	}else{		$From= "$MemberData[1] ($MemberData[0])";	}	# Send Email	if ($NodifyPost) {		$Subject = "一个讨论有新回复----$UBName";		$Message = "您好,\n";		$Message .= "$From 回复了一个讨论,时间 ".&GetDate($PostTime)."\n\n";		$Message .= "下面是详细信息:\n";		$Message .= "----------------------------------------\n";		$Message .= "来自: $From\n";		$Message .= "粘贴于: $CategoryInfo[1] / $BoardInfo[1] / $TopicInfo[0]\n";		$Message .= "Host/IP: $IP\n";		$Message .= "电子邮件: $MemberData[4]\n\n";		$Message .= "主题: $in{'Subject'}\n";		$Message .= "内容:\n$in{'Message'}\n";		$Message .= "----------------------------------------\n";		$Message .= "$UBName Administrator Center\n";		&SendMail("$UBName Administrator Center <$EmailAddress>",$Subject,$Message,$EmailAddress);	}	if (($TopicInfo[3])&&($TopicInfo[2])&&($NotifyMembers=~/Post/)) {		if (($TopicInfo[1] ne "")||($MemberData[0] ne $TopicInfo[2])) {			$Subject = "您的讨论 ($TopicInfo[0]) 有新回复----$UBName";			$Message = "您好,\n";			$Message .= "$From 回复了您的讨论,时间 ".&GetDate($PostTime)."\n\n";			$Message .= "下面是详细信息:\n";			$Message .= "----------------------------------------\n";			$Message .= "来自: $From\n";			$Message .= "粘贴于: $CategoryInfo[1] / $BoardInfo[1] / $TopicInfo[0]\n";			$Message .= "主题: $in{'Subject'}\n";			$Message .= "内容:\n$in{'Message'}\n";			$Message .= "----------------------------------------\n";			$Message .= "感谢您在我们的 $UBName 发表讨论,\n";			$Message .= "WebMaster, $UBName\n";			$Message .= "$EmailAddress\n";			$Message .= "$URLSite\n";			$Message .= "----------------------------------------\n";			$Message .= "$UBName Administrator Center\n";			$OriginatorEmail=(&GetMemberData($TopicInfo[2]))[4];			&SendMail("$UBName Administrator Center <$EmailAddress>",$Subject,$Message,$OriginatorEmail);		}	}	if ($NotifyMembers=~/Reply/) {        $Subject = "讨论 ($TopicInfo[0]) 有新的回复----$UBName";	$Message = "Hello,\n";	$Message .= "$From 回复了此讨论,时间 ".&GetDate($PostTime)."\n\n";	$Message .= "下面是详细信息:\n";	$Message .= "----------------------------------------\n";	$Message .= "来自: $From\n";	$Message .= "粘贴于: $CategoryInfo[1] / $BoardInfo[1] / $TopicInfo[0]\n";	$Message .= "主题: $in{'Subject'}\n";	$Message .= "内容:\n$in{'Message'}\n";	$Message .= "----------------------------------------\n";	$Message .= "感谢您在我们的 $UBName 发表讨论,\n";	$Message .= "WebMaster, $UBName\n";	$Message .= "$EmailAddress\n";	$Message .= "$URLSite\n";	$Message .= "----------------------------------------\n";	$Message .= "$UBName Administrator Center\n";		for ($i=2;$i<=$#POST_DATA;$i++) {			@ReplyInfo=&DecodeDBOutput($POST_DATA[$i]);			if (($ReplyInfo[3])&&($ReplyInfo[2])) {				if (($ReplyInfo[1] ne "")||($MemberData[0] ne $ReplyInfo[2])) {					$ReplierEmail = (&GetMemberData($ReplyInfo[2]))[4];                    &SendMail("$UBName Administrator Center <$EmailAddress>",$Subject,$Message,$ReplierEmail);				}			}		}	}###############################################################################	&ShowThank(	"回复此讨论",				"您的回复已经在 $BoardInfo[1] 粘贴。\n",				"3",				"UltraBoard.$Ext?Action=ShowPost&Board=$in{'Board'}&Post=$in{'Post'}&Idle=$in{'Idle'}&Sort=$in{'Sort'}&Order=$in{'Order'}&Page=$in{'Page'}&Session=$SessionID"					);	exit;}###############################################################################1;# End of DoNewReply Function###############################################################################

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -