fetch($tid)) { exit; } dmkdir($dir); require_once DISCUZ_ROOT.'source/plugin/mobile/qrcode.class.php'; QRcode::png($url.'viewthread&tid='.$_GET['tid'].'&source=pcscan', $file, QR_ECLEVEL_Q, $qrsize); } dheader('Content-Disposition: inline; filename=qrcode_t'.$tid.'.jpg'); dheader('Content-Type: image/pjpeg'); @readfile($file); } else { require_once DISCUZ_ROOT.'source/plugin/mobile/qrcode.class.php'; QRcode::png($url.'showactivity&tid='.$_GET['tid'].'&viewpid='.$_GET['pid'].'&source=pcscan', false, QR_ECLEVEL_Q, $qrsize); } } elseif($_GET['fid']) { $qrsize = !empty($_GET['qrsize']) ? $_GET['qrsize'] : 2; $fid = dintval($_GET['fid']); $file = $dir.'qr_'.$fid.'.jpg'; if(!file_exists($file) || !filesize($file)) { if(!C::t('forum_forum')->fetch($fid)) { exit; } dmkdir($dir); require_once DISCUZ_ROOT.'source/plugin/mobile/qrcode.class.php'; QRcode::png($url.'index&fid='.$_GET['fid'].'&source=pcscan', $file, QR_ECLEVEL_Q, $qrsize); } dheader('Content-Disposition: inline; filename=qrcode_'.$fid.'.jpg'); dheader('Content-Type: image/pjpeg'); @readfile($file); } else { $qrsize = !empty($_GET['qrsize']) ? $_GET['qrsize'] : 2; $file = $dir.'qr_index.jpg'; if(!file_exists($file) || !filesize($file)) { dmkdir($dir); require_once DISCUZ_ROOT.'source/plugin/mobile/qrcode.class.php'; QRcode::png($url.'index&source=pcscan', $file, QR_ECLEVEL_Q, $qrsize); } dheader('Content-Disposition: inline; filename=qrcode_index.jpg'); dheader('Content-Type: image/pjpeg'); @readfile($file); } exit; } require_once DISCUZ_ROOT . './source/plugin/wechat/wechat.lib.class.php'; $wechat_client = new WeChatClient($_G['wechat']['setting']['wechat_appId'], $_G['wechat']['setting']['wechat_appsecret']); list($ticket, $code) = explode("\t", authcode($_G['cookie']['wechat_ticket'], 'DECODE')); if($ticket) { $file = $dir.md5($ticket).'_'.$code.'.jpg'; if(!file_exists($file) || !filesize($file)) { dmkdir($dir); $qrcode = dfsockopen($wechat_client->getQrcodeImgUrlByTicket($ticket)); $fp = @fopen($file, 'wb'); @fwrite($fp, $qrcode); @fclose($fp); } dheader('Content-Disposition: inline; filename=qrcode.jpg'); dheader('Content-Type: image/pjpeg'); @readfile($file); }