The LOOP universal tag in dedecms calls the arcurl tag (get link) cyclically. dedecmsarcurl_PHP tutorial

Source: Internet
Author: User
In dedecms, the LOOP universal tag calls the arcurl tag (get link) and dedecmsarcurl cyclically. In dedecms, the LOOP universal tag calls the arcurl tag (get link) cyclically. in dedecmsarcurl, the loop universal LOOP tag is provided in DEDECMSV5.3, however, this LOOP tag can only LOOP out the LOOP universal tag in dedecms and call the arcurl tag (get link) and dedecmsarcurl.

The loop universal loop label is provided in DEDECMSV5.3, but this loop label can only loop out fields in the table, and the "[field: arcurl/]" link label cannot be parsed, the DEDECMS official forum did not find any related solutions, so I had to write the code myself!

This is the official code:
{Dede: loop table = 'dede _ archives 'sort = ''row = '4' if = ''}
[Field: title/]
{/Dede: loop}
Here are my solutions:

1. open Include/common. func. php and find 54 rows. add a function code 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 method of calling 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 solved perfectly!

    The same is true when you use custom SQL labels.

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



    In the SQL label

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

    You can also call it out.


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

    Href = do not use quotation marks

    Zhimeng php code How does arcurl change the connection address?

    [Field: arcurl/] This code indicates that when you call an article, you can call the corresponding link. if you change it to a link, all the articles are such links.

    In includecms, the LOOP universal tag calls the arcurl tag (get link) cyclically. in dedecmsarcurl, the loop universal LOOP tag is provided in DEDECMSV5.3, but this loop tag can only be cyclically generated...

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.