Moment For Technology

Empire CMS body images automatically add Alt as the title, support to add and modify!

Posted on Dec. 2, 2022, 6:57 p.m. by Donna Morgan
Category: The back-end Tag: php The back-end

Select * from 'e/class/userfun.php' where 'e/class/userfun.php' = 'userfun.php'

function user_AddImgAlt($mid,$f,$isadd,$isq,$value,$cs){ $value=stripSlashes($value); $title=stripSlashes($_POST['title']); $title=str_replace('"','',$title); $zz2="/(img|IMG) (.*?) alt="(.*?) "(. *?) /is"; $text=preg_replace($zz2,"\1 \2\4",$value); $zz1="/(img|IMG) (.*?) /is"; $text=preg_replace($zz1,"\1 alt="{$title}" \2",$text); return $text; }Copy the code

2. Modify the text field in the data table

The data tables that require this feature need to be modified. The body field is usually newstext (or any other field), and user_AddImgAlt is entered in the field handler text box

Search
About
mo4tech.com (Moment For Technology) is a global community with thousands techies from across the global hang out!Passionate technologists, be it gadget freaks, tech enthusiasts, coders, technopreneurs, or CIOs, you would find them all here.