In dedecms, the LOOP universal tag cyclically calls 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 = ''}
<A href = '[field: arcurl/]'> [field: title/] </a>
{/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 = ''}
<Li> · <a href = '[field: id function = IDReturnURL (@ me)/]'> [field: title function = cn_substrR (@ me, 44) /] </a> </li>
{/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
In the zhimeng php code,
[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.