DTCMS列表页自定义参数。

1、频道管理中,URL配置,增加一个参数person_id

2、在photo_list.html模板页中,添加以下代码

<!--C#代码-->
    <%csharp%>
      string strwhere="status=0 ";
      if(DTRequest.GetQueryString("person_id")!=null)
      {
         string person_id=DTRequest.GetQueryString("person_id");
        if(person_id!="0"&&person_id!="")
        {
            strwhere="status=0 and person_id="+person_id;//person_id:在数据表dt_article新增字段 
        }
       
      }
     
    <%/csharp%>

3、更改分页列表条件strwhere部分为以下代码

<%set DataTable photoList=get_article_list(channel, category_id, pagesize, page, strwhere, out totalcount, out pagelist, "photo_list", category_id, "__id__")%><!--取得一个分页DataTable-->

原文地址:https://www.cnblogs.com/qigege/p/5254511.html