Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: How does it pick an image from article to fb post?

How does it pick an image from article to fb post? 8 years 6 months ago #2629

  • Super User
  • Super User's Avatar
  • OFFLINE
  • Administrator
  • Posts: 3519
  • Thank you received: 278
  • Karma: 65
Hello
In file plugins/systems/jo_autopost_facebook/jo_autopost_facebook.php in line 143->149 we have change
preg_match_all('/src="([^"]+)"/i', $article->introtext.$article->fulltext, $matches);
//create url image post to facebook
if (empty($matches[1][0])) {
$path_image = $baseurl.'components/com_joautofacebook/assets/default.gif';
}else{
$path_image = $baseurl.$matches [1] [0];
}
To
$images = json_decode($article->images);
if($images->image_intro !=''){
$path_image = $baseurl.$images->image_intro;
}elseif($images->image_fulltext !=''){
$path_image = $baseurl.$images->image_fulltext;
}else{
//load image in article
preg_match_all('/src="([^"]+)"/i', $article->introtext.$article->fulltext, $matches);
//create url image post to facebook
if (empty($matches[1][0])) {
$path_image = $baseurl.'components/com_joautofacebook/assets/default.gif';
}else{
$path_image = $baseurl.$matches [1] [0];
}
}
Best regards
Bach Pham
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 0.073 seconds