define('FROMGPLUS_DEFAULT_POLL_INTERVAL', 30); // given in minutes
+require_once('mod/share.php');
+
function fromgplus_install() {
register_hook('connector_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings');
register_hook('connector_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post');
$post = fromgplus_html2bbcode($item->annotation)."\n";
if (!intval(get_config('system','old_share'))) {
- $post .= "[share author='".str_replace("'", "'",$item->object->actor->displayName).
- "' profile='".$item->object->actor->url.
- "' avatar='".$item->object->actor->image->url.
- "' link='".$item->object->url."']";
+
+ if (function_exists("share_header"))
+ $post .= share_header($item->object->actor->displayName, $item->object->actor->url,
+ $item->object->actor->image->url, "",
+ datetime_convert('UTC','UTC',$item->object->published),$item->object->url);
+ else
+ $post .= "[share author='".str_replace("'", "'",$item->object->actor->displayName).
+ "' profile='".$item->object->actor->url.
+ "' avatar='".$item->object->actor->image->url.
+ "' posted='".datetime_convert('UTC','UTC',$item->object->published).
+ "' link='".$item->object->url."']";
$post .= fromgplus_html2bbcode($item->object->content);
if ($application_name == "")
$application_name = $a->get_hostname();
+ $adminlist = explode(",", str_replace(" ", "", $a->config['admin_email']));
+
$params["type"] = "client_associate";
- $params["contacts"] = $a->config['admin_email'];
+ $params["contacts"] = $adminlist[0];
$params["application_type"] = "native";
$params["application_name"] = $application_name;
$params["logo_url"] = $a->get_baseurl()."/images/friendica-256.png";
set_pconfig(local_user(),'pumpio','mirror',false);
set_pconfig(local_user(),'pumpio','post_by_default',false);
set_pconfig(local_user(),'pumpio','lastdate', 0);
+ set_pconfig(local_user(),'pumpio','last_id', '');
} else {
// filtering the username if it is filled wrong
$user = $_POST['pumpio_user'];
$postarray['body'] = "[share author='".$post->object->author->displayName.
"' profile='".$post->object->author->url.
"' avatar='".$post->object->author->image->url.
+ "' posted='".datetime_convert('UTC','UTC',$post->object->created).
"' link='".$post->links->self->href."']".$postarray['body']."[/share]";
} else {
// Let shares look like wall-to-wall posts
require_once('mod/item.php');
require_once('include/items.php');
+ require_once('mod/share.php');
require_once('library/twitteroauth.php');
$connection = new TwitterOAuth($ckey,$csecret,$otoken,$osecret);
$converted = twitter_expand_entities($a, $_REQUEST['body'], $post->retweeted_status, true, $picture);
$_REQUEST['body'] = $converted["body"];
- $_REQUEST['body'] = "[share author='".$post->retweeted_status->user->name.
- "' profile='https://twitter.com/".$post->retweeted_status->user->screen_name.
- "' avatar='".$post->retweeted_status->user->profile_image_url_https.
- "' link='https://twitter.com/".$post->retweeted_status->user->screen_name."/status/".$post->retweeted_status->id_str."']".
- $_REQUEST['body'];
+ if (function_exists("share_header"))
+ $_REQUEST['body'] = share_header($post->retweeted_status->user->name, "https://twitter.com/".$post->retweeted_status->user->screen_name,
+ $post->retweeted_status->user->profile_image_url_https, "",
+ datetime_convert('UTC','UTC',$post->retweeted_status->created_at),
+ "https://twitter.com/".$post->retweeted_status->user->screen_name."/status/".$post->retweeted_status->id_str).
+ $_REQUEST['body'];
+ else
+ $_REQUEST['body'] = "[share author='".$post->retweeted_status->user->name.
+ "' profile='https://twitter.com/".$post->retweeted_status->user->screen_name.
+ "' avatar='".$post->retweeted_status->user->profile_image_url_https.
+ "' posted='".datetime_convert('UTC','UTC',$post->retweeted_status->created_at).
+ "' link='https://twitter.com/".$post->retweeted_status->user->screen_name."/status/".$post->retweeted_status->id_str."']".
+ $_REQUEST['body'];
+
$_REQUEST['body'] .= "[/share]";
} else {
$_REQUEST["body"] = $post->text;
$postarray['body'] = "[share author='".$post->retweeted_status->user->name.
"' profile='https://twitter.com/".$post->retweeted_status->user->screen_name.
"' avatar='".$post->retweeted_status->user->profile_image_url_https.
+ "' posted='".datetime_convert('UTC','UTC',$post->retweeted_status->created_at).
"' link='https://twitter.com/".$post->retweeted_status->user->screen_name."/status/".$post->retweeted_status->id_str."']".
$postarray['body'];
$postarray['body'] .= "[/share]";