菜单 eyoucms模板网

eyoucms仿站教程
如果网站不是v1.5.4版本,请先升级到最新版v1.5.5下面我们将织梦和易优的sql标签进行对比转换,大家在学习时留意两个系统语法的相似之处。注意事项: 1、示例中 __PREFIX__ 代表数据表的前缀,假设你安装网站时数据表前缀是ey_,那么 __PREFIX__arctype 就是 ey_arctype------------------------------- 示例1 -----

不支持sql标签,可以用其他标签方式代替

发布时间:2021-11-04 08:46:40
点击次数:950
复制本文链接

如果网站不是v1.5.4版本,请先升级到最新版v1.5.5

下面我们将织梦和易优的sql标签进行对比转换,大家在学习时留意两个系统语法的相似之处。

注意事项:
    1、示例中 __PREFIX__ 代表数据表的前缀,假设你安装网站时数据表前缀是ey_,那么 __PREFIX__arctype 就是 ey_arctype

------------------------------- 示例1 ----------------------------
 
织梦:调用指定栏目的封面页内容,比如栏目ID是1
{dede:sql sql="select content from dede_arctype where id=1"}
    [field:content function=cn_substr(Html2Text(@me),600)/]
{/dede:sql}
 
易优:指定栏目的封面页内容,比如栏目ID是1,在易优这边只有单页模型的栏目才有封面页内容
{eyou:sql sql='select content from `__PREFIX__single_content` where typeid = 1' id='field'}
    {$field.content|html_msubstr=###,0,300,true}

(图1)

{/eyou:sql}
或者
{eyou:type typeid='1' addfields='content' id='field'}
    {$field.content|html_msubstr=###,0,300,true}
{/eyou:type}
 
------------------------------- 示例2 ----------------------------
织梦:调用指定栏目的数据,比如栏目ID是1
{dede:sql sql="select * from dede_arctype where id=1"}
    栏目ID:[field:id/]
    栏目名称:[field:typename/]
    栏目链接:[field:typelink/]
{/dede:sql}
 
易优:调用指定栏目的数据,比如栏目ID是1
{eyou:sql sql='select * from `__PREFIX__arctype` where id = 1' id='field'}
    栏目ID:{$field.id}
    栏目名称:{field:typename}
    栏目链接:{field:typeurl}

(图1)

{/eyou:sql}
或者
{eyou:type typeid='1' id='field'}
    栏目ID:{$field.id}
    栏目名称:{field:typename}
    栏目链接:{field:typeurl}
{/eyou:type}

------------------------------- 示例3,sql标签可以用php标签代替 ----------------------------
织梦:调用指定栏目的数据,比如栏目ID是1
{dede:sql sql="select * from dede_arctype where id=1"}
    栏目ID:[field:id/]
    栏目名称:[field:typename/]
    栏目链接:[field:typelink/]
{/dede:sql}
 
易优:调用指定栏目的数据,比如栏目ID是1
{eyou:php}
    $sql = 'select * from ey_arctype';
    $tmp_list = db()->query($sql);
    foreach ($tmp_list as $_k => $_v) {
        echo "栏目ID:".$_v['id'];
        echo " -- ";
        echo "栏目名称:".$_v['typename'];
        echo " -- ";
        echo "栏目链接:".typeurl('home/Lists/index', $_v);
        echo "<br/>";
    }
{/eyou:php}


收藏

相关文章

加载中~
模板购买咨询
定制仿站咨询
24小时客服
18030990768
模板购买咨询
定制仿站咨询
24小时客服
18030990768