$contacts = self::getList($uid, $lastitem, false, false);
$total_shown = 0;
-
+ $forumlist = '';
foreach ($contacts as $contact) {
$forumlist .= micropro($contact, false, 'forumlist-profile-advanced');
$total_shown ++;
}
// Frequently clear cache
- self::clear($duration);
+ self::clear();
$r = dba::select('cache', array('v'), array('k' => $key), array('limit' => 1));
public function introNotifs($all = false, $start = 0, $limit = 80)
{
$ident = 'introductions';
- $total = $this->introTotal($seen);
+ $total = $this->introTotal($all);
$notifs = array();
$sql_extra = "";
// manage array value
$dbvalue = (is_array($value) ? serialize($value) : $dbvalue);
- dba::update('pconfig', array('v' => $dbvalue), array('uid' => $uid, 'cat' => $family, 'k' => $key), true);
+ $ret = dba::update('pconfig', array('v' => $dbvalue), array('uid' => $uid, 'cat' => $family, 'k' => $key), true);
if ($ret) {
self::$in_db[$uid][$family][$key] = true;
return false;
}
+ $group = dba::select('group', ['uid'], ['gid' => $gid], ['limit' => 1]);
+ if (!DBM::is_result($group)) {
+ return false;
+ }
+
// remove group from default posting lists
- $user = dba::select('user', ['def_gid', 'allow_gid', 'deny_gid'], ['uid' => $uid], ['limit' => 1]);
+ $user = dba::select('user', ['def_gid', 'allow_gid', 'deny_gid'], ['uid' => $group['uid']], ['limit' => 1]);
if (DBM::is_result($user)) {
$change = false;
}
if ($change) {
- dba::update('user', $user, ['uid' => $uid]);
+ dba::update('user', $user, ['uid' => $group['uid']]);
}
}
logger(__function__.":".$consumer_key);
$s = dba::select('clients', array('client_id', 'pw', 'redirect_uri'), array('client_id' => $consumer_key));
- $r = dba::inArray($r);
+ $r = dba::inArray($s);
if (DBM::is_result($r)) {
return new \OAuthConsumer($r[0]['client_id'], $r[0]['pw'], $r[0]['redirect_uri']);
'secret' => $sec,
'client_id' => $k,
'scope' => 'request',
- 'expires' => UNIX_TIMESTAMP() + REQUEST_TOKEN_DURATION)
+ 'expires' => time() + REQUEST_TOKEN_DURATION)
);
if (!$r) {
'secret' => $sec,
'client_id' => $consumer->key,
'scope' => 'access',
- 'expires' => UNIX_TIMESTAMP() + ACCESS_TOKEN_DURATION,
+ 'expires' => time() + ACCESS_TOKEN_DURATION,
'uid' => $uverifier)
);
/// @todo Do we really need this check for HTML elements? (It was copied from the old function)
if ((strpos($item['body'], '<') !== false) && (strpos($item['body'], '>') !== false)) {
+ $base_url = get_app()->get_baseurl();
$item['body'] = reltoabs($item['body'], $base_url);
$item['body'] = html2bb_video($item['body']);
// The account type is new since 3.5.1
if ($xpath->query("/atom:feed/dfrn:account_type")->length > 0) {
- $accounttype = intval($xpath->evaluate("/atom:feed/dfrn:account_type/text()", $context)->item(0)->nodeValue);
+ $accounttype = intval($xpath->evaluate("/atom:feed/dfrn:account_type/text()")->item(0)->nodeValue);
if ($accounttype != $importer["contact-type"]) {
dba::update('contact', array('contact-type' => $accounttype), array('id' => $importer["id"]));
// is it a public forum? Private forums aren't supported with this method
// This is deprecated since 3.5.1
- $forum = intval($xpath->evaluate("/atom:feed/dfrn:community/text()", $context)->item(0)->nodeValue);
+ $forum = intval($xpath->evaluate("/atom:feed/dfrn:community/text()")->item(0)->nodeValue);
if ($forum != $importer["forum"]) {
$condition = array('`forum` != ? AND `id` = ?', $forum, $importer["id"]);
} elseif (!in_array($fieldname, array("author_signature", "parent_author_signature", "target_author_signature"))) {
if ($signed_data != "") {
$signed_data .= ";";
- $signed_data_parent .= ";";
}
$signed_data .= $entry;
$A = "[url=".$self[0]["url"]."]".$self[0]["name"]."[/url]";
$B = "[url=".$contact["url"]."]".$contact["name"]."[/url]";
$BPhoto = "[url=".$contact["url"]."][img]".$contact["thumb"]."[/img][/url]";
- $arr["body"] = sprintf(t("%1$s is now friends with %2$s"), $A, $B)."\n\n\n".$Bphoto;
+ $arr["body"] = sprintf(t('%1$s is now friends with %2$s'), $A, $B)."\n\n\n".$BPhoto;
$arr["object"] = self::constructNewFriendObject($contact);
$arr["last-child"] = 1;
- $arr["allow_cid"] = $user[0]["allow_cid"];
- $arr["allow_gid"] = $user[0]["allow_gid"];
- $arr["deny_cid"] = $user[0]["deny_cid"];
- $arr["deny_gid"] = $user[0]["deny_gid"];
+ $arr["allow_cid"] = $self[0]["allow_cid"];
+ $arr["allow_gid"] = $self[0]["allow_gid"];
+ $arr["deny_cid"] = $self[0]["deny_cid"];
+ $arr["deny_gid"] = $self[0]["deny_gid"];
$i = item_store($arr);
if ($i) {
$return_code = self::transmit($owner, $contact, $envelope, $public_batch, false, $guid);
}
- logger("guid: ".$item["guid"]." result ".$return_code, LOGGER_DEBUG);
+ logger("guid: ".$guid." result ".$return_code, LOGGER_DEBUG);
return $return_code;
}
if ($value != "") {
$author["author-nick"] = $value;
}
- $value = $xpath->evaluate('atom:author/poco:address/poco:formatted/text()', $context)->item(0)->nodeValue;
+ $value = $xpath->evaluate('atom:author/poco:address/poco:formatted/text()')->item(0)->nodeValue;
if ($value != "") {
$author["author-location"] = $value;
}
if ($creator != "") {
$item["author-name"] = $creator;
}
- if ($pubDate != "") {
- $item["edited"] = $item["created"] = $pubDate;
- }
$creator = $xpath->query('dc:creator/text()', $entry)->item(0)->nodeValue;
if ($creator != "") {
return false;
}
- $server["site_name"] = $xpath->evaluate($element."//head/title/text()", $context)->item(0)->nodeValue;
+ $server["site_name"] = $xpath->evaluate($element."//head/title/text()")->item(0)->nodeValue;
return $server;
}
$file = $temp.'/'.$fn_name.'.sem';
if (!file_exists($file)) {
- file_put_contents($file, $function);
+ file_put_contents($file, $fn_name);
}
return ftok($file, 'f');
// Go through the tags.
$repeated_tag_index = array(); // Multiple tags with same name will be turned into an array
foreach ($xml_values as $data) {
- unset($attributes, $value); // Remove existing values, or there will be trouble
-
- // This command will extract these variables into the foreach scope
- // tag(string), type(string), level(int), attributes(array).
- extract($data); // We could use the array by itself, but this cooler.
+ $tag = $data['tag'];
+ $type = $data['type'];
+ $level = $data['level'];
+ $attributes = isset($data['attributes']) ? $data['attributes'] : null;
+ $value = isset($data['value']) ? $data['value'] : null;
$result = array();
$attributes_data = array();
foreach ($a->hooks["cron"] as $single_hook) {
if ($single_hook[1] == $hook) {
logger("Calling cron hook '" . $hook . "'", LOGGER_DEBUG);
- call_single_hook($a, $name, $single_hook, $data);
+ call_single_hook($a, $hook, $single_hook);
}
}
return;
foreach ($a->hooks["expire"] as $hook) {
if ($hook[1] == $hook_name) {
logger("Calling expire hook '" . $hook[1] . "'", LOGGER_DEBUG);
- call_single_hook($a, $name, $hook, $data);
+ call_single_hook($a, $hook_name, $hook, $data);
}
}
return;
dba::update('gcontact', array('last_failure' => $updated), array('nurl' => $contact['nurl']));
Contact::markForArchival($contact);
} else {
+ $updated = datetime_convert();
dba::update('contact', array('last-update' => $updated), array('id' => $contact['id']));
}
*/
$r = q("SELECT `id` FROM `queue` WHERE ((`created` > UTC_TIMESTAMP() - INTERVAL 12 HOUR AND `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE) OR (`last` < UTC_TIMESTAMP() - INTERVAL 1 HOUR)) ORDER BY `cid`, `created`");
- call_hooks('queue_predeliver', $a, $r);
+ call_hooks('queue_predeliver', $r);
if (DBM::is_result($r)) {
foreach ($r as $q_item) {
default:
$params = array('owner' => $owner, 'contact' => $contact, 'queue' => $q_item, 'result' => false);
- call_hooks('queue_deliver', $a, $params);
+ call_hooks('queue_deliver', $params);
if ($params['result']) {
remove_queue_item($q_item['id']);