By Christopher Ambler on Sunday, 01 March 2020
Posted in Technical Issues
Likes 0
Views 733
Votes 0
In looking at the facebook share code, you set $params to the post URL, but nothing else. While Facebook is good at page scraping, it will NOT put content in the "message" field.

I have resolved this by adding this code in includes/oauth/adapters/facebook/client.php:

$params['message'] = $data->content;

That simple! You set $data from a call to getting the post's info, in fact.

I'd have to have to add this back every time I update, and I don't believe this file can be overridden.

Is there any way you can set this? It's required in the graph API call to set a post's content properly.
Do you mean missing that story message https://monosnap.com/file/RGme2GxiMwBYzkiELquXoKgXzVR3fc when Easyblog perform an autoposting to Facebook page?

Or missing the post description?
·
Monday, 02 March 2020 11:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes, the message (not the description). The red box in your screen shot.

It's passed to the API as the "message" parameter, which your code does not pass. You only pass the link parameter and rely on Facebook to page-scrape to fill in its data, and Facebook will not fill in "message" in this way.
·
Monday, 02 March 2020 11:32
·
0 Likes
·
0 Votes
·
0 Comments
·
Actually the message content exactly same with the description, do it really need to show it again on the story post?

Because so far no other user complain about this who want to show the same blog description content into message area yet.
·
Monday, 02 March 2020 11:52
·
0 Likes
·
0 Votes
·
0 Comments
·
But it's not the same.

Description, content and intro are all individually assignable. Description can be derived from separately-set meta, for example. And when doing it programmatically, it's set separately as well.

Just to show you, here's my posting code, below. Note I set all those fields separately.

Facebook puts the title in bold below the image and the description in normal text under that. The message is put separately and is NEVER set from the description, even if og:description is provided. It MUST be set with the "message" field in the POST to /api.


$postdata = array();

$postdata['uid'] = $post->uid;
$postdata['permalink'] = $permalink;
$postdata['title'] = $posttitle;
$postdata['tags'] = $tags;
$postdata['keywords'] = $keywords;
$postdata['description'] = $description;
$postdata['created_by'] = $author->id;
$postdata['created'] = EB::date()->toSql();
$postdata['modified'] = EB::date()->toSql();
$postdata['publish_up'] = EB::date()->toSql();
$postdata['source_id'] = 0;
$postdata['source_type'] = EASYBLOG_POST_SOURCE_SITEWIDE;

if ($postType == 'post') {
$postdata['published'] = EASYBLOG_POST_PUBLISHED;
}
else {
$postdata['published'] = EASYBLOG_POST_DRAFT;
}

$postdata['frontpage'] = 1;
$postdata['doctype'] = EASYBLOG_POST_DOCTYPE_LEGACY;
$postdata['posttype'] = EBLOG_MICROBLOG_EMAIL;
$postdata['send_notification_emails'] = 0;
$postdata['category_id'] = $category;
$postdata['categories'] = $categories;

$dlimage = self::downloadImage($image, $postdata);

$postdata['image'] = $dlimage->uri;

if (!empty($introContent)) {
$postdata['intro'] = $introContent;
}

$postdata['content'] = $content;

$post->bind($postdata, array());
·
Monday, 02 March 2020 12:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for sharing, we will see if there have a lot of user who request this then we will consider to add this in the future.
·
Tuesday, 03 March 2020 11:32
·
0 Likes
·
0 Votes
·
0 Comments
·
If you don't, is this file overridable?
·
Tuesday, 03 March 2020 11:39
·
0 Likes
·
0 Votes
·
0 Comments
·
If you don't, is this file overridable?

Unfortunately that is not possible to template override for this function file, only the theme file only obtain to override from template.
·
Tuesday, 03 March 2020 18:56
·
0 Likes
·
0 Votes
·
0 Comments
·
Guess I'll be patching this file every update, then.

Not happy about that - but it's the ONLY way to get content into an autopost.
·
Thursday, 05 March 2020 02:54
·
0 Likes
·
0 Votes
·
0 Comments
·
I already discuss with the team, we will probably add a setting under autoposting configuration setting page for those who want to show the message, they can able to enable it.

This option only available in Easyblog 4.0 stable version.

Just for your information, I have locked and marked this thread as resolved to avoid confusions in the future. Please start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiries.

Thanks for understanding.
·
Thursday, 05 March 2020 09:34
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post