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

📄 post_upload.tpl.php

📁 一个文章管理系统,很不错的,php语言开发,运行平台:windows和linux
💻 PHP
字号:
<?php
if( !defined('ISELOOK') ){
	header('HTTP/1.0 404 Not Found');
	exit;
}
//session_start();
/*
if( $userinfo['usertoday'] == '' ){
	$arrUserToday = array(0,0,0,0,0);
} else{
	$arrUserToday = explode('|',$userinfo['usertoday']);
}
*/

/*	debug
set_cookie('upNum', 0);
set_cookie('usertoday', '');//*/

if( $t == 1 ){ // 提交上传文件
	print <<<EOT
	<script>
	parent.document.Dvform.Submit.disabled=false;
	parent.document.Dvform.Submit2.disabled=false;
	</script>
	<table width="100%" height="100%" border=0 cellspacing=0 cellpadding=0>
	<tr><td class=tablebody2 valign=top height=40>
EOT;
	if (!empty($UploadedFiles)) { // 部分或全部文件已成功移动到临时目录
		$__upfileinfo = base64_encode(serialize($UploadedFiles));
		foreach ($UploadedFiles AS $index => $currFile) {
			if ($currFile['ftype'] == 1 OR $currFile['ftype'] == 2) {
				$ShwoFileName = $currFile['destfile'];
				print "<script>parent.Dvbbs_Composition.document.body.innerHTML += '[upload={$currFile['ext']}]{$ShwoFileName}[/upload]<br>'</script>";
			} else {
				print "<script>parent.Dvbbs_Composition.document.body.innerHTML += '[upload={$currFile['ext']}]viewfile.php?id={$currFile['f_id']}[/upload]<br>'</script>";
			}
		}
		//Start 上传成功后的其它处理,包括数据库的更新
			$upload_subdir = basename($updirsettings[1]);
			$tmp1 = str_replace($documentroot.'/', '', $updirsettings[0].'/'.$updirsettings[3]);
			$tmp2= str_replace($documentroot.'/', '', $updirsettings[0].'/'.$updirsettings[1]);
			print <<<EOT
				<script>
					with(parent.document.forms['Dvform']) {
						if (__upfileinfo.value != '') {
							__upfileinfo.value += '||';
						}
						__upfileinfo.value += '{$__upfileinfo}';
					}
					/*
					with (parent.document.forms['preview']) {
						upload_tmp_dir.value = '{$tmp1}';
						uploadrepl.value = '{$tmp2}';
					}
					*/
				</script>
EOT;

			$upNum = $OnceUPCount + count($UploadedFiles);
			set_cookie('upNum',$date_num.'_'.$upNum);
			//$arrUserToday[2] += $_POST['upcount'];
			//$arrUserToday[2] += $uploadedcount; // 按成功上传的文件数来计数
			//$iUserInfo = $db->escape_string(implode('|',$arrUserToday));
			if ($upNum < $oneday_mostupload_num) {
				$num1 = intval(count($UploadedFiles));
				$num2 = intval($upNum);
				eval('$strTmp="'.addslashes($lang['template.strings8']).'";');
				print $strTmp;
			} else {
				$num1 = intval(count($UploadedFiles));
				$num2 = intval($oneday_mostupload_num);
				eval('$strTmp="'.addslashes($lang['template.strings10']).'";');
				print $strTmp;
			}
			/*
			$db->query("UPDATE {$dv}user SET usertoday = '{$iUserInfo}' WHERE userid='{$userid}'");
			set_cookie('usertoday',$iUserInfo);
			*/
		//End 上传成功后的其它处理,包括数据库的更新
	}
	print <<<EOT
	</td></tr>
	</table>
</body>
</html>
EOT;
} else { // 上传界面
	//$upset = intval($groupsetting[66]);
	//$dateupnum = $arrUserToday[2];
	$lang['tpl.str1']=str_replace('{$upset}',$upset,$lang['tpl.str1']);
	print <<<EOT
<script>
if (top.location==self.location){
	//top.location="index.php"
}
function uploadframe(num)
{
	var obj=parent.document.getElementById("ad");
	if (parseInt(obj.height)+num>=24) {
		obj.height = parseInt(obj.height) + 10 + num;
	document.getElementById("Setupload").style.display="";
	document.getElementById("allupload").style.display="none";
	}
}
function setid()
{
	str='';
	if(!window.form.upcount.value)
	window.form.upcount.value=1;
	if(window.form.upcount.value>{$upset}){
	alert("{$lang['tpl.str1']}");
	window.form.upcount.value = {$upset};
	setid();
	}
	else{
	for(i=1;i<=window.form.upcount.value;i++)
	str+='{$lang['tpl.str2']}'+i+':<input type="file" name="file'+i+'" style="width:200"><br>';
	window.upid.innerHTML=str+'<br>';

	var num=i*16
	var obj=parent.document.getElementById("ad");
	if (parseInt(obj.height)+num>=24) {
		obj.height = 24 + num;	
	}
	}
}
</script>
<table border=0 cellspacing=0 cellpadding=0 style="height:100%">
<form name="form" method="post" action="post_upload.php?t=1&r_id={$r_id}" enctype="multipart/form-data">
<tr>
EOT;
	/*if ($groupsetting[7] == 0) {
		print <<<EOT
<TD valign="top">{$lang['Error.strings0']}</td>
EOT;
	} else {*/
		mt_rand();
		$PostRanNum = intval(900*rand())+1000;
		/*
		if (session_is_registered('UploadCode') === false) {
			session_register('UploadCode');
		}
		$_SESSION['UploadCode'] = strval($PostRanNum);
		//*/
		print <<<EOT
<INPUT TYPE="hidden" NAME="UploadCode" value="{$PostRanNum}">
<TD id="upid" valign="top">
	<input type="file" name="file1" width="200" value="" size="40"></TD>
<td valign="top" width="1">
	<input type="submit" name="Submit" value="{$lang['template.strings0']}" onclick="parent.document.Dvform.Submit.disabled=true;parent.document.Dvform.Submit2.disabled=true;" class="button">
</td>
<td id="allupload" valign="top">
EOT;
		if( $upset > 1 ){
			print <<<EOT
	<input type="button" name="setload" onClick="uploadframe(25);" value="{$lang['template.strings1']}" class="button">
EOT;
		}
		print <<<EOT
</td>
<td valign="top">
	<div id="Setupload" style="display:none;">
EOT;
		if ($upset > 1) {
			$tmpStr = str_replace('{$upset}',$upset,$lang['template.strings3']);
			print <<<EOT
	{$lang['template.strings7']}
	<input type="text" value="1" name="upcount" style="width:40">
	<input type="button" name="Button" onClick="setid();" value="{$lang['template.strings2']}" class="button"><br>{$tmpStr}
EOT;
		}
		/*
		$tmpStr = str_replace('{$num}',$groupsetting[50]-$dateupnum,$lang['template.strings4']);
		$num1 = $groupsetting[40];
		$num2 = $groupsetting[50];
		$num3 = $groupsetting[44];
		$tmpStr2 = str_replace(array('{$num1}', '{$num2}', '{$num3}'), array($num1, $num2, $num3), $lang['template.strings5']);
		*/
		$tmpStr = str_replace('{$num}','<font color="#ff0000">'.$InceptMaxFile.'</font>',$lang['template.strings4']);
		print <<<EOT
	</div>
EOT;
if ($upset>0) {
	print <<<EOT
	{$tmpStr}<!--;
	<a style="CURSOR: help" title="{$tmpStr2}">{$lang['template.strings6']}</a>-->
</TD>
EOT;
}
	//}
	print <<<EOT
</tr>
</form>
</table>
</body>
</html>
EOT;
}
?>

⌨️ 快捷键说明

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