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

📄 newmsg.php

📁 极限网络智能办公系统 - Office Automation 2008 官方100% 源码
💻 PHP
📖 第 1 页 / 共 2 页
字号:
			$i = 0;
			for ( ;	$i < count( $ARTo );	++$i	)
			{
				$name = $ARTo[$i]['name'];
				$thismail = $ARTo[$i]['mail'];
				if ( isset( $toreply ) )
				{
					$toreply .= ", \"".$name."\" <{$thismail}>";
				}
				else
				{
					$toreply = "\"".$name."\" <{$thismail}>";
				}
			}
			$ARCC = $email['cc'];
			$i = 0;
			for ( ;	$i < count( $ARCC );	++$i	)
			{
				$name = $ARCC[$i]['name'];
				$thismail = $ARCC[$i]['mail'];
				if ( isset( $ccreply ) )
				{
					$ccreply .= ", \"".$name."\" <{$thismail}>";
				}
				else
				{
					$ccreply = "\"".$name."\" <{$thismail}>";
				}
			}
			function clear_names( $strMail )
			{
				global $UM;
				$strMail = $UM->get_names( $strMail );
				$i = 0;
				for ( ;	$i < count( $strMail );	++$i	)
				{
					$thismail = $strMail[$i];
					$thisline = $thismail['mail'] != $thismail['name'] ? "\"".$thismail['name']."\" <".$thismail['mail'].">" : $thismail['mail'];
					if ( !( $thismail['mail'] != "" ) && !( strpos( $result, $thismail['mail'] ) === false ) )
					{
						if ( $result != "" )
						{
							$result .= ", ".$thisline;
						}
						else
						{
							$result = $thisline;
						}
					}
				}
				return $result;
			}
			$allreply = clear_names( $fromreply.", ".$toreply );
			$ccreply = clear_names( $ccreply );
			$fromreply = clear_names( $fromreply );
			$msgsubject = $email['subject'];
			$fromreply_quote = $fromreply;
			$toreply_quote = $toreply;
			$ccreply_quote = $ccreply;
			$msgsubject_quote = $msgsubject;
			if ( $show_advanced )
			{
				$fromreply_quote = htmlspecialchars( $fromreply_quote );
				$toreply_quote = htmlspecialchars( $toreply_quote );
				$ccreply_quote = htmlspecialchars( $ccreply_quote );
				$msgsubject_quote = htmlspecialchars( $msgsubject_quote );
				$linebreak = "<br>";
			}
			else
			{
				$tmpbody = strip_tags( $tmpbody );
				$quote_string = "> ";
				$tmpbody = $quote_string.ereg_replace( "\n", "\n".$quote_string, $tmpbody );
			}
			$body = "\r\n".$reply_delimite."{$linebreak}\r\n{$reply_from_hea} ".ereg_replace( "(\")", "", $fromreply_quote )."{$linebreak}\r\n{$reply_to_hea} ".ereg_replace( "(\")", "", $toreply_quote );
			if ( !empty( $ccreply ) )
			{
				$body .= "{$linebreak}\r\n{$reply_cc_hea} ".ereg_replace( "(\")", "", $ccreply_quote );
			}
			$body .= "{$linebreak}\r\n{$reply_subject_hea} ".$msgsubject_quote."{$linebreak}\r\n{$reply_date_hea} ".@strftime( $date_format, $email['date'] )."{$linebreak}\r\n{$linebreak}\r\n{$tmpbody}";
			if ( $show_advanced )
			{
				$body = "\r\n<br>\r\n<BLOCKQUOTE dir=ltr style=\"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px\">\r\n  <DIV style=\"FONT: 10pt arial\">\r\n  ".$body."\r\n  </DIV>\r\n</BLOCKQUOTE>\r\n";
			}
			switch ( $rtype )
			{
			case "reply" :
				if ( !eregi( "^".$reply_prefix, trim( $subject ) ) )
				{
					$subject = "{$reply_prefix} {$subject}";
				}
				$to = $fromreply;
				break;
			case "replyall" :
				if ( !eregi( "^".$reply_prefix, trim( $subject ) ) )
				{
					$subject = "{$reply_prefix} {$subject}";
				}
				$to = $allreply;
				$cc = $ccreply;
				break;
			case "forward_out" :
			case "forward_in" :
				if ( !eregi( "^".$forward_prefix, trim( $subject ) ) )
				{
					$subject = "{$forward_prefix} {$subject}";
				}
				if ( !( 0 < count( $email['attachments'] ) ) )
				{
					break;
				}
				$bound = $email['attachments'][0]['boundary'];
				if ( $bound != "" )
				{
					$parts = $UM->split_parts( $bound, $result['body'] );
				}
				else
				{
					$parts[0] = $result['body'];
				}
				$i = 0;
				for ( ;	$i < count( $email['attachments'] );	++$i	)
				{
					$current = $email['attachments'][$i];
					$currentstruc = $UM->fetch_structure( $parts[$current['part']] );
					$tmpfilename = $userfolder."_attachments/".uniqid( "" ).".tmp";
					$contenttype = $current['content-type'] != "" ? $current['content-type'] : "application/octet-stream";
					$filename = $current['name'] != "" ? $current['name'] : basename( $tmpfilename );
					$UM->save_attach( $currentstruc['header'], $currentstruc['body'], $tmpfilename );
					$ind = count( $sess['attachments'] );
					$sess['attachments'][$ind]['localname'] = $tmpfilename;
					$sess['attachments'][$ind]['name'] = $filename;
					$sess['attachments'][$ind]['type'] = $contenttype;
					$sess['attachments'][$ind]['size'] = filesize( $tmpfilename );
				}
				$SS->Save( $sess );
			}
			if ( empty( $signature ) )
			{
				if ( $show_advanced )
				{
					$body = "<br><br>--<br>".$signature."<br><br>{$body}";
				}
				else
				{
					$body = "\r\n\r\n--\r\n".$signature."\r\n\r\n{$body}";
				}
			}
		}
	}
	else if ( $add_sig && !empty( $signature ) || empty( $body ) )
	{
		if ( $show_advanced )
		{
			$body = "<br><br>--<br>".$signature."<br><br>{$body}";
		}
		else
		{
			$body = "\r\n\r\n--\r\n".$signature."\r\n\r\n{$body}";
		}
	}
	$haveSig = empty( $signature ) ? 0 : 1;
	$smarty->assign( "umHaveSignature", $haveSig );
	$strto = isset( $nameto ) && eregi( "([-a-z0-9_\$+.]+@[-a-z0-9_.]+[-a-z0-9_])", $mailto ) ? "<input class=textbox style=\"width : 400px;\" type=text size=50 name=to value=\"&quot;".htmlspecialchars( stripslashes( $nameto ) )."&quot; <".htmlspecialchars( stripslashes( $mailto ) ).">\">\r\n\t" : "<input class=textbox style=\"width : 400px;\" type=text size=50 name=to value=\"".htmlspecialchars( stripslashes( $to ) )."\">";
	$strcc = "<input class=textbox style=\"width : 400px;\" type=text size=50 name=cc value=\"".htmlspecialchars( stripslashes( $cc ) )."\">";
	$strbcc = "<input class=textbox style=\"width : 400px;\" type=text size=50 name=bcc value=\"".htmlspecialchars( stripslashes( $bcc ) )."\">";
	$strsubject = "<input class=textbox style=\"width : 400px;\" type=text size=50 name=subject value=\"".htmlspecialchars( stripslashes( $subject ) )."\">";
	$haveAttachs = is_array( $attachs = $sess['attachments'] ) && count( $sess['attachments'] ) != 0 ? 1 : 0;
	$smarty->assign( "umHaveAttachs", $haveAttachs );
	if ( is_array( $attachs = $sess['attachments'] ) && count( $sess['attachments'] ) != 0 )
	{
		$attachlist = array( );
		$i = 0;
		for ( ;	$i < count( $attachs );	++$i	)
		{
			$index = count( $attachlist );
			$attachlist[$index]['name'] = $attachs[$i]['name'];
			$attachlist[$index]['size'] = ceil( $attachs[$i]['size'] / 1024 );
			$attachlist[$index]['type'] = $attachs[$i]['type'];
			$attachlist[$index]['link'] = "javascript:upwin(".$i.")";
		}
		$smarty->assign( "umAttachList", $attachlist );
	}
	if ( !$show_advanced )
	{
		$body = stripslashes( $body );
	}
	$umAdvEdit = $show_advanced ? 1 : 0;
	$smarty->assign( "umBody", $body );
	$smarty->assign( "umTo", $strto );
	$smarty->assign( "umCc", $strcc );
	$smarty->assign( "umBcc", $strbcc );
	$smarty->assign( "umSubject", $strsubject );
	$smarty->assign( "umTextEditor", $txtarea );
	$smarty->assign( "umAdvancedEditor", $umAdvEdit );
	if ( $rtype != "forward_in" && $rtype_edit != "forward_in" )
	{
		$smarty->display( "neotech.net/newmsg.htm" );
	}
	else
	{
		$query = "select * from SYS_PARA where PARA_NAME='SMS_INIT_VALUE'";
		$cursor = exequery( $connection, $query );
		if ( $ROW = mysql_fetch_array( $cursor ) )
		{
			$SET_VAL = $ROW['PARA_VALUE'];
		}
		if ( find_id( $SET_VAL, 2 ) )
		{
			$sms0_remind = " checked";
		}
		$query = "select * from SMS2_PRIV";
		$cursor = exequery( $connection, $query );
		if ( $ROW = mysql_fetch_array( $cursor ) )
		{
			$IN_PRIV = $ROW['IN_PRIV'];
		}
		if ( find_id( $IN_PRIV, $LOGIN_USER_ID ) )
		{
			$query = "select * from SMS2_PRIV";
			$cursor = exequery( $connection, $query );
			if ( $ROW = mysql_fetch_array( $cursor ) )
			{
				$TYPE_PRIV = $ROW['TYPE_PRIV'];
				$SET_VAL = $ROW['SET_VAL'];
			}
			if ( find_id( $TYPE_PRIV, 2 ) )
			{
				$sms_remind = "<input type=\"checkbox\" name=\"SMS2_REMIND\" id=\"SMS2_REMIND\"";
				if ( find_id( $SET_VAL, 2 ) )
				{
					$sms_remind .= " checked";
				}
				$sms_remind .= "><label for=\"SMS2_REMIND\">使用手机短信提醒收件人</label>";
			}
		}
		$smarty->assign( "sms0_remind", $sms0_remind );
		$smarty->assign( "sms_remind", $sms_remind );
		$smarty->display( "neotech.net/forward_in.htm" );
	}
}
echo "\r\n";
?>

⌨️ 快捷键说明

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