织梦文章内容页添加二维码

找到/include/extend.func.php文件

在最下面加入

if ( ! function_exists('qr_code'))

{

function qr_code($aid,$widhtHeight ='150',$EC_level='L',$margin='0')

{

$arr = GetOneArchive($aid);

if($arr['arcurl']){

$str = urlencode($arr['arcurl']);

}else{

$str = urlencode($GLOBALS['cfg_phpurl'].'/view.php?aid='.$aid);

}

return '<img src="?chs='.$widhtHeight.'x'.$widhtHeight.'&cht=qr&chld='.$EC_level.'|'.$margin.'&chl='.$str.'" alt="QR code" widhtHeight="'.$widhtHeight.'" widhtHeight="'.$widhtHeight.'"/>';

}

}

文章页模板调用,

{dede:field.id function="qr_code(@me,200);"/}

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wsfzsz.html