Forum Topic or Post to Discord
Quote from DirkB on December 20, 2020, 8:33 pmHello, I’m fairly new to php and this Asgaros Forum, – amazing work by the way – a forum layout as I think it has to be.
Anybody has tried to code a send to Discord channel function, to display in a Discord channel the latest posts or topics?function submit_info($postID, $topicID) { global $asgarosforum; $groupIDs = get_term_meta($asgarosforum->current_category, 'usergroups', true); // IDs of usergroups for category. // Can get more information about it with: // AsgarosForumUserGroups::getUserGroupBy($groupID) print_r('<pre>'); print_r($groupIDs); print_r('</pre>'); // Access level for category. $accessLevel = get_term_meta($asgarosforum->current_category, 'category_access', true); print_r('<pre>'); print_r($accessLevel); print_r('</pre>'); die(); } add_action('asgarosforum_after_add_topic_submit', 'submit_info', 10, 2); // Get latest Topic global $asgarosforum; $link = html_entity_decode($asgarosforum->getLink('topic', $asgarosforum->current_topic, false, '#postid-'.$asgarosforum->current_post)); //Get latest Post global $asgarosforum; $link = html_entity_decode($asgarosforum->get_postlink($asgarosforum->current_topic, $asgarosforum->current_post));I found this here, and I like to ask, if this is still a working solution to get the topics or posts hooked.
Thanks for your help
Hello, I’m fairly new to php and this Asgaros Forum, – amazing work by the way – a forum layout as I think it has to be.
Anybody has tried to code a send to Discord channel function, to display in a Discord channel the latest posts or topics?
function submit_info($postID, $topicID) { global $asgarosforum; $groupIDs = get_term_meta($asgarosforum->current_category, 'usergroups', true); // IDs of usergroups for category. // Can get more information about it with: // AsgarosForumUserGroups::getUserGroupBy($groupID) print_r('<pre>'); print_r($groupIDs); print_r('</pre>'); // Access level for category. $accessLevel = get_term_meta($asgarosforum->current_category, 'category_access', true); print_r('<pre>'); print_r($accessLevel); print_r('</pre>'); die(); } add_action('asgarosforum_after_add_topic_submit', 'submit_info', 10, 2); // Get latest Topic global $asgarosforum; $link = html_entity_decode($asgarosforum->getLink('topic', $asgarosforum->current_topic, false, '#postid-'.$asgarosforum->current_post)); //Get latest Post global $asgarosforum; $link = html_entity_decode($asgarosforum->get_postlink($asgarosforum->current_topic, $asgarosforum->current_post));
I found this here, and I like to ask, if this is still a working solution to get the topics or posts hooked.
Thanks for your help
Quote from Asgaros on February 16, 2021, 11:00 amHello @dirkb
The hook is still fine, but it has six parameters now:
- post-ID
- topic-ID
- subject
- content
- link
- author-ID
Hello @dirkb
The hook is still fine, but it has six parameters now:
- post-ID
- topic-ID
- subject
- content
- link
- author-ID