Topic-icon How to auto post new jreviews listing to FB?

Active Subscriptions:

None
6 years 3 months ago #63269 by skyfranky
yes, this is how jreview works. to create new listing from frontend. unpublish and publish from frontend too.
The topic has been locked.
Support Specialist
6 years 3 months ago #63270 by alzander
Can you send new admin and FTP credentials for your site so we can investigate the cause further?

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
6 years 3 months ago #63271 by skyfranky
did you test on your site first? can you get it working?
The topic has been locked.
Support Specialist
6 years 3 months ago #63272 by mel
I sent you a PM with code to try in the Open Graph Content plugin. On my dev site, when creating a new listing on the front-end, this fixes the autoposting on the creation of the listing. It does not address the publish/unpublish on the front-end yet. I will need to investigate that more, but let me know how this change works for you.

-Melissa
The topic has been locked.
Active Subscriptions:

None
6 years 3 months ago - 6 years 3 months ago #63273 by skyfranky
yes, it works after adding the code when creating new listing. but there is one issue that image of a listing can only be uploaded after listing submission causing listing image can not show in FB post.

Now waiting for publish/unpublish on the front-end to work.
Last edit: 6 years 3 months ago by skyfranky.
The topic has been locked.
Support Specialist
6 years 3 months ago #63276 by mel
Please check your Private Messages. I've sent you some code. Once you verify that works, I'll clean it up a bit and check it in for the next bug fix release.

-Melissa
The topic has been locked.
Active Subscriptions:

None
6 years 3 months ago #63277 by skyfranky
unpublish and republish on frontend did not tigger auto post to FB after adding below code

public function onContentChangeState($context, $pks, $value)
{
if($context == 'com_content.article')
{
JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models');
$contentModel = JModelLegacy::getInstance('Article', 'ContentModel');

foreach($pks as $pk)
{
$article = $contentModel->getItem($pk);
$this->tryAutoPublish($article, $value);
}
}
else if($context=='com_jreviews.listing') { foreach($pks as $pk) { list($articleId, $alias)=array_pad(explode(':', $pk, 2), 2, ''); $this->db->setQuery("SELECT * FROM #__content WHERE id=" . $articleId); $article=$this->db->loadObject(); if($article) $this->tryAutoPublish($article, $value); } }

}
The topic has been locked.
Support Specialist
6 years 3 months ago #63278 by mel
Hmm. That code worked on my dev site.

1. If you're testing with an article that has already been autoposted, you will need to delete the entries in the JFBConnect backend > Channels > History tab. If we detect the post, we don't attempt the autopost action again. Once deleted, try the unpublish/publish action again.

2. If there were no prior autoposts for the URL, can you see if there are any error entries in that History tab? Sometimes the attempt is made to post but the actual posting fails and there are API errors in that list.

3. Can you verify that we're performing the same action on the front-end? The screenshot has the button that I'm toggling in the listing itself to unpublish and publish the JReviews listing. Are you doing it within the listing or from a category list of listings?

File Attachment:



-Melissa
The topic has been locked.