Browse Source

[GooglePlusPostBridge] Add option to include image in content

References #600
logmanoriginal 5 years ago
parent
commit
53278b2eed
1 changed files with 14 additions and 1 deletions
  1. 14 1
      bridges/GooglePlusPostBridge.php

+ 14 - 1
bridges/GooglePlusPostBridge.php

@@ -14,6 +14,11 @@ class GooglePlusPostBridge extends BridgeAbstract{
 		'username' => array(
 			'name' => 'username or Id',
 			'required' => true
+		),
+		'include_media' => array(
+			'name' => 'Include media',
+			'type' => 'checkbox',
+			'title' => 'Enable to include media in the feed content'
 		)
 	));
 
@@ -52,7 +57,7 @@ class GooglePlusPostBridge extends BridgeAbstract{
 
 			$message = $post->find('div[jsname=EjRJtf]', 0);
 
-			$item['content'] = '<div style="float: left; padding: 10px;"><a href="'
+			$item['content'] = '<div style="float: left; padding: 0 10px 10px 0;"><a href="'
 			. $this->url
 			. '"><img align="top" alt="'
 			. $item['author']
@@ -83,6 +88,14 @@ class GooglePlusPostBridge extends BridgeAbstract{
 					$item['enclosures'][] = $this->fixImage($img)->src;
 				}
 
+				if($this->getInput('include_media') === true && count($item['enclosures'] > 0)) {
+					$item['content'] .= '<div style="clear: both;"><a href="'
+					. $item['enclosures'][0]
+					. '"><img src="'
+					. $item['enclosures'][0]
+					. '" /></a></div>';
+				}
+
 			}
 
 			// Add custom parameters (only useful for JSON or Plaintext)