您现在的位置是:首页 > 教程 > 帝国CMS教程帝国CMS教程
帝国CMS批量提取新闻内容第一张图作为标题缩略图的方法
棕浩2023-02-01 23:45:38帝国CMS教程已有人查阅
导读执行以下脚本的时候请 先备份数据库!文本存放的新闻正文字段不可用!新闻正文字段作为主表的情况用以下语句:新闻正文字段作为副表的情况用以下语句:
执行以下脚本的时候请 先备份数据库!文本存放的新闻正文字段不可用!新闻正文字段作为主表的情况用以下语句:
update phome_ecms_news set titlepic =concat(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(newstext, 'src=', -1),'.gif',1),'"',''),'.gif') where newstext like '%.gif%' and titlepic='';
update phome_ecms_news set titlepic =concat(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(newstext, 'src=', -1),'.jpg',1),'"',''),'.gif') where newstext like '%.jpg%' and titlepic='';
update phome_ecms_news set titlepic =concat(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(newstext, 'src=', -1),'.png',1),'"',''),'.png') where newstext like '%.png%' and titlepic='';
新闻正文字段作为副表的情况用以下语句:
update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.titlepic=concat(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(a.newstext, 'src=', -1),'.gif',1),'"',''),'.gif') where a.newstext like '%.gif%' and b.titlepic='' and a.id=b.id;
update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.titlepic=concat(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(a.newstext, 'src=', -1),'.jpg',1),'"',''),'.jpg') where a.newstext like '%.jpg%' and b.titlepic='' and a.id=b.id;
update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.titlepic=concat(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(a.newstext, 'src=', -1),'.png',1),'"',''),'.png') where a.newstext like '%.png%' and b.titlepic='' and a.id=b.id;
本文标签:
很赞哦! ()
相关文章
随机图文
-
帝国cms二次开发实现纯JS版的地区联动筛选功能
帝国CMS地区联动插件网上很多,但如何配合筛选功能却没有。看到论坛上很多人需要找这个,我的站长站www.ebingou.cn为大家分享一款二次开发的纯JS版的地区联动筛选功能。 -
帝国CMS灵动标签怎么调用友情链接的方法
帝国CMS默认的友情链接标签内置的格式太坑了,无法满足个性化需求。可使用灵动标签来调用:调用文字链接: -
帝国CMS视频播放页怎么调用上一集下一集
打开播放器的php文件 在eDownSysplay下比如 flasher.php查找这行代码:ViewOnlineKFen($showdown_r,$u,$u[$user_userid],$classid,$id,$pathid,$r); -
帝国cms数据表phome_enewsmemberfeedback会员空间反馈表
帝国cms数据表phome_enewsmemberfeedback会员空间反馈表字段名字段类型解释fidint(10) unsigned反馈IDnamevarchar(12)姓名companyvarchar(80)公司名称
留言与评论 (共有 条评论) |