想要实现用户在下载列表中判断是不是会员?
第一种解决方法:
将后台的会员权限管理中对会员的页面download.html进行操作:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><!--{$Html.Download}--> - <!--{$Web.WebTitle}--></title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta name="keywords" content="<!--{$Web.Webkeyword}-->">
<meta name="description" content="<!--{$Web.WebDescription}-->">
<base href="<!--{$Sys.WebHost}-->">
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<script type="text/javascript" src="./js/jquery.js"></script>
<script type="text/javascript" src="./js/global.js"></script>
<script type="text/javascript" src="./js/swfobject.js"></script>
<link rel="stylesheet" type="text/css" href="<!--{$Sys.TemDir}-->style.css" />
<script language="javascript">
function trim(str) {
return str.replace(/(^[/s/u3000]*)|([/s/u3000]*$)/g,"");
}
function nCheck(){
if(trim(document.Feedback.Title.value)=="" || trim(document.Feedback.Content.value)==""){
alert('<!--{$Html.sIncomplete}-->');
document.Feedback.Content.focus();
return false;
}
}
</script>
<style type="text/css">
.Framework{margin:auto; background:#FFF;}
.Framework .Left{vertical-align:top; background:url(./images/1010.gif) right repeat-y; padding:10px 0 0 0;}
.Framework .Left table,.Content{margin:auto;}
.Framework .Left .Dx{background-color:#F6F6F6;}
.Framework .Cdownload{margin:auto; text-align:center;}
.Framework .Cdownload .b{background:url(./images/0101.gif) bottom repeat-x; height:30px;}
</style>
</head>
<body>
<!--{include file='top.html'}-->
<table width="950" border="0" cellpadding="0" cellspacing="0" class="ad" align="center">
<tr>
<td><img src="<!--{$Sys.TemDir}-->images/ad_950_220_b.jpg" width="950" height="220" border="0" /></td>
</tr>
</table>
<div class="clear"></div>
<table width="950" border="0" cellspacing="0" cellpadding="0" class="Framework">
<tr>
<td width="200" class="Left">
<table width="180" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="List"><!--{$Html.Download}--></td>
</tr>
<!--{sdb->column Type="3" Colu="0" BackVar="sDownload"}-->
<!--{foreach from=$sDownload item=cp key=i name=x}-->
<tr>
<td height="26" class="Dx">
<!--{if $cp.ColumnLevel==1}--> <!--{* 一级类别 *}-->
<img src="./images/article_elite3.gif" width="9" height="15">
<!--{elseif $cp.ColumnLevel==2}--> <!--{* 设置二级类别样式 *}-->
<img src="./images/article_elite5.gif" width="9" height="15" />
<!--{else}--> <!--{* 设置更多级别的类别样式 *}-->
<img src="./images/article_ontop2.gif" width="9" height="15" />
<!--{/if}-->
<a href="<!--{$cp.URL}-->"><!--{$cp.ColumnName}--></a>
</td>
</tr>
<!--{/foreach}-->
</table>
<br />
<!--{include file='component_product.html'}-->
</td>
<td width="750" valign="top">
<table border="0" cellspacing="0" cellpadding="0" width="730" class="Content">
<tr>
<td class="Navi" width="55%"><!--{$Html.Navi}--> : <!--{$Html.Home}--> >> <!--{$Html.Download}--> >> <!--{$do.Sort}--></td>
<td align="right" class="Navi"><!--{include file='component_search.html'}--></td>
</tr>
</table>
<br /><br />
<table border="0" cellspacing="0" cellpadding="0" class="Cdownload" width="98%">
<tr>
<td class="b" style="text-align:left;" ><!--{$Html.Categories}--></td>
<td class="b" style="text-align:left;" ><!--{$Html.dTitle}--></td>
<td class="b"><!--{$Html.sDownload}--></td>
</tr>
<!--{*
Sort:排序,0按最新添加(降序),1按最新添加(升序),2按下载次数。[默认值为0]
Rela:调用的下载资源类别路径,以"|"隔开,为0时显示所有类别中的下载资源;如$Sys.sGET.c:可将该参数接收GET值从而显示指定的类别下的下载资源[默认显示所有类别]
Start:从第几条记录开始调用(针对不分页时有效),[默认从第一条记录开始读取]
Total:每页要显示的记录数[默认显示10条记录]
BackVar:调用结果赋值的变量名,默认为Download
如果有分页,在模板中使用<!--{$pages}--> 调用
*}-->
<!--{download->sList Total="15" Rela=$Sys.sGET.c}-->
<!--{foreach from=$Download item=dow key=i name=x}-->
<tr>
<td class="Dx" align="left" height="28"><!--{sdb->CidToName Rela=$dow.DownloadRela blank=" | "}--></td>
<td class="Dx" align="left" >
<!--{$dow.DownloadTitle|replace:$Sys.sGET.w:$do.Redwd}-->
<font color="#999999"></font>
<!--{if $dow.Difference < 48}--><img src="./images/new.gif"><!--{/if}--><!--{* 48小时内发布的显示New图标 *}-->
</td>
<td class="Dx">
<input type="hidden" id="txtid" value="<!--{$Sys.isLogin}-->" />
<a id="textid" target="_blank" href="<!--{$dow.URL}-->" onclick="text();" >
<img src="<!--{$Sys.TemDir}-->images/go.gif" width="30" height="15" border="0">
</a>
//此处添加的代码
<script language="javascript">
function text(){
var tid=document.getElementById("txtid").value;
if (tid!="songcms"){
window.location.href='?flogin';
}
}
</script>
</td>
</tr>
<!--{foreachelse}-->
<tr><td height="100" colspan="4"><!--{$Html.NotProduct}--></td></tr><!--{* 没有数据时显示 *}-->
<!--{/foreach}-->
<tr>
<td colspan="4"><!--{$pages}--></td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<!--{include file='bottom.html'}-->
</body>
</html>