* Description: Posts to a Google+ page with the help of Hootsuite
* Version: 0.1
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
+ * Status: Unsupported
*/
function gpluspost_install() {
/*
// To-Do: Option to check the credentials if requested
if (($username != "") AND ($password != "")) {
- require_once("addon/googleplus/postToGooglePlus.php");
+ require_once("addon/gpluspost/postToGooglePlus.php");
$loginError = doConnectToGooglePlus2($username, $password);
if ($loginError)
$s .= '<p>Login Error. Please enter the correct credentials.</p>';
return;
// if post comes from Google+ don't send it back
- if (!get_pconfig($b["uid"],'gpluspost','no_loop_prevention') and ($b['app'] == "Google+"))
+ if (!get_pconfig($b["uid"],'gpluspost','no_loop_prevention') and (($b['app'] == "Google+") OR ($b["extid"] == NETWORK_GPLUS)))
return;
- // Always do the export via RSS-Feed (even if NextScripts is enabled), since it doesn't hurt
- $itemlist = get_pconfig($b["uid"],'gpluspost','itemlist');
- $items = explode(",", $itemlist);
+ if (!gpluspost_nextscripts()) {
+ // Posting via RSS-Feed and Hootsuite
+ $itemlist = get_pconfig($b["uid"],'gpluspost','itemlist');
+ $items = explode(",", $itemlist);
- $i = 0;
- $newitems = array($b['id']);
- foreach ($items AS $item)
- if ($i++ < 9)
- $newitems[] = $item;
+ $i = 0;
+ $newitems = array($b['id']);
+ foreach ($items AS $item)
+ if ($i++ < 9)
+ $newitems[] = $item;
- $itemlist = implode(",", $newitems);
+ $itemlist = implode(",", $newitems);
- logger('gpluspost_send: new itemlist: '.$itemlist." for uid ".$b["uid"]);
+ logger('gpluspost_send: new itemlist: '.$itemlist." for uid ".$b["uid"]);
- set_pconfig($b["uid"],'gpluspost','itemlist', $itemlist);
+ set_pconfig($b["uid"],'gpluspost','itemlist', $itemlist);
- // Posting via NextScripts
- if (gpluspost_nextscripts()) {
+ } else {
+ // Posting via NextScripts
$username = get_pconfig($b['uid'],'gpluspost','username');
$password = get_pconfig($b['uid'],'gpluspost','password');
$page = get_pconfig($b['uid'],'gpluspost','page');
$success = false;
if($username && $password) {
- require_once("addon/googleplus/postToGooglePlus.php");
+ require_once("addon/gpluspost/postToGooglePlus.php");
logger('gpluspost_queue: able to post for user '.$username);