国内流行的内容管理系统(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.

72 lines
2.2KB

  1. <?php
  2. /**
  3. *
  4. * 信息推荐
  5. *
  6. * @version $Id: recommend.php$
  7. * @package DedeBIZ.Site
  8. * @copyright Copyright (c) 2020, 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 DedeCMSV6内容管理系统!";
  44. $headers = "From: " . $cfg_adminemail . "\r\nReply-To: " . $cfg_adminemail;
  45. if ($cfg_sendmail_bysmtp == 'Y' && !empty($cfg_smtp_server)) {
  46. $mailtype = 'TXT';
  47. require_once(DEDEINC . '/mail.class.php');
  48. $smtp = new smtp($cfg_smtp_server, $cfg_smtp_port, true, $cfg_smtp_usermail, $cfg_smtp_password);
  49. $smtp->debug = false;
  50. $smtp->sendmail($email, $cfg_webname, $cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype);
  51. } else {
  52. @mail($email, $mailtitle, $mailbody, $headers);
  53. }
  54. ShowMsg("成功推荐一篇文章!", $arcurl);
  55. exit();
  56. }
  57. $arcRow = GetOneArchive($aid);
  58. if ($arcRow['aid'] == '') {
  59. ShowMsg("无法把未知文档推荐给好友!", "-1");
  60. exit();
  61. }
  62. extract($arcRow, EXTR_OVERWRITE);
  63. //显示模板(简单PHP文件)
  64. include(DEDETEMPLATE . '/plus/recommend.htm');