温馨提醒
如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢
本文最后更新于2023年10月23日,已超过 180天没有更新
1、打开文件/include/extend.func.php,在文件最后添加:
/*** dedecms当前文章添加二维码及调用代码***/ 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.'"/>'; } }
2、在文章页通过{dede:field.id function="qr_code(@me,200);"/}即可调用二维码图片。
备注:其中200为图片大小。
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
评论0+