Dream weaving dedecms implements automatic addition of alt attribute to pictures in content

June 2, 2010 22:30:53 Website construction one six hundred and thirty-seven

In fact, there are many methods on the Internet to add alt attributes to images in dedecms content, but some of them are not perfect or perfect, and some of the disadvantages are that the content in the body is not really modified every time, that is, the content saved in the database is not changed, but is modified before generating html, so the effect of adding alt titles is only expressed on the html page. However, there are ways to really modify the content (database content). Here I will summarize the perfect solution to this problem. The article originates from the fallen fish- https://www.duoluodeyu.com/483.html

Disadvantages of this method: when the content contains image code like img, it may be regarded as the image to be modified. If related files are involved in the upgrade, they need to be modified after the upgrade. The article originates from the fallen fish- https://www.duoluodeyu.com/483.html

Applicable version: DEDECMS V5.3 or above (not tried before, but it should be OK) The article originates from the fallen fish- https://www.duoluodeyu.com/483.html

Modify the file: dede/inc/inc_archives_functions.php The article originates from the fallen fish- https://www.duoluodeyu.com/483.html

Find the "//Small image of the large image in the atlas", and add the following code to it (the location does not need to be fixed, and other places can also be used): The article originates from the fallen fish- https://www.duoluodeyu.com/483.html

//Replace Picture Alt as Document Title
$body = str_ireplace(array('alt=""','alt=\'\''),'',$body);
$body = preg_replace("@ [\s] {0,}alt [\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU"," ",$body);
$body = str_ireplace("<img " ,"<img alt='".$title."' ",$body); The article originates from the fallen fish- https://www.duoluodeyu.com/483.html

If you encounter any problems in the practical process, please leave a message for me and I will answer them as soon as possible. The article originates from the fallen fish- https://www.duoluodeyu.com/483.html

 Xing Ming, founder of Tianya Community, responded to the closure for the first time Industry trends

Xing Ming, founder of Tianya Community, responded to the closure for the first time

On May 27, it was reported that Tianya Community was once one of the most influential websites on the Chinese Internet, and it was also the youth memory of many early generation netizens. However, since April 25, 2023, the old brand forum established in 1999 has been inaccessible, which has triggered heated discussion and nostalgia among netizens. Tianya Community
 Baidu Cloud accelerates the increase of domain name prompt: this domain name has used the anti screening service, please change the main domain name to access again Website construction

Baidu Cloud accelerates the increase of domain name prompt: this domain name has used the anti screening service, please change the main domain name to access again

When Baidu Cloud accelerated to add a domain name, it was prompted at the top of the page that this domain name has used the anti screening service, please change the main domain name to access again. This is because your domain name has set anti blocking settings in Baidu Alliance, which also uses Baidu Cloud to accelerate data distribution. To resolve the above
 anonymous

Comment

Anonymous netizens Fill in information

 :?:  :razz:  :sad:  :evil:  :!:  :smile:  :oops:  :grin:  :eek:  :shock:  :???:  :cool:  :lol:  :mad:  :twisted:  :roll:  :wink:  :idea:  :arrow:  :neutral:  :cry:  :mrgreen:

determine

Comments: 1 of which: visitor 1 blogger 0
    •  QQ tourists
      QQ tourists zero

      Boss, half of the images on my dream weaving website are not added with ALT. It's a huge amount of words to add manually. Is there any good way to deal with it