mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-19 23:07:03 +00:00
cleaned up some other missing variables.
This commit is contained in:
parent
6d82fcd55b
commit
86846d9ff4
2 changed files with 20 additions and 25 deletions
|
@ -175,11 +175,19 @@ function fbsync_cron($a,$b) {
|
||||||
|
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
fbsync_get_self($rr['uid']);
|
logger('fbsync_cron: importing timeline from user '.$rr['uid']);
|
||||||
|
|
||||||
logger('fbsync_cron: importing timeline from user '.$rr['uid']);
|
$uid = fbsync_get_self($rr['uid']);
|
||||||
$data = fbsync_fetchfeed($a, $rr['uid']);
|
$self_id = get_pconfig($uid,'fbsync','self_id');
|
||||||
fbsync_processfeed($data);
|
$last_updated = get_pconfig($uid,'fbsync','last_updated');
|
||||||
|
|
||||||
|
$self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1", intval($uid));
|
||||||
|
$user = q("SELECT * FROM `user` WHERE `uid` = %d AND `account_expired` = 0 LIMIT 1", intval($uid));
|
||||||
|
if(! count($user))
|
||||||
|
return;
|
||||||
|
|
||||||
|
$data = fbsync_fetchfeed($a, $uid, $self_id, $last_updated);
|
||||||
|
fbsync_processfeed($data, $self, $a, $uid, $self_id, $user, $last_updated);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -982,23 +990,9 @@ function fbsync_fetchuser($a, $uid, $id) {
|
||||||
return($user);
|
return($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
function fbsync_fetchfeed($a, $uid) {
|
function fbsync_fetchfeed($a, $uid, $self_id, $last_updated) {
|
||||||
$access_token = get_pconfig($uid,'facebook','access_token');
|
$access_token = get_pconfig($uid,'facebook','access_token');
|
||||||
$last_updated = get_pconfig($uid,'fbsync','last_updated');
|
$do_likes = get_config('fbsync', 'do_likes');
|
||||||
$self_id = get_pconfig($uid,'fbsync','self_id');
|
|
||||||
|
|
||||||
$create_user = get_pconfig($uid, 'fbsync', 'create_user');
|
|
||||||
$do_likes = get_config('fbsync', 'do_likes');
|
|
||||||
|
|
||||||
$self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
|
|
||||||
intval($uid)
|
|
||||||
);
|
|
||||||
|
|
||||||
$user = q("SELECT * FROM `user` WHERE `uid` = %d AND `account_expired` = 0 LIMIT 1",
|
|
||||||
intval($uid)
|
|
||||||
);
|
|
||||||
if(! count($user))
|
|
||||||
return;
|
|
||||||
|
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
|
@ -1032,7 +1026,10 @@ function fbsync_fetchfeed($a, $uid) {
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
function fbsync_processfeed($data){
|
function fbsync_processfeed($data, $self, $a, $uid, $self_id, $user, $last_updated){
|
||||||
|
|
||||||
|
$create_user = get_pconfig($uid, 'fbsync', 'create_user');
|
||||||
|
|
||||||
$posts = array();
|
$posts = array();
|
||||||
$comments = array();
|
$comments = array();
|
||||||
$likes = array();
|
$likes = array();
|
||||||
|
@ -1095,8 +1092,6 @@ function fbsync_processfeed($data){
|
||||||
}
|
}
|
||||||
unset($applications);
|
unset($applications);
|
||||||
|
|
||||||
|
|
||||||
//FIXME: Need $self, which is in the fetch_data function
|
|
||||||
foreach ($posts AS $post) {
|
foreach ($posts AS $post) {
|
||||||
if ($post->updated_time > $last_updated)
|
if ($post->updated_time > $last_updated)
|
||||||
$last_updated = $post->updated_time;
|
$last_updated = $post->updated_time;
|
||||||
|
|
|
@ -80,7 +80,7 @@ Class Facebook_Graph21 extends Facebook
|
||||||
$type = "link";
|
$type = "link";
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//TODO: Body needs more testing, and has some more frindge cases.
|
//TODO: Body needs more testing, and has some more fringe cases.
|
||||||
$postarray["body"] = $this->AssembleBody($post->name, $post->link, $post->description, $post->picture); //"This is the body. [quote]This is the quote.[/quote]";
|
$postarray["body"] = $this->AssembleBody($post->name, $post->link, $post->description, $post->picture); //"This is the body. [quote]This is the quote.[/quote]";
|
||||||
|
|
||||||
//TODO: Do tags
|
//TODO: Do tags
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue