Two ways to call the tag tag (top tab) on the dedecms5.5/5.6/5.7 list page

Source: Internet
Author: User

The dedecms5.5/5.6/5.7 list page calls the tag tag in two ways:
A, DedeCMSv5.6 and its previous versions:
Dedecms default in the list is unable to call the tag tag, after the help of the moderator, we now provide you with 2 ways.
Method 1:
Add the following code where you want the list:

  1. [Field:id runphp=Yes]
  2. $TSQL = new Dedesql (false);
  3. $tags = ';
  4. $tsql->setquery ("Select I.tagname from Dede_tag_list t left joins Dede_tag_index I on i.id=T.tid where t  . aid=' @me ');
  5. $tsql->execute (' t ');
  6. while ($row = $tsql->getarray (' t ', Mysql_assoc)) {
  7. $tags . = "<a href= '/tag.php?/". UrlEncode ($row [' tagname ']). "' > ". $row [' tagname ']."  </a> ";
  8. }
  9. @me= $tags;
  10. [/field:id]

Method 2:
Add the following code to the inc_functions.php file:

  1. function Listtag ($aid) {$TSQL =new dedesql (false);  $tags =  ";  $tsql->setquery (" select i.tagname from  Dede_tag_list t left join dede_tag_index i on i.id= t.tid where t.aid= ' $aid ' <a  href= '/tag.php?/". UrlEncode ($row [' Tagname> ". $row [' tagname ']." </a> "; } return  $tags;  }   

Then add the [Field:id function= Listtag (@me) "/] tag to the list page location.

Second, DedeCMSv5.7 version: The previous call code in the 5.6 upgrade to 5.7 of the system can be used normally, but the newly installed 5.7 system seems to be useless. The test found that the Dedecms v5.7 version uses the tag directly: [Field:id function=gettags (@me)/], it can be called out.  Just without the link, if you need a link, please comment out the 130 lines of the include\helpers\archive.helper.php file: $tags. = ($tags = = "? $row [' Tag ']: ', '. $row [' tag ']); Replace with the following statement, of course you can also add your own style: $tags. = "<a href= '/tags.php?/". UrlEncode ($row [' tag ']). " /' > '. $row [' tag ']. " </a> ";

Two ways to call the tag tag (top tab) on the dedecms5.5/5.6/5.7 list page

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.