织梦自动生成手机网站源码

织梦自动生成手机网站源码

时间:2019-04-29 作者:xphero210 评论:0 点击:1284 次

生成手机站先要处理图片路径问题,不然不显示的

QQ截图20181201175133.jpg

织梦自动生成手机网站源码:

sj.rar这是GBK,

还有一个UTF的

utf.rar

传图片绝对地址设置

登录dedecms网站后台-附件管理-文件式管理器

根据路径依次找到:include\dialog\select_images_post.php 第108行,找到代码:


$fileurl = 'http://www.hzxhyj.com'.$activepath.'/'.$filename;

将其替换成:$fileurl = 'http://你的域名'.$activepath.'/'.$filename;


然后保存!!!


复制图片为绝对路径


打开include/extend.func.php,在此文件里面添加一个函数:


function replaceurl($newurl)  

{  

$newurl=str_replace('src="/uploads/allimg/','src="http://你的域名/uploads/allimg/',$newurl);  

return $newurl;  

}  

需要注意的是,一旦添加了这个函数,就必须在文章内容调用的标签替换一下。也就是把之前的


{dede:field.body/}


标签改成


{dede:field.body function='replaceurl(@me)'/}

执行完以上步骤之后,更新系统缓存,这时候再去上传图片,就是绝对地址了!

基本参数网址改成绝对路径

如果改不了先进行下一步

打开基本参数里的系统基本参数出错

如果打开基本参数里的系统基本参数出错,则要修改打开/dede/sys_info.php,找到201行,这里我们的make_hash前页加上//进行屏蔽。最好是加个代码

function make_hash()

{

    $rand = dede_random_bytes(16);

    $_SESSION['token'] = ($rand === FALSE)

        ? md5(uniqid(mt_rand(), TRUE))

        : bin2hex($rand);

    return $_SESSION['token'];

}

function dede_random_bytes($length)

{

    if (empty($length) OR ! ctype_digit((string) $length))

    {

        return FALSE;

    }

    if (function_exists('random_bytes'))

    {

        try

        {

            return random_bytes((int) $length);

        }

        catch (Exception $e)

        {

            return FALSE;

        }

    }

    if (defined('MCRYPT_DEV_URANDOM') && ($output = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM)) !== FALSE)

    {

        return $output;

    }

    if (is_readable('/dev/urandom') && ($fp = fopen('/dev/urandom', 'rb')) !== FALSE)

    {

        is_php('5.4') && stream_set_chunk_size($fp, $length);

        $output = fread($fp, $length);

        fclose($fp);

        if ($output !== FALSE)

        {

            return $output;

        }

    }

    if (function_exists('openssl_random_pseudo_bytes'))

    {

        return openssl_random_pseudo_bytes($length);

    }

    return FALSE;

}


已有 1284 位网友参与,快来吐槽:

发表评论

必填

选填

选填

◎欢迎参与讨论,发表您的看法、交流您的观点。