找到/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="http://chart.apis.google.com/chart?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);"/}