search
HomeBackend DevelopmentPHP TutorialLOOP universal tag loop in Dedecms dedecms calls arcurl tag (get link), dedecmsarcurl_PHP tutorial

In DEDECMSV5.3, the loop universal loop tag is provided, but this loop tag only The fields in the table can be looped out, but the "[field:arcurl/]" link tag cannot be parsed, and there is no relevant solution found on the official DEDECMS forum, so I have to write the code myself!

This is the official code:
{dede:loop table='dede_archives' sort='' row='4' if=''}
[field:title/]
{/dede:loop}
The following is my solution:

1. Open Include/common. func.php, find line 54, and add a function code here as follows:

function IDReturnURL($ID)
{
global $dsql;
$query = "Select arc.* ,tp.typedir,tp.typename,tp.corank,tp.isdefault,
tp.defaultname,tp.namerule,tp.moresite,tp.siteurl,tp.sitepath
from dede_archives arc left join dede_arctype tp on arc.typeid=tp.id where arc.id = ".$ID;
$row = $dsql->GetOne($query);
$ReturnURL = GetFileUrl($row['id'], $row['typeid'],$row['senddate'],$row['title'],$row['ismake'],
$row['arcrank'],$row['namerule'] ,$row['typedir'],$row['money'],$row['filename'],$row['moresite'],$row['siteurl'],$row['sitepath']);
return $ReturnURL;
}
2. The writing of our calling method in the template has also changed. The code is as follows:

{dede:loop table='dede_archives' sort= '' row='4' if=''}

  • ·[field:title function=cn_substrR( @me,44)/]

  • {/dede:loop}
    The problem has been perfectly solved!

    The same is true when you want to use custom sql tags.

    Actually, [field:id function=IDReturnURL(@me)/] is used instead of [field:arcurl/] tag. The core of my solution to this problem is [field:id function=IDReturnURL(@me )/] and IDReturnURL!



    In sql tag

    [field:id runphp='yes']$arcRow=GetOneArchive(@me);@me=$arcRow['arcurl' ];[/field:id]

    can also be called out.

    The tag datalist in dedecms calls arcurl to point it to the content page

    Do not use quotation marks after href=

    How to change the arcurl connection address in the DreamWeaver PHP code?

    [field:arcurl/]The meaning of this code is that when adjusting an article, adjust the corresponding link. If you change it to a link, all articles will have such links.


    http://www.bkjia.com/PHPjc/849147.html

    www.bkjia.com

    truehttp: //www.bkjia.com/PHPjc/849147.htmlTechArticleThe LOOP universal tag in dedecms calls the arcurl tag in a loop (get the link), dedecmsarcurl is provided in DEDECMSV5.3 The loop universal loop tag is provided, but this loop tag can only loop out...
    Statement
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    织梦如何导入css织梦如何导入cssDec 03, 2020 pm 04:03 PM

    织梦导入css的方法:1、将HTML模板文件放到“templets”文件夹中;2、将HTML文件的后缀改成“.htm”;3、在原先的样式路径前加上“{dede:global.cfg_templets_skin/}”即可。

    dedecms怎么增加多语言dedecms怎么增加多语言Feb 27, 2023 am 09:21 AM

    dedecms增加多语言的方法:1、进入dedecms后台,创建封面栏目;2、将封面栏目“常规选项”的文件保存目录设置为cn或者en;3、将封面栏目“高级选项”的列表模板设置为“cn_index.htm”或者“en_index.htm”;4、单独调用每种语言的封面栏目和每种语言下的导航栏目即可。

    织梦cms是什么语言写的织梦cms是什么语言写的Feb 21, 2023 am 09:45 AM

    织梦cms是用PHP语言写的。织梦CMS(DedeCMS)是一个PHP开源网站管理系统,作用是构建中小型网站;它采用PHP+MySQL技术开发,可同时使用于windows、linux、unix平台。

    dedecms是什么语言dedecms是什么语言Feb 24, 2023 am 09:46 AM

    dedecms是PHP语言开发的;dedecms中文全称是织梦内容管理系统,是一个PHP开源网站管理系统;dedecms基于PHP和MySQL技术开发,可同时使用于Windows、Linux、Unix平台。

    2023年织梦dedeCMS视频教程推荐2023年织梦dedeCMS视频教程推荐Oct 25, 2019 pm 01:56 PM

    织梦内容管理系统(DedeCMS) 以简单、实用、开源而闻名,是国内最知名的PHP开源网站管理系统,也是使用用户最多的PHP类CMS系统,在经历多年的发展,目前的版本无论在功能,还是在易用性方面,都有了长足的发展和进步。

    dedecms是干什么的dedecms是干什么的Feb 22, 2023 am 09:14 AM

    dedecms是指织梦内容管理系统,是一个PHP开源网站管理系统,用于个人网站或中小型门户的构建;dedecms是基于PHP和MySQL技术开发,可同时使用于Windows、Linux、Unix平台。

    DedeCMS创始人林学(IT 柏拉图)逝世DedeCMS创始人林学(IT 柏拉图)逝世Dec 05, 2022 am 11:54 AM

    12 月 3 日下午,DedeCMS 创始人林学(IT 柏拉图)因罹患癌症逝世。林学生于 1979 年 10 月 10 日,于 2004 年 8 月编写的 DedeCMS 至今仍有数十万企业、个人站长使用。

    dedecms怎么取消验证码dedecms怎么取消验证码Feb 21, 2023 am 10:52 AM

    dedecms取消验证码的方法:1、打开“inc_safe_config.php”文件,将“$safe_gdopen = '1,2,3,5,6';”中的6删除;2、打开“login.htm”文件删除或注释验证码的具体HTML代码即可。

    See all articles

    Hot AI Tools

    Undresser.AI Undress

    Undresser.AI Undress

    AI-powered app for creating realistic nude photos

    AI Clothes Remover

    AI Clothes Remover

    Online AI tool for removing clothes from photos.

    Undress AI Tool

    Undress AI Tool

    Undress images for free

    Clothoff.io

    Clothoff.io

    AI clothes remover

    AI Hentai Generator

    AI Hentai Generator

    Generate AI Hentai for free.

    Hot Article

    R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
    2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
    Repo: How To Revive Teammates
    4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
    Hello Kitty Island Adventure: How To Get Giant Seeds
    4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

    Hot Tools

    Safe Exam Browser

    Safe Exam Browser

    Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

    ZendStudio 13.5.1 Mac

    ZendStudio 13.5.1 Mac

    Powerful PHP integrated development environment

    SublimeText3 English version

    SublimeText3 English version

    Recommended: Win version, supports code prompts!

    Zend Studio 13.0.1

    Zend Studio 13.0.1

    Powerful PHP integrated development environment

    Dreamweaver CS6

    Dreamweaver CS6

    Visual web development tools