use Friendica\Protocol\Diaspora;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
+use Friendica\Util\Proxy as ProxyUtils;
use Friendica\Util\Temporal;
require_once 'include/dba.php';
-require_once 'mod/proxy.php';
class Profile
{
*/
public static function getByNickname($nickname, $uid = 0, $profile_id = 0)
{
- if (remote_user() && count($_SESSION['remote'])) {
+ if (remote_user() && !empty($_SESSION['remote'])) {
foreach ($_SESSION['remote'] as $visitor) {
if ($visitor['uid'] == $uid) {
$contact = DBA::selectFirst('contact', ['profile-id'], ['id' => $visitor['cid']]);
$connect = $profile['uid'] != local_user() ? L10n::t('Connect') : false;
// don't show connect link to authenticated visitors either
- if (remote_user() && count($_SESSION['remote'])) {
+ if (remote_user() && !empty($_SESSION['remote'])) {
foreach ($_SESSION['remote'] as $visitor) {
if ($visitor['uid'] == $profile['uid']) {
$connect = false;
$subscribe_feed = false;
}
+ $wallmessage = false;
+ $wallmessage_link = false;
+
if (remote_user() || (self::getMyURL() && x($profile, 'unkmail') && ($profile['uid'] != local_user()))) {
$wallmessage = L10n::t('Message');
- $wallmessage_link = 'wallmessage/' . $profile['nickname'];
if (remote_user()) {
$r = q(
$remote_url = $r[0]['url'];
$message_path = preg_replace('=(.*)/profile/(.*)=ism', '$1/message/new/', $remote_url);
$wallmessage_link = $message_path . base64_encode($profile['addr']);
+ } else if (!empty($profile['nickname'])) {
+ $wallmessage_link = 'wallmessage/' . $profile['nickname'];
}
- } else {
- $wallmessage = false;
- $wallmessage_link = false;
}
// show edit profile to yourself
}
if (isset($p['photo'])) {
- $p['photo'] = proxy_url($p['photo'], false, PROXY_SIZE_SMALL);
+ $p['photo'] = ProxyUtils::proxifyUrl($p['photo'], false, ProxyUtils::SIZE_SMALL);
}
$p['url'] = Contact::magicLink(defaults($p, 'url', $profile_url));
$istoday = false;
while ($rr = DBA::fetch($s)) {
- if (strlen($rr['name'])) {
+ if (strlen($rr['summary'])) {
$total ++;
}
- $strt = DateTimeFormat::convert($rr['start'], $rr['convert'] ? $a->timezone : 'UTC', 'UTC', 'Y-m-d');
+ $strt = DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->timezone : 'UTC', 'UTC', 'Y-m-d');
if ($strt === DateTimeFormat::timezoneNow($a->timezone, 'Y-m-d')) {
$istoday = true;
}
$description = L10n::t('[No description]');
}
- $strt = DateTimeFormat::convert($rr['start'], $rr['convert'] ? $a->timezone : 'UTC');
+ $strt = DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->timezone : 'UTC');
if (substr($strt, 0, 10) < DateTimeFormat::timezoneNow($a->timezone, 'Y-m-d')) {
continue;