[GooglePlusPostBridge] Add option to include image in content
References #600
This commit is contained in:
parent
5f3c55b808
commit
53278b2eed
1 changed files with 14 additions and 1 deletions
|
@ -14,6 +14,11 @@ class GooglePlusPostBridge extends BridgeAbstract{
|
||||||
'username' => array(
|
'username' => array(
|
||||||
'name' => 'username or Id',
|
'name' => 'username or Id',
|
||||||
'required' => true
|
'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);
|
$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
|
. $this->url
|
||||||
. '"><img align="top" alt="'
|
. '"><img align="top" alt="'
|
||||||
. $item['author']
|
. $item['author']
|
||||||
|
@ -83,6 +88,14 @@ class GooglePlusPostBridge extends BridgeAbstract{
|
||||||
$item['enclosures'][] = $this->fixImage($img)->src;
|
$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)
|
// Add custom parameters (only useful for JSON or Plaintext)
|
||||||
|
|
Loading…
Reference in a new issue