国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

41 řádky
1.4KB

  1. <?php
  2. /**
  3. * 二维码生成
  4. *
  5. * @version $Id: qrcode.php$
  6. * @package DedeBIZ.Site
  7. * @copyright Copyright (c) 2022, DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. $cfg_NotPrintHead = 'Y';
  12. require_once(dirname(__FILE__).'/../system/common.inc.php');
  13. require_once(DEDEINC.'/libraries/qrcode.class.php');
  14. $action = isset($action) ? $action : '';
  15. $type = isset($type) ? RemoveXSS(HtmlReplace($type, 3)) : '';
  16. $id = (isset($id) && is_numeric($id)) ? $id : 0;
  17. if (!in_array($type, array('list', 'arc', 'index'))) $url = "https://www.dedebiz.com";
  18. if ($action == 'get_qrcode') {
  19. if ($type == 'arc') {
  20. $url = $cfg_basehost.$cfg_plus_dir.'/view.php?aid='.$id;
  21. } elseif ($type == 'list') {
  22. $url = $cfg_basehost.$cfg_plus_dir.'/list.php?tid='.$id;
  23. }
  24. if ($id == 0) $url = "https://www.dedebiz.com";
  25. if ($type == 'index') $url = $cfg_basehost.$cfg_plus_dir.'/index.php';
  26. header("Content-Type: image/png");
  27. $params = array();
  28. $params['data'] = $url;
  29. $params['size'] = 6;
  30. $qrcode = new DedeQrcode;
  31. $qrcode->generate($params);
  32. } else {
  33. header("Content-Type: text/html; charset={$cfg_soft_lang}");
  34. $dtp = new DedeTemplate();
  35. $tplfile = DEDETEMPLATE.'/plus/qrcode.htm';
  36. $dtp->LoadTemplate($tplfile);
  37. $dtp->SetVar('id', $id);
  38. $dtp->SetVar('type', $type);
  39. $dtp->Display();
  40. exit();
  41. }