|
@@ -1544,12 +1544,13 @@ class SocialManager extends UserManager
|
|
|
$regExUrl = "/(http|https)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
|
|
|
$newText = '';
|
|
|
if (preg_match($regExUrl, $text, $url)) {
|
|
|
- // make the urls hyper links
|
|
|
- $newText .= preg_replace($regExUrl, "<a target=\"_blank\" href=" . $url[0] . ">".$url[0]."</a> ", $text);
|
|
|
// Comment this line to disable OpenGraph
|
|
|
$newText .= self::getHtmlByLink($url[0]);
|
|
|
+ // make the urls hyper links
|
|
|
+ //$newText .= preg_replace($regExUrl, "<a target=\"_blank\" href=" . $url[0] . ">".$url[0]."</a> ", $text);
|
|
|
+
|
|
|
} else {
|
|
|
- $newText .= $text;
|
|
|
+ $newText = $text;
|
|
|
}
|
|
|
return $newText;
|
|
|
}
|
|
@@ -1564,8 +1565,9 @@ class SocialManager extends UserManager
|
|
|
$graph = OpenGraph::fetch($link);
|
|
|
$url = $graph->url;
|
|
|
$image = $graph->image;
|
|
|
- $domain = empty($url) ? parse_url($link) : parse_url($url);
|
|
|
+ $domain = empty($url) ? '' : parse_url($url);
|
|
|
$domain = $domain['scheme'].'://'.$domain['host'];
|
|
|
+ $html = '';
|
|
|
// Trick to verify if the Image Url Exist because of some bad metatag dev
|
|
|
if (self::verifyUrl($image) == false){
|
|
|
if (!($image[0] == '/')){
|
|
@@ -1574,10 +1576,11 @@ class SocialManager extends UserManager
|
|
|
$image = $domain . $image;
|
|
|
}
|
|
|
$title = $graph->title;
|
|
|
- $html = '<div class="thumbnail">';
|
|
|
- $html .= '<a target="_blank" href="'.$link.'"><h3>'.$title.'</h3>';
|
|
|
- $html .= empty($image) ? '' : '<img alt="" src="'.$image.'" height="160" ></a>';
|
|
|
- $html .= empty($graph->description) ? '' : '<div>'.$graph->description.'</div>';
|
|
|
+
|
|
|
+ $html .= '<div class="post-open-graph">';
|
|
|
+ $html .= '<h4><a target="_blank" href="'.$link.'">'.$title.'</a></h4>';
|
|
|
+ $html .= empty($image) ? '' : '<img alt="" src="'.$image.'" />';
|
|
|
+ $html .= empty($graph->description) ? '' : '<p class="description">'.$graph->description.'<a href="'.$link.'">'.$link.'</a></p>';
|
|
|
$html .= "</div>";
|
|
|
return $html;
|
|
|
}
|
|
@@ -1855,7 +1858,7 @@ class SocialManager extends UserManager
|
|
|
'cols-size' => [1, 10, 1]
|
|
|
]
|
|
|
);
|
|
|
- $form->addHtml('<div class="form-group "><div class="url_preview col-md-9 panel-body"></div></div>');
|
|
|
+ $form->addHtml('<div class="url_preview"></div>');
|
|
|
$form->addHidden('url_content', '');
|
|
|
$form->addButtonSend(get_lang('Post'), null, false, ['cols-size' => [1, 10, 1]]);
|
|
|
$html = Display::panel($form->returnForm(), get_lang('SocialWall'));
|