discuz 判断图片是否是404 ,更新图片封面信息

busycy

Administrator
管理成员
if($_G['forum']['fid'] == 71){
$ttttid = $post['tid'];
$img404 = DB::query("SELECT value FROM ".DB::table('forum_typeoptionvar')." where tid=$ttttid and optionid=16");//获取图片url
$img404 = mysqli_fetch_object($img404);
$imgurlurl= $img404->value;
$resimg = @file_get_contents($imgurlurl,null,null,0,10);

if (!$resimg){
// DB::query("INSERT INTO".DB::table('common_imgpd')('url')."VALUES(".$imgurlurl.")");
DB::query("UPDATE ".DB::table('forum_typeoptionvar')." set value='' where tid=$ttttid and optionid=16");
}

}
 
顶部