zoukankan      html  css  js  c++  java
  • 织梦文章添加字段填栏目id,内容页调用字段里的栏目文章

    在模型里增加个字段,然后在添加文章的时候,在字段里填了栏目id进去

    在前台的内容页,调用这个字段栏目的多个文章出来

    {dede:field.field1 runphp=yes}
    global $dsql;
    $sql = "select arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,
    tp.defaultname,tp.namerule,tp.moresite,tp.siteurl,tp.sitepath
    from `#@_archives` arc left join `myblog_arctype` tp on arc.typeid=tp.id where tp.id in (@me) LIMIT 10";
    $dsql->SetQuery($sql);
    $dsql->Execute('t');
    $result = '';
    while($row = $dsql->GetArray('t'))
    {
    	$arcurl=GetOneArchive($row['id']);
    	$pubdate = MyDate('Y-m-d H:i:s',$row['pubdate']);
    	$result .= "<li><span>{$pubdate}</span><a href="{$arcurl['arcurl']}">{$row['title']}</a></li>";
    }
    @me = $result;
    {/dede:field.field1}

    field1 为字段名称

  • 相关阅读:
    为Delphi配置多套环境
    0425-字符输入流FileReader
    使用 IntraWeb (9)
    使用 IntraWeb (7)
    使用 IntraWeb (6)
    使用 IntraWeb (5)
    使用 IntraWeb (4)
    使用 IntraWeb (3)
    使用 IntraWeb (2)
    使用 IntraWeb (1)
  • 原文地址:https://www.cnblogs.com/dedehtml/p/9901169.html
Copyright © 2011-2022 走看看