use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Network\Probe;
+use Friendica\Object\Contact;
use Friendica\Object\Profile;
use Friendica\Protocol\PortableContact;
use dba;
require_once 'include/datetime.php';
require_once 'include/network.php';
require_once 'include/html2bbcode.php';
-require_once 'include/Photo.php';
/**
* @brief This class handles GlobalContact related functions
if (DBM::is_result($r)) {
logger("Update public contact ".$r[0]["id"], LOGGER_DEBUG);
- update_contact_avatar($contact["photo"], 0, $r[0]["id"]);
+ Contact::updateAvatar($contact["photo"], 0, $r[0]["id"]);
$fields = array('name', 'nick', 'addr',
'network', 'bd', 'gender',
}
}
- public static function getRandomUrl() {
- $r = q("SELECT `url` FROM `gcontact` WHERE `network` = '%s'
+ /**
+ * @return string
+ */
+ public static function getRandomUrl()
+ {
+ $r = q(
+ "SELECT `url` FROM `gcontact` WHERE `network` = '%s'
AND `last_contact` >= `last_failure`
AND `updated` > UTC_TIMESTAMP - INTERVAL 1 MONTH
ORDER BY rand() LIMIT 1",
- dbesc(NETWORK_DFRN));
+ dbesc(NETWORK_DFRN)
+ );
- if (DBM::is_result($r))
+ if (DBM::is_result($r)) {
return dirname($r[0]['url']);
+ }
+
return '';
}
}