kidozh 發表於 2022-2-5 10:32:31

通过掌上论坛的回帖不触发钩子函数

我写了一个很简单的钩子函数<br /><br /><ol><li>&lt;?php<br /><li><br /><li>if (!defined('IN_DISCUZ')) {<br /><li><br /><li>&nbsp; &nbsp; exit('Access Denied');<br /><li>}<br /><li><br /><li>function sendPostRequest($url,$jsonData){<br /><li><br /><li>&nbsp; &nbsp; $curl = curl_init($url);<br /><li>&nbsp; &nbsp; curl_setopt($curl, CURLOPT_HEADER, false);<br /><li>&nbsp; &nbsp; curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);<br /><li>&nbsp; &nbsp; curl_setopt($curl, CURLOPT_HTTPHEADER, array(&quot;Content-type: application/json&quot;));<br /><li>&nbsp; &nbsp; curl_setopt($curl, CURLOPT_POST, true);<br /><li>&nbsp; &nbsp; curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($jsonData));<br /><li>&nbsp; &nbsp; // set a very low timeout to avoid blocking<br /><li>&nbsp; &nbsp; curl_exec($curl);<br /><li>&nbsp; &nbsp; curl_close($curl);<br /><li>}<br /><li><br /><li>class plugin_dhpush {}<br /><li><br /><li><br /><li><br /><li><br /><li>class plugin_dhpush_forum extends plugin_dhpush<br /><li>{<br /><li><br /><li>&nbsp; &nbsp; function __construct()<br /><li>&nbsp; &nbsp; { //全局函数定义<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;global $_G;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$config = $_G['cache']['plugin']['dhpush'];<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$this-&gt;groupid = $_G['groupid'];<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$this-&gt;allowPushGroupIds = unserialize($config[&quot;allowPushGroups&quot;]);<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$this-&gt;pushToken = $config[&quot;pushToken&quot;];<br /><li>&nbsp; &nbsp; }<br /><li><br /><li>&nbsp; &nbsp; function post_reply_output($params)<br /><li>&nbsp; &nbsp; {<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;global $_G;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$DEBUG = true;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$SEND_URL_PREFIX = &quot;https://dhpushservice.kidozh.com/&quot;;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$SEND_URL_PATH = &quot;v1/push/reply/&quot;;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if ($DEBUG) {<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$SEND_URL_PREFIX = &quot;http://localhost:8888/&quot;;<br /><li><br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br /><li><br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$SEND_URL = $SEND_URL_PREFIX.$SEND_URL_PATH;<br /><li><br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;error_log(print_r($params, TRUE));<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;// check with post reply succeed<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if ($params[&quot;message&quot;] != &quot;post_reply_succeed&quot;) {<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;return;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$fid = $params['values']['fid'];<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$tid = $params['values']['tid'];<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$pid = $params['values']['pid'];<br /><li><br /><li><br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$mForumPost = C::t(&quot;forum_post&quot;);<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$post = $mForumPost-&gt;fetch($tid, $pid);<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$senderUid = $post[&quot;authorid&quot;];<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$senderName = $post[&quot;author&quot;];<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$replyMessage = $post[&quot;message&quot;];<br /><li><br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$mForumThread = C::t('forum_thread');<br /><li><br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$thread = $mForumThread-&gt;fetch($tid);<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;//主题作者ID<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$authorId = $thread['authorid'];<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$userResult = DB::fetch_first(&quot;SELECT groupid FROM &quot; . DB::table(&quot;common_member&quot;) . &quot; WHERE uid=&quot; . $authorId);<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$receiverGroupId = $userResult[&quot;groupid&quot;];<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;//判断作者是否开启回贴通知<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;//$mForumPostNotice = C::t('#post_notice#forum_post_notice');<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;//$isNotice = $mForumPostNotice-&gt;getNoticeState($authorId);<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;// allow notify<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (true) {<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$mCommonMember = C::t('common_member');<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$author = $mCommonMember-&gt;fetch($authorId);<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$email = $author['email'];<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$title = $senderName . '回复了帖子' . $thread[&quot;subject&quot;];<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$siteURL = $_G[&quot;siteurl&quot;];<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;// check whether group id is not null and in the allowed group<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if ($receiverGroupId &amp;&amp; in_array($receiverGroupId, $this-&gt;allowPushGroupIds)) {<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; // look in the table whether the user in the push database<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; $pushInfo = DB::fetch_first(&quot;SELECT uid, token, allowPush FROM &quot; . DB::table(&quot;dhpush_token&quot;) . &quot; WHERE uid=&quot; . $authorId);<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; // start to push the information to device via firebase<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; $token = $pushInfo[&quot;token&quot;];<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; $deviceToken = $token;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; $data = [<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;// belong to a reply<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;site_url&quot; =&gt; $siteURL,<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;type&quot; =&gt; &quot;thread_reply&quot;,<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;sender_name&quot; =&gt; $senderName,<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;sender_id&quot; =&gt; $senderUid,<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;message&quot; =&gt; $replyMessage,<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;title&quot; =&gt; $title,<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;tid&quot; =&gt; $tid,<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;pid&quot; =&gt; $pid,<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;fid&quot; =&gt; $fid,<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&quot;tokenList&quot;=&gt; $deviceToken<br /><li><br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; ];<br /><li><br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; $SEND_URL_WITH_PARAMTER = $SEND_URL.&quot;?token=&quot;.$this-&gt;pushToken;<br /><li><br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; sendPostRequest($SEND_URL_WITH_PARAMTER,$data);<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; error_log(print_r($data, TRUE));<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; error_log(print_r($SEND_URL, TRUE));<br /><li><br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;} else {<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; // the user are not able to get a push<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;} else {<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;// not to send a information<br /><li><br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br /><li>&nbsp; &nbsp; }<br /><li>}<br /><li><br /><li>//&nbsp; &nbsp; function post_message($params)<br /><li>//&nbsp; &nbsp; {<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;return;<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;//file_put_contents('php://stderr', print_r($params, TRUE));<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;error_log(print_r($params, TRUE));<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;global $_G;<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$fid = $params['param']['fid'];<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$tid = $params['param']['tid'];<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$pid = $params['param']['pid'];<br /><li>//<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$action=$params['param'];<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if($action=='post_newthread_succeed'){//newthread<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;//TODO For newthread<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;elseif($action=='post_reply_succeed'){//new reply<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;return;<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$senderName = $_G[&quot;username&quot;];<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$senderUid = $_G[&quot;uid&quot;];<br /><li>//<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$mForumThread = C::t('forum_thread');<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;//$tid = $params['values']['tid'];<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$thread = $mForumThread-&gt;fetch($tid);<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;//主题作者ID<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$authorId = $thread['authorid'];<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$userResult = DB::fetch_first(&quot;SELECT groupid FROM &quot; . DB::table(&quot;common_member&quot;) . &quot; WHERE uid=&quot; . $authorId);<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$receiverGroupId = $userResult[&quot;groupid&quot;];<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;//判断作者是否开启回贴通知<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;//$mForumPostNotice = C::t('#post_notice#forum_post_notice');<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;//$isNotice = $mForumPostNotice-&gt;getNoticeState($authorId);<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;// allow notify<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if (true) {<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; $mCommonMember = C::t('common_member');<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; $author = $mCommonMember-&gt;fetch($authorId);<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; $email = $author['email'];<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; $subject = '您的贴子有回复了!';<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; $body = $author['username'] . &quot;\n&quot;;<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; $body .= &quot;您的主题:&quot; . $thread['subject'] . &quot;有回复了!\n&quot;;<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; $body .= &quot;复制链接查看:&quot; . $_G['siteurl'] . &quot;forum.php?mod=viewthread&amp;tid=&quot; . $tid . &quot;\n&quot;;<br /><li>//<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; $replyMessage = $body;<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; // check whether group id is not null and in the allowed group<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; if ($receiverGroupId &amp;&amp; in_array($receiverGroupId, $this-&gt;allowPushGroupIds)) {<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;// look in the table whether the user in the push database<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$pushInfo = DB::fetch_first(&quot;SELECT uid, token, allowPush FROM &quot;.DB::table(&quot;dhpush_token&quot;).&quot; WHERE uid=&quot; . $authorId);<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;// start to push the information to device via firebase<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$token = $pushInfo[&quot;token&quot;];<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$deviceToken = $token;<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$data = [<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;// belong to a reply<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;type&quot; =&gt; &quot;thread_reply&quot;,<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;sender_name&quot; =&gt; $author['username'],<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;sender_id&quot; =&gt; $senderUid,<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;message&quot; =&gt; $replyMessage,<br /><li>//<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;];<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;sendPostRequest($SEND_URL,$data);<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;error_log(print_r($data, TRUE));<br /><li>//<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; } else {<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;// the user are not able to get a push<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br /><li>//<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br /><li>//<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if ($params['message'] != 'post_reply_succeed') {<br /><li>//&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br /><li>//<br /><li>//&nbsp; &nbsp; }<br /><li><br /><li></ol>这个可以在每次回帖的时候正常的回调,但是我通过掌上论坛API调用的时候却并不触发这个钩子函数,我想问问是什么原因,需要做哪些事情才能让通过掌上论坛API发帖的时间被正确的通过钩子函数回调?<br />子函数<em>, </em>通过<em>, </em>掌上<em>, </em>论坛<em>, </em>这个

老周部落 發表於 2022-2-5 11:39:22

试试改成 post_message 嵌入点呢?这个嵌入点应该是不依赖前端的,不过 $params[&quot;message&quot;] != &quot;post_reply_succeed&quot; 估计得改。

kidozh 發表於 2022-2-5 22:59:22

<br />似乎这个也触发不了。。。刚刚试了一下。。。

老周部落 發表於 2022-2-8 15:37:04

<br />$params[&quot;message&quot;] != &quot;post_reply_succeed&quot; 去掉也不行么?<br />

kidozh 發表於 2022-2-10 04:06:41

<br />我试了 没有办法通过掌上论坛API触发,网页端都是可以的

kidozh 發表於 2022-2-11 23:55:46

<br />我回复被吞了,我试了一下 是不行的 我嵌入了移动端也不行。。。
頁: [1]
查看完整版本: 通过掌上论坛的回帖不触发钩子函数