Viewing 6 posts - 1 through 6 (of 6 total)
-
AuthorPosts
-
Saguaros Moderator
Saguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
February 24, 2017 at 4:54 am #1013259Hi,
Could you share the URL and admin login info of your site? and tell me the FB profile you’re mentioning.
I will take a look.
Regards
February 24, 2017 at 10:28 am #1013335This reply has been marked as private.Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
February 27, 2017 at 8:14 am #1013834Hi,
You can try open the file : plugins/system/jasocial_feed/jasocial_feed.php
change the line :
$dt->img = str_replace(array('&cfs=1', 'maxresdefault'), array('', '0'), urldecode($mat[1]));
To:
$dt->img = preg_replace('/\&cfs\=1(.*?)$/','',urldecode($mat[1]));
February 28, 2017 at 11:12 am #1014166Hello,
thank you very much. Now it downloaded the image of YT video instead this default one.
But I would like to display also video from YY on my website in the imported post.Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
March 2, 2017 at 3:08 am #1014599Hi,
You can try this way:
-
Open the file : ROOT/plugins/system/jasocial_feed/jasocial_feed.php
- Change the code:
if($getImg) { $img_caption = $this->getImageCaption($tcontent); if (preg_match('/i.ytimg.com/', $dt->img)) { // img from youtube preg_match('/url=(.*?)$/', $dt->img, $mat); if (!empty($mat[1])) { $dt->img = preg_replace('/\&cfs\=1(.*?)$/','',urldecode($mat[1])); } } $post['source_images'] = $this->getFacebookImage('<img src="'.$dt->img.'" />',$img_caption, $img_caption); // if (empty($post['source_images']) && !empty($dt->img)) { // $post['source_images'] = $this->saveImage($dt->img, 'facebook', $img_caption, $img_caption); // } // remove direct image in facebook content // $tcontent = preg_replace ('/<img [^>]+>/', '', $tcontent); } else { $post['source_images'] = false; } // add new intro text progress. $post['source_content'] = $tcontent;
To
$youtubeembed = ''; if($getImg) { $img_caption = $this->getImageCaption($tcontent); if (preg_match('/i.ytimg.com/', $dt->img)) { // img from youtube preg_match('/url=(.*?)$/', $dt->img, $mat); if (!empty($mat[1])) { $dt->img = preg_replace('/\&cfs\=1(.*?)$/','',urldecode($mat[1])); $youtubeid = preg_replace('/^(.*?)vi\/(.*?)\/(.*?)\.jpg$/','$2',$dt->img); $youtubeembed = '<p><iframe width="560" height="315" src="https://www.youtube.com/embed/'.$youtubeid.'" frameborder="0" allowfullscreen></iframe></p>'; } } $post['source_images'] = $this->getFacebookImage('<img src="'.$dt->img.'" />',$img_caption, $img_caption); // if (empty($post['source_images']) && !empty($dt->img)) { // $post['source_images'] = $this->saveImage($dt->img, 'facebook', $img_caption, $img_caption); // } // remove direct image in facebook content // $tcontent = preg_replace ('/<img [^>]+>/', '', $tcontent); } else { $post['source_images'] = false; } // add new intro text progress. $post['source_content'] = $tcontent.$youtubeembed;
Around line : 414 -> 433
-
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
This topic contains 6 replies, has 3 voices, and was last updated by coliberek 7 years, 9 months ago.
The topic ‘video in posts imported from fb’ is closed to new replies.