*/
use Friendica\App;
+use Friendica\Core\System;
require_once 'include/ForumManager.php';
require_once 'include/bbcode.php';
$pdata = get_profiledata_by_nick($nickname, $user[0]['uid'], $profile);
- if (($pdata === false) || (!count($pdata)) && !count($profiledata)) {
+ if (empty($pdata) && empty($profiledata)) {
logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
notice( t('Requested profile is not available.') . EOL );
$a->error = 404;
if (isset($profile["url"])) {
$profile_url = normalise_link($profile["url"]);
} else {
- $profile_url = normalise_link(App::get_baseurl()."/profile/".$profile["nickname"]);
+ $profile_url = normalise_link(System::baseUrl()."/profile/".$profile["nickname"]);
}
- $connect = !dba::exists('contact', array('pending' => false, 'uid' => local_user(), 'nurl' => $profile_url));
+ if (dba::exists('contact', array('pending' => false, 'uid' => local_user(), 'nurl' => $profile_url))) {
+ $connect = false;
+ }
}
if ($connect && ($profile['network'] != NETWORK_DFRN) && !isset($profile['remoteconnect']))
// show edit profile to yourself
if (!$is_contact && $profile['uid'] == local_user() && feature_enabled(local_user(),'multi_profiles')) {
- $profile['edit'] = array(App::get_baseurl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles'));
+ $profile['edit'] = array(System::baseUrl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles'));
$r = q("SELECT * FROM `profile` WHERE `uid` = %d",
local_user());
}
}
if (!$is_contact && $profile['uid'] == local_user() && !feature_enabled(local_user(),'multi_profiles')) {
- $profile['edit'] = array(App::get_baseurl(). '/profiles/'.$profile['id'], t('Edit profile'),"", t('Edit profile'));
+ $profile['edit'] = array(System::baseUrl(). '/profiles/'.$profile['id'], t('Edit profile'),"", t('Edit profile'));
$profile['menu'] = array(
'chg_photo' => t('Change profile photo'),
'cr_new' => null,
if ($profile['guid'] != "")
$diaspora = array(
'guid' => $profile['guid'],
- 'podloc' => App::get_baseurl(),
+ 'podloc' => System::baseUrl(),
'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ),
'nickname' => $profile['nickname'],
'fullname' => $profile['name'],
$url = $rr['url'];
if ($rr['network'] === NETWORK_DFRN) {
$sparkle = " sparkle";
- $url = App::get_baseurl() . '/redir/' . $rr['cid'];
+ $url = System::baseUrl() . '/redir/' . $rr['cid'];
}
$rr['link'] = $url;
}
$tpl = get_markup_template("birthdays_reminder.tpl");
return replace_macros($tpl, array(
- '$baseurl' => App::get_baseurl(),
+ '$baseurl' => System::baseUrl(),
'$classtoday' => $classtoday,
'$count' => $total,
'$event_reminders' => t('Birthday Reminders'),
$bd_format = t('g A l F d') ; // 8 AM Friday January 18
$bd_short = t('F d');
- $r = dba::p("SELECT `event`.* FROM `event`
+ $s = dba::p("SELECT `event`.* FROM `event`
WHERE `event`.`uid` = ? AND `type` != 'birthday' AND `start` < ? AND `start` >= ?
ORDER BY `start` ASC ",
local_user(),
datetime_convert('UTC','UTC','now - 1 days')
);
- if (dbm::is_result($r)) {
+ $r = array();
+
+ if (dbm::is_result($s)) {
$now = strtotime('now');
$istoday = false;
- $skip = 0;
- while ($rr = dba::fetch($r)) {
+ while ($rr = dba::fetch($s)) {
if (strlen($rr['name'])) {
$total ++;
}
$strt = datetime_convert('UTC',$rr['convert'] ? $a->timezone : 'UTC',$rr['start']);
if (substr($strt,0,10) < datetime_convert('UTC',$a->timezone,'now','Y-m-d')) {
- $skip++;
continue;
}
$rr['date'] = day_translate(datetime_convert('UTC', $rr['adjust'] ? $a->timezone : 'UTC', $rr['start'], $bd_format)) . (($today) ? ' ' . t('[today]') : '');
$rr['startime'] = $strt;
$rr['today'] = $today;
+
+ $r[] = $rr;
}
- dba::close($r);
+ dba::close($s);
$classtoday = (($istoday) ? 'event-today' : '');
}
-
$tpl = get_markup_template("events_reminder.tpl");
return replace_macros($tpl, array(
- '$baseurl' => App::get_baseurl(),
+ '$baseurl' => System::baseUrl(),
'$classtoday' => $classtoday,
- '$count' => count($r) - $skip,
+ '$count' => count($r),
'$event_reminders' => t('Event Reminders'),
'$event_title' => t('Events this week:'),
'$events' => $r,
}
if ($a->profile['uid'] == local_user()) {
- $profile['edit'] = array(App::get_baseurl(). '/profiles/'.$a->profile['id'], t('Edit profile'),"", t('Edit profile'));
+ $profile['edit'] = array(System::baseUrl(). '/profiles/'.$a->profile['id'], t('Edit profile'),"", t('Edit profile'));
}
return replace_macros($tpl, array(
$tab = notags(trim($_GET['tab']));
}
- $url = App::get_baseurl() . '/profile/' . $nickname;
+ $url = System::baseUrl() . '/profile/' . $nickname;
$tabs = array(
array(
),
array(
'label' => t('Photos'),
- 'url' => App::get_baseurl() . '/photos/' . $nickname,
+ 'url' => System::baseUrl() . '/photos/' . $nickname,
'sel' => ((!isset($tab) && $a->argv[0]=='photos') ? 'active' : ''),
'title' => t('Photo Albums'),
'id' => 'photo-tab',
),
array(
'label' => t('Videos'),
- 'url' => App::get_baseurl() . '/videos/' . $nickname,
+ 'url' => System::baseUrl() . '/videos/' . $nickname,
'sel' => ((!isset($tab) && $a->argv[0]=='videos') ? 'active' : ''),
'title' => t('Videos'),
'id' => 'video-tab',
if ($is_owner && $a->theme_events_in_profile) {
$tabs[] = array(
'label' => t('Events'),
- 'url' => App::get_baseurl() . '/events',
+ 'url' => System::baseUrl() . '/events',
'sel' =>((!isset($tab) && $a->argv[0]=='events') ? 'active' : ''),
'title' => t('Events and Calendar'),
'id' => 'events-tab',
} elseif (! $is_owner) {
$tabs[] = array(
'label' => t('Events'),
- 'url' => App::get_baseurl() . '/cal/' . $nickname,
+ 'url' => System::baseUrl() . '/cal/' . $nickname,
'sel' =>((!isset($tab) && $a->argv[0]=='cal') ? 'active' : ''),
'title' => t('Events and Calendar'),
'id' => 'events-tab',
if ($is_owner) {
$tabs[] = array(
'label' => t('Personal Notes'),
- 'url' => App::get_baseurl() . '/notes',
+ 'url' => System::baseUrl() . '/notes',
'sel' =>((!isset($tab) && $a->argv[0]=='notes') ? 'active' : ''),
'title' => t('Only You Can See This'),
'id' => 'notes-tab',
if ((! $is_owner) && ((count($a->profile)) || (! $a->profile['hide-friends']))) {
$tabs[] = array(
'label' => t('Contacts'),
- 'url' => App::get_baseurl() . '/viewcontacts/' . $nickname,
+ 'url' => System::baseUrl() . '/viewcontacts/' . $nickname,
'sel' => ((!isset($tab) && $a->argv[0]=='viewcontacts') ? 'active' : ''),
'title' => t('Contacts'),
'id' => 'viewcontacts-tab',