国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.5KB

  1. <?php
  2. /**
  3. *
  4. * 信息推荐
  5. *
  6. * @version $Id: recommend.php$
  7. * @package DedeBIZ.Site
  8. * @copyright Copyright (c) 2021, DedeBIZ.COM
  9. * @license https://www.dedebiz.com/license
  10. * @link https://www.dedebiz.com
  11. */
  12. require_once(dirname(__FILE__) . "/../include/common.inc.php");
  13. require_once(DEDEINC . "/channelunit.class.php");
  14. if (!isset($action)) $action = '';
  15. unset($_FILES);
  16. if (isset($arcID)) $aid = $arcID;
  17. $arcID = $aid = (isset($aid) && is_numeric($aid) ? $aid : 0);
  18. $type = (!isset($type) ? "" : $type);
  19. if (empty($aid)) {
  20. ShowMsg("文档ID不能为空!", "-1");
  21. exit();
  22. }
  23. //读取文档信息
  24. if ($action == '') {
  25. //读取文档信息
  26. $arcRow = GetOneArchive($aid);
  27. if ($arcRow['aid'] == '') {
  28. ShowMsg("无法把未知文档推荐给好友!", "-1");
  29. exit();
  30. }
  31. extract($arcRow, EXTR_OVERWRITE);
  32. }
  33. //发送推荐信息
  34. else if ($action == 'send') {
  35. if (!CheckEmail($email)) {
  36. ShowMsg("Email格式不正确", -1);
  37. exit();
  38. }
  39. $mailbody = '';
  40. $msg = RemoveXSS(dede_htmlspecialchars($msg));
  41. $mailtitle = "你的好友给你推荐了一篇文章";
  42. $mailbody .= "$msg \r\n\r\n";
  43. $mailbody .= "Powered by https://www.dedebiz.com DedeBIZ内容管理系统!";
  44. $headers = "From: " . $cfg_adminemail . "\r\nReply-To: " . $cfg_adminemail;
  45. if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) {
  46. $client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port);
  47. $client->appid = $cfg_bizcore_appid;
  48. $client->key = $cfg_bizcore_key;
  49. $client->MailSend($email,$mailtitle,$mailtitle,$mailbody);
  50. $client->Close();
  51. } else {
  52. if ($cfg_sendmail_bysmtp == 'Y' && !empty($cfg_smtp_server)) {
  53. $mailtype = 'TXT';
  54. require_once(DEDEINC . '/mail.class.php');
  55. $smtp = new smtp($cfg_smtp_server, $cfg_smtp_port, true, $cfg_smtp_usermail, $cfg_smtp_password);
  56. $smtp->debug = false;
  57. $smtp->sendmail($email, $cfg_webname, $cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype);
  58. } else {
  59. @mail($email, $mailtitle, $mailbody, $headers);
  60. }
  61. }
  62. ShowMsg("成功推荐一篇文章!", $arcurl);
  63. exit();
  64. }
  65. $arcRow = GetOneArchive($aid);
  66. if ($arcRow['aid'] == '') {
  67. ShowMsg("无法把未知文档推荐给好友!", "-1");
  68. exit();
  69. }
  70. extract($arcRow, EXTR_OVERWRITE);
  71. //显示模板(简单PHP文件)
  72. include(DEDETEMPLATE . '/plus/recommend.htm');