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

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