search
HomeCMS TutorialDEDECMSWhat should I do if TAG is lost due to upgrading dedecms5.1 to 5.3?

What should I do if TAG is lost due to upgrading dedecms5.1 to 5.3?

dedecms5.1 is upgraded to 5.3 and what should I do if the TAG is lost?

dedecms5.1 is upgraded to 5.3 Dealing with issues such as TAG loss

It is now possible to display TAGs on article pages with links normally, and the TAGs of articles before the upgrade have been restored. Here are the specific solutions. The main thing is that the last sql sentence can be executed as follows.

Recommended study: 梦Weavercms

In fact, many people have already answered the answer to the TAG problem on the forum. Maybe everyone has not tried it seriously. It's not that the code provided by others is wrong

, but that you can't completely COPY their code. Many codes need to modify the data table prefix before they can be used.

The following is my method to solve the TAG problem:

First, call the TAG code of the current article on the article page:

Use Tag directly: {dede:field.tags /} Replace the original code

For example, my website used to obtain the TAG code of the current article like this. Note that the red part is the code, and the black part is whatever you want:

Tag:{dede:tag type= 'current'/}

So the original code to display the TAG place now is:

Tag: {dede:field.tags/}

The above is the first one, Next, we need to modify the related files of DEDE CMS. Open the file \include\common.func.php

Find //Get all tags of a document and put the following codes

The code is as follows:

function GetTags($aid) 
{ 
global $dsql; 
$tags = ''; 
$query = "Select tag From [url=mailto:`ddmx_taglist]`ddmx_taglist[/url]` where aid='$aid' "; 
$dsql->Execute('tag',$query); 
while($row = $dsql->GetArray('tag')) 
{ 
$tags .= ($tags=='' ? $row['tag'] : ','.$row['tag']); 
} 
return $tags; 
} 
function ParamError() 
{ 
ShowMsg('对不起,你输入的参数有误!','javascript:;'); 
exit(); 
}

is replaced by the following codes. During this period, you should modify your table prefix according to your actual situation.

Pay attention to the 'dede_dedecmstaglist' below and modify it according to your own table prefix.

The code is as follows:

function GetTags($aid) 
{ 
global $dsql; 
$tags = ''; 
$query = "Select tag From `dede_dedecmstaglist` where aid='$aid' "; 
$dsql->Execute('tag',$query); 
while($row = $dsql->GetArray('tag')) 
{ 
$tags .= ($tags==&#39;&#39; ? "<a href=/tags.php?/{$row[&#39;tag&#39;]} target=_blank>{$row[&#39;tag&#39;]}</a>" : &#39;,&#39;."<a href=/tags.php?/{$row[&#39;tag&#39;]} target=_blank>{$row[&#39;tag&#39;]}</a>"); 
} 
return $tags; 
} 
function ParamError() 
{ 
ShowMsg(&#39;对不起,你输入的参数有误!&#39;,&#39;javascript:;&#39;); 
exit(); 
}

OK, now as long as the TAG of your article is not lost, you can call the linked article TAG on the article page after completing the above steps.

If your TAG is lost during the upgrade process, then perform the following steps.

Enter your website management background

Select "System"----------"SQL Command Line Tool"

Run SQL command:

The code is as follows:

UPDATE dede_tagindex,dede_taglist SET dede_taglist.tag = dede_tagindex.tag WHERE dede_taglist.tid=dede_tagindex.id;

Be careful not to COPY the above code completely, and modify the table prefix according to your actual situation.

The above is the detailed content of What should I do if TAG is lost due to upgrading dedecms5.1 to 5.3?. For more information, please follow other related articles on the PHP Chinese website!

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

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)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development 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.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment