国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.2KB

  1. <?php
  2. $cfg_NotPrintHead='Y';
  3. require_once(dirname(__FILE__).'/../include/common.inc.php');
  4. require_once(DEDEINC.'/qrcode.class.php');
  5. $action = isset($action)? $action : '';
  6. $type = isset($type)? RemoveXSS(HtmlReplace($type,3)) : '';
  7. $id = (isset($id) && is_numeric($id)) ? $id : 0;
  8. if ( !in_array($type,array('list','arc','index')) ) $url = "http://2v.dedecms.com";
  9. if ( $action=='get_qrcode' )
  10. {
  11. if ( $type=='arc' )
  12. {
  13. $url = $cfg_basehost.$cfg_plus_dir.'/view.php?aid='.$id;
  14. } elseif ( $type=='list' )
  15. {
  16. $url = $cfg_basehost.$cfg_plus_dir.'/list.php?tid='.$id;
  17. }
  18. if($id==0) $url = "http://2v.dedecms.com";
  19. if ( $type=='index' ) $url = $cfg_basehost.$cfg_plus_dir.'/index.php';
  20. header("Content-Type: image/png");
  21. $params=array();
  22. $params['data'] = $url;
  23. $params['size'] = 6;
  24. $qrcode = new DedeQrcode;
  25. $qrcode->generate($params);
  26. } else {
  27. header("Content-Type: text/html; charset={$cfg_soft_lang}");
  28. $dtp = new DedeTemplate();
  29. $tplfile = DEDETEMPLATE.'/plus/qrcode.htm';
  30. $dtp->LoadTemplate($tplfile);
  31. $dtp->SetVar('id',$id);
  32. $dtp->SetVar('type',$type);
  33. $dtp->Display();
  34. exit();
  35. }