ppypp伦理天堂,91手机在线视频,免费在线观看黄色毛片,夜夜穞天天穞狠狠穞AV美女按摩

聯系官方銷售客服

1835022288

028-61286886

投訴 已解決 織夢搭建的網站,模板也轉成迅睿的了,手機端圖片顯示不出來了 8 0
csmaliya 免費用戶 2021-12-20 10:58:05 私信
迅睿CMS版本:4.5.2

之前織夢搭建的網站,模板使用了mip的,沒有分手機端和PC端,然后都可以正常顯示

現在轉迅睿了,然后建的PC,模板也轉成迅睿的了,然后圖片顯示不出來了,我把<mip-img src=""></mip-img>的代碼換成<img src="" />后PC端就可以顯示了,但是手機端又不能同比例縮放了

各位大佬,有什么解決辦法么?

我是小白一枚,只會粗淺的一點代碼!!!!!

解決方案
  • 回復迅睿框架創始人 沒有可以解決的答案,大佬,因為我想把織夢網轉到迅睿,鏈接不要變,所以我在迅睿里面沒有建手機站的,只建PC站,然后現在使用MIP的話,就顯示不出圖片,不使用MIP的話,手機打開網站圖片不會自動縮放

  • 我跟你同樣的情況,我用一樓提供的替換url為絕對域名就搞定了
    QQ3468663191-Thinkphp高級開發者
  • 回復@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不用去動么?只要把圖片路徑替換成絕對路徑就可以了么?不用加手機端的模板么?

  • 不需要去動模板,只需要替換下就行了
    滿意答案
    短信幣+1
    QQ3468663191-Thinkphp高級開發者
  • 回復@LandQ 好的,我試試,感謝大佬


  • 回復@云畔設計 好的,感謝大佬,我先試試,得重裝下迅睿才行,被我改的不成樣子了,汗 ?? ?? ??

  • @云畔設計:已解決,感謝