迅睿CMS框架是一款PHP8高性能·簡單易用的CMS開源開發框架,基于MIT開源許可協議發布,免費且不限制商業使用,是免費開源的產品,以萬端互聯為設計理念,支持的微信公眾號、小程序、APP客戶端、移動端網站、PC網站等多終端式管理系統。
聯系官方銷售客服
1835022288
028-61286886
之前織夢搭建的網站,模板使用了mip的,沒有分手機端和PC端,然后都可以正常顯示
現在轉迅睿了,然后建的PC,模板也轉成迅睿的了,然后圖片顯示不出來了,我把<mip-img src=""></mip-img>的代碼換成<img src="" />后PC端就可以顯示了,但是手機端又不能同比例縮放了
各位大佬,有什么解決辦法么?
我是小白一枚,只會粗淺的一點代碼!!!!!
http://www.zbshanke.com/wenda/43619.html
往下拉,手機端圖片問題
回復迅睿框架創始人 沒有可以解決的答案,大佬,因為我想把織夢網轉到迅睿,鏈接不要變,所以我在迅睿里面沒有建手機站的,只建PC站,然后現在使用MIP的話,就顯示不出圖片,不使用MIP的話,手機打開網站圖片不會自動縮放
回復@csmaliya 試試這樣
1、打開 config/custom.php 加入
/**
* MIP文章內容頁圖片適配百度MIP規范
*
* @access public
* @param string $content 文章內容
* @return string
*/
if(!function_exists('mip'))
{
function mip($content){
preg_match_all('/<img (.*?)\>/', $content, $images);
if(!is_null($images)) {
foreach($images[1] as $index => $value){
$mip_img = str_replace('<img', '<mip-img', $images[0][$index]);
$mip_img = str_replace('>', '></mip-img>', $mip_img);
$mip_img = preg_replace('/(width|height)="\d*"\s/', '', $mip_img );
$mip_img = preg_replace('/ style=\".*?\"/', '',$mip_img);
$content = str_replace($images[0][$index], $mip_img, $content);
}
preg_match_all('/ style=\".*?\"/', $content, $style);
if(!is_null($style)) {
foreach($style[0] as $index => $value){
$mip_style = preg_replace('/ style=\".*?\"/', '',$style[0][$index]);
$content = str_replace($style[0][$index], $mip_style, $content);
$content = str_replace('/uploads/', SITE_URL.'/uploads/', $content);
return $content;
2、內容模板調用標簽
{$content}
改成
{mip($content)}
回復@云畔設計 那MIP不用去動么?只要把圖片路徑替換成絕對路徑就可以了么?不用加手機端的模板么?
回復@LandQ 好的,我試試,感謝大佬
回復@云畔設計 好的,感謝大佬,我先試試,得重裝下迅睿才行,被我改的不成樣子了,汗 ?? ?? ??
http://www.zbshanke.com/wenda/43619.html
往下拉,手機端圖片問題
回復迅睿框架創始人 沒有可以解決的答案,大佬,因為我想把織夢網轉到迅睿,鏈接不要變,所以我在迅睿里面沒有建手機站的,只建PC站,然后現在使用MIP的話,就顯示不出圖片,不使用MIP的話,手機打開網站圖片不會自動縮放
回復@csmaliya 試試這樣
1、打開 config/custom.php 加入
/**
* MIP文章內容頁圖片適配百度MIP規范
*
* @access public
* @param string $content 文章內容
* @return string
*/
if(!function_exists('mip'))
{
function mip($content){
preg_match_all('/<img (.*?)\>/', $content, $images);
if(!is_null($images)) {
foreach($images[1] as $index => $value){
$mip_img = str_replace('<img', '<mip-img', $images[0][$index]);
$mip_img = str_replace('>', '></mip-img>', $mip_img);
$mip_img = preg_replace('/(width|height)="\d*"\s/', '', $mip_img );
$mip_img = preg_replace('/ style=\".*?\"/', '',$mip_img);
$content = str_replace($images[0][$index], $mip_img, $content);
}
}
preg_match_all('/ style=\".*?\"/', $content, $style);
if(!is_null($style)) {
foreach($style[0] as $index => $value){
$mip_style = preg_replace('/ style=\".*?\"/', '',$style[0][$index]);
$content = str_replace($style[0][$index], $mip_style, $content);
}
}
$content = str_replace('/uploads/', SITE_URL.'/uploads/', $content);
return $content;
}
}
2、內容模板調用標簽
{$content}
改成
{mip($content)}
回復@云畔設計 那MIP不用去動么?只要把圖片路徑替換成絕對路徑就可以了么?不用加手機端的模板么?
回復@LandQ 好的,我試試,感謝大佬
回復@云畔設計 好的,感謝大佬,我先試試,得重裝下迅睿才行,被我改的不成樣子了,汗 ?? ?? ??