wpForo crossposting from WPUF and/of XMLRPC  


bdebruin
Posts: 25
Customer
(@bdebruin)
Member
Joined: 1 year ago

What I wanted to achieve is the ability to post from 2 different clients:

  • WordPress User Frontend plugin (WPUF)
  • Word blog template (based on XMLRPC protocol)

These do integrate with wpForo CrossPosting, so I made the following changes:

  1. Wrote a snippet to hook the save_post_post event (attached in zip), it does a few things:
    1. When a WP blog post is trashed > disable the crossposting
    2. Use the first image as featured image (need because Word blog template does not support featured images) - not part of cross posting
    3. (if not called from WPUF – see point 2) set the _wpforo_crossposting_disabled metadata key based on the category where Word saves the post (local category is always cross posted)
    4. Set the _wpforo_crossposting_forumid metadata key to the wpForo forum used for cross posting
  2. Created a post form in WPUF where the user controls cross posting through a yes/no radio button

So, from here on the end user has full control over cross posting. Either through the WPUF from (radio button) or through the Word blog template by choosing the post category.

The only changes I made are to wpForoCrossPosting.php (attached – see //EDIT). Changes are:

  1. Ensure the function is running correctly when _wpforo_crossposting_disabled metadata key is set (not only inline saves)
  2. Commented out all lines where _wpforo_crossposting_disabled metadata key is set in the plugin (except for the draft mode)
  3. Use SQL to close the wpForo topic for further editing when the user disables cross posting at a later stage
  4. Use SQL to make sure xmlrpc initiated wpForo topics are auto approved
  5. Use SQL to set wpForo topic to private when Wordpress blog post is saved as draft

I use the wpForo topic to comment on Wordpress blog posts. To further enhance things I created:

  1. Added a snippet filter (get_comments_link ) to change the comment link in the Wordpress post so it does point to the wpFooro topic
  2. Added a snippet hook to force update made by WPUF to save the post (triggering the save_post_post snippet)
  3. Added a snippet filter (_the_content) to hide the first image in the post (as this is now set as featured image)

Maybe you find here some suggestions to enhance wpForo crossposting.

You are welcome to www.excellent-bid.nl to see the commenting system working.

Have fun with it!

Topic Tags
2 Replies
Astghik
Posts: 3480
Admin
(@astghik)
Support Team
Joined: 2 years ago

Hi @bdebruin,

Thank you very much. We really appreciate you taking time and the information here.

Reply
bdebruin
Posts: 25
Customer
(@bdebruin)
Member
Joined: 1 year ago

UPDATE: with the 2.0.0 version of the crossposting plugin there is a new option to auto cross post based on the category, works awesome and made most of my changes redundant. Few issues remain, and I will open new topics for those

Reply
Share:
Green
Default
Pear
Black Emo
{green}:grinning:
{green}:wink:
{green}:face:
{green}:inlove:
{green}:sweaty:
{green}:surprised:
{green}:lovekiss:
{green}:laugh:
{green}:formalsmile:
{green}:displeased:
{green}:cool:
{green}:resent:
{green}:nerd:
{green}:screaming:
{green}:amazed:
{green}:sad:
{green}:deceitful:
{green}:starryeyes:
{green}:evil:
{green}:shocked:
{green}:tears:
{green}:sulky:
{green}:smile:
{green}:vomited:
{green}:hi:
{green}:afraid:
{green}:crazy:
{green}:rabid:
{green}:fighting:
{green}:nonoise:
{green}:blushed:
{green}:idontknow:
{green}:scared:
{green}:razz:
{green}:kiss:
{green}:eat:
{green}:shutmouth:
{green}:gape:
{green}:suspicious:
{green}:laughingoutloud:
{green}:bruise:
{green}:crying:
{green}:pray:
{green}:serious:
{green}:excitement:
:)
:d
:wink:
:mrgreen:
:neutral:
:twisted:
:arrow:
:shock:
:???:
:cool:
:evil:
:oops:
:razz:
:roll:
:cry:
:eek:
:lol:
:mad:
:sad:
:!:
:?:
:idea:
:hmm:
:beg:
:whew:
:chuckle:
:silly:
:envy:
:shutmouth:
{pear}:happy:
{pear}:smile:
{pear}:laugh:
{pear}:laughingoutloud:
{pear}:crying:
{pear}:exhausted:
{pear}:nerd:
{pear}:surprised:
{pear}:veryhungry:
{pear}:wink:
{blackemo}:laughtertotears:
{blackemo}:gift:
{blackemo}:love:
{blackemo}:inlove:
{blackemo}:shamefaced:
{blackemo}:heart:
{blackemo}:crazy:
{blackemo}:anguished:
{blackemo}:bruise:
{blackemo}:easymoney:
{blackemo}:exhausted:
{blackemo}:vampire:
{blackemo}:shutmouth:
{blackemo}:wink:
{blackemo}:carnival:
{blackemo}:flowers:
{blackemo}:hotdrink:
{blackemo}:party: