方法一:
	
	一、識別
	識別出系統(tǒng)默認(rèn)模板方案的兩個文件:
	default/phpcms/show_down.html
	default/phpcms/down.html
	二、操作
	下載模型里面使用“下載列表”字段就可以,禁止掉“下載地址”字段。
	1、修改show_down.html模板
	<h3>下載地址</h3>
	<div id="down_address">
	{$downurl}
	{$downurls}
	</div>
變成:
	<h3>下載地址</h3>
	<script type="text/javascript">
	$(function(){
	$.get('{$downurls}',function(data){
	$('#down_address').html(data);
	});
	});
	</script>
	<div id="down_address"></div>
	或者
	<h3>下載地址</h3>
	<script type="text/javascript">
	var xmlhttp;
	if(window.XMLHttpRequest){
	xmlhttp=new XMLHttpRequest();
	}else{
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function(){
	if(xmlhttp.readyState==4 && xmlhttp.status==200){
	document.getElementById("down_address").innerHTML=xmlhttp.responseText;
	}
	}
	xmlhttp.open("GET","{$downurls}",true);
	xmlhttp.send();
	</script>
	<div id="down_address"></div>
說明:沒有引用JQuery時就用這種方式。
	2、修改down.html模板
	注釋掉整模板內(nèi)容,在文件末尾并加入一段代碼。
	<?php
	/*
	注釋模板內(nèi)容而不刪除,目的就是盡量保持系統(tǒng)原有的內(nèi)容,以便日后使用或修改。
	*/
	?>
	<a href="http://lanfeng898.blog.163.com/blog/{$downurl}">{$head[title]}</a>
	//{$head[title]}是標(biāo)題名,可以自定義下載名稱,如:高速下載、快速下載等等。
方法二:
	在down.html頁面它的<meta>里面改成或者添加
	<meta http-equiv="refresh" content="0;URL={$downurl}" />
在<body>里面加入
	<script type="text/javascript">
	//<!--
	function isIFrameSelf(){try{if(window.top ==window){return false;}else{return true;}}catch(e){return true;}}
	function toHome(){ if(!isIFrameSelf()){ window.location.href="/index.php";}window.close();}
	window.setTimeout("toHome()",5000);
	//-->
	</script>
讓其在5秒內(nèi)關(guān)閉窗口



 鄂公網(wǎng)安備 42090202000212號
鄂公網(wǎng)安備 42090202000212號