Home > CMS Tutorial > DEDECMS > How to replace keywords in dedecms

How to replace keywords in dedecms

藏色散人
Release: 2023-02-24 09:21:50
Original
1660 people have browsed it

Dedecms method to replace keywords: 1. Find the "include/arc.archives.class.php" file; 2. Find "function _highlight($string, $words, $result, $) in the file pre) {...}" code, and then add "uasort($words,create_function('$a, $b'...)" after the code.

How to replace keywords in dedecms

The operating environment of this tutorial: Windows 10 system, DedeCMS version 5.7, Dell G3 computer.

How to replace keywords in dedecms?

DedeCMS Website keyword batch replacement

There will be many keywords in the DedeCMS Dreamweaver template, but the length of the keywords is different, so when replacing, you must replace the short ones first, and then replace the long ones, so Only then can it be completely replaced.

Find the file include/arc.archives.class.php, at line 1226, that is:

function _highlight($string, $words, $result, $pre) {     global $cfg_replace_num;     $string = str_replace('"', '"', $string);
Copy after login

Add a piece of code at the end:

function _highlight($string, $words, $result, $pre) {     global $cfg_replace_num;     $string = str_replace('"', '"', $string);     uasort($words,create_function('$a, $b','return strlen($a)>strlen($b);'));
Copy after login

Related introduction:

Dreamweaver Content Management System (DedeCms) is famous for its simplicity, practicality, and open source, and is the most well-known PHP in China The open source website management system is also the PHP CMS system with the most users. After years of development, the version has made great progress in terms of functionality and ease of use. The main target users of the free version of DedeCms are targeted In personal webmasters, the function is more focused on the construction of personal websites or small and medium-sized portals. Of course, there are also corporate users and schools using this system.

In August 2004, Lin Xue wrote DedeCMS, which is still there today Used by hundreds of thousands of enterprises and individual webmasters.

Recommended learning: dedecms tutorial

The above is the detailed content of How to replace keywords in dedecms. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template