温馨提醒

如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢

本文最后更新于2025年4月28日,已超过 180天没有更新

数据库:

1.主表增加 newstextImgs 字段 在数据库里操作

2.修改文件 e/class/hinfofun.php 把下面代码放到指定位置

增加信息函数:
//信息地址
$updateinfourl='';
if(!$add['isurl'])
{
$infourl=GotoGetTitleUrl($add['classid'],$id,$newspath,$filename,$add['groupid'],$add['isurl'],$add['titleurl']);
$updateinfourl=",titleurl='$infourl'";
}
 
//自定义 - 获取文章中图片地址集 - 增加信息
$newstextImgs='';
$newstextImgsArr = GetnewstextImgs($add['classid'],$id,4,$public_r['filedeftb']);
if($newstextImgsArr){
$newstextImgs = ",newstextImgs='".$newstextImgsArr."'";
}
 
 
$usql=$empire->query("update ".$infotbr['tbname']." set filename='$filename'".$updateinfourl.$addtitlepic.$newstextImgs." where id='$id'");

修改信息函数:

//更新附件
UpdateTheFileEdit($add['classid'],$add['id'],$checkr['fstb']);
 
//自定义 - 获取文章中图片地址集 - 修改信息
$newstextImgsArr = GetnewstextImgs($add['classid'],$add['id'],4,$checkr['fstb']);
if($newstextImgsArr)
{
$usql=$empire->query("update ".$infotbr['tbname']." set newstextImgs='".addslashes($newstextImgsArr)."' where id='$add[id]'");
}

3.修改文件 e/class/functions.php 把下面代码放到指定位置

//自定义 - 获取文章中图片地址集
function GetnewstextImgs($classid,$id,$num=3,$fstb=1){
    global $empire,$dbtbpre,$public_r,$class_r;
    $pubid=ReturnInfoPubid($classid,$id);
    $num=(int)$num;
    
    $picArr_sql=$empire->query("select fileid,filename,path,id,classid,no,fpath from {$dbtbpre}enewsfile_{$fstb} where pubid='$pubid' and type=1 order by fileid limit 3");
    $newstextImgs='';
    
    while($picArr=$empire->fetch($picArr_sql))        //循环获取查询记录
    {
        $rpath=$picArr['path']?$picArr['path'].'/':$picArr['path'];
        $fspath=ReturnFileSavePath($picArr[classid],$picArr[fpath]);
        $newstextImgs .= $fspath['fileurl'].$rpath.$picArr[filename] .'|||';
    }
    $newstextImgs = rtrim($newstextImgs, "|||");
    return $newstextImgs;
    
}

 

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系客服QQ3387285338进行处理。