


dede:What to do if there is an error in the association between likearticle article tags and tag tags
##dede: What should I do if the likearticle article tag and tag tag are incorrectly associated?
Dreamweaver 5.7 has a dede:likearticle tag that is used to associate articles, but during the process of using it, we found that this association is really useless, but the author found that everyone is using Dreamweaver Is it still acceptable when searching for 5.7? The author replaced the search function of dede with this likearticle, and it seems to be much better. Recommended learning: Code IntroductionThe author changed the default keywords to associate articles with tags, and A judgment has been added. After executing the fuzzy query based on tags, if the query data is empty, directly query all the recommended articles under this column again. This is better, that is, there is always a return value. The author considers that some articles do not have tags, and some articles have tags but no article is found, so he first determines whether there are tags. If not, he directly queries the recommended articles in this column. If there are tags, the article is not found. If empty articles are found, recommended articles under the current column will also be returned. Solutions/steps for associating likearticle and tag tagsStep 1: Use Notepad or some tools to open the file "root directory\include\taglib\likearticle.lib.php". Step 2: Search for "['keywords']", replace all with ['tags'] and save. Computer Mutual Aid Network Note: Original code line 55: $keyword = (!empty($refObj->Fields['keywords']) ? $refObj->Fields[ 'keywords'] : '' );Original code line 75: if(!empty($refObj->Fields['keywords']))Original code line 77:$ keywords = explode(',' , trim($refObj->Fields['keywords']));Step 3: Add "$keyword .= $keyword=='' under line 87 ? " CONCAT(arc.title,arc.keywords,arc.shorttitle) REGEXP '($k)'": " OR CONCAT(arc.title,arc.keywords,arc.shorttitle) REGEXP '($k)'"; "Logout at line 87 of the source code: //$keyword .= ($keyword=='' ? " CONCAT(arc.keywords,' ',arc.title) LIKE '%$k%' " : " OR CONCAT(arc.keywords,' ',arc.title) LIKE '%$k%' ");/** 按tag标签关联文章内容 query2为备用,如果query为空的话,第二个就直接显示出来 */ $query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule, tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath FROM `dede_archives` arc LEFT JOIN `dede_arctype` tp on arc.typeid=tp.id WHERE $keyword and arc.ismake = 1 and arc.id <> $arcid ORDER BY arc.sortrank desc LIMIT 0,$row"; $typeids=$refObj->Fields['typeid'];//取出当前栏目ID $query2 = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule, tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath FROM `dede_archives` arc LEFT JOIN `dede_arctype` tp on arc.typeid=tp.id WHERE FIND_IN_SET('c', arc.flag)>0 and arc.ismake = 1 And (arc.typeid in ($typeids) or arc.typeid2 in($typeids) or CONCAT( ',', arc.typeid2, ',' ) LIKE '%,$typeids,%' ) And arc.arcrank > -1 ORDER BY arc.sortrank desc LIMIT 0,$row"; /*query3是判断是否为空用的*/ $query3 = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule, tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath FROM dede_archives arc LEFT JOIN dede_arctype tp on arc.typeid=tp.id WHERE $keyword and arc.ismake = 1 and arc.id <> $arcid ORDER BY arc.sortrank desc LIMIT 0,$row";//这里的SQL具体按自己的数据库的表字段写吧,我这是直接写死了,哎没办法,能力有限。 /* 这里是判断tags标签查询的是否为空值,如果是空值,就全部使用推荐返回值,如果有值,就直接显示tags关联。 */ $result =mysql_query($query3);//query36判断专用的,主要是作者不会用SetQuery呀,郁闷。我是直接拼的SQL if(mysql_num_rows($result)<1){ $dsql->SetQuery($query2); }else{ $dsql->SetQuery($query); }The following is a picture of all logouts from lines 101 to 107 of the source code. Click on the picture to see a larger picture:
$typeids=$refObj->Fields['typeid'];//取出当前栏目ID $query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule, tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath FROM `dede_archives` arc LEFT JOIN `dede_arctype` tp on arc.typeid=tp.id WHERE FIND_IN_SET('c', arc.flag)>0 and arc.ismake = 1 And (arc.typeid in ($typeids) or arc.typeid2 in($typeids) or CONCAT( ',', arc.typeid2, ',' ) LIKE '%,$typeids,%' ) And arc.arcrank > -1 ORDER BY arc.sortrank desc LIMIT 0,$row"; $dsql->SetQuery($query);The following is a picture of all logouts from lines 111 to 117 of the source code. Click on the picture to see a larger picture:
The above is the detailed content of dede:What to do if there is an error in the association between likearticle article tags and tag tags. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

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.

Atom editor mac version download
The most popular open source editor

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.