+use Friendica\Core\Config;
+use Friendica\Core\PConfig;
+use Friendica\Core\System;
+use Friendica\Core\Worker;
+use Friendica\Database\DBM;
logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
notice( t('Requested profile is not available.') . EOL );
$a->error = 404;
logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
notice( t('Requested profile is not available.') . EOL );
$a->error = 404;
$a->profile['network'] = NETWORK_DFRN;
$a->page['title'] = $a->profile['name'] . " @ " . $a->config['sitename'];
$a->profile['network'] = NETWORK_DFRN;
$a->page['title'] = $a->profile['name'] . " @ " . $a->config['sitename'];
foreach ($_SESSION['remote'] as $visitor) {
if ($visitor['uid'] == $uid) {
$r = dba::select('contact', array('profile-id'), array('id' => $visitor['cid']), array('limit' => 1));
foreach ($_SESSION['remote'] as $visitor) {
if ($visitor['uid'] == $uid) {
$r = dba::select('contact', array('profile-id'), array('id' => $visitor['cid']), array('limit' => 1));
$r = dba::fetch_first("SELECT `contact`.`id` AS `contact_id`, `contact`.`photo` as `contact_photo`,
`contact`.`thumb` AS `contact_thumb`, `contact`.`micro` AS `contact_micro`,
`profile`.`uid` AS `profile_uid`, `profile`.*,
$r = dba::fetch_first("SELECT `contact`.`id` AS `contact_id`, `contact`.`photo` as `contact_photo`,
`contact`.`thumb` AS `contact_thumb`, `contact`.`micro` AS `contact_micro`,
`profile`.`uid` AS `profile_uid`, `profile`.*,
- $r = dba::select('contact', array('id'),
- array('pending' => false, 'uid' => local_user(), 'nurl' => $profile_url), array('limit' => 1));
- if (dbm::is_result($r))
+ if (dba::exists('contact', array('pending' => false, 'uid' => local_user(), 'nurl' => $profile_url))) {
// show edit profile to yourself
if (!$is_contact && $profile['uid'] == local_user() && feature_enabled(local_user(),'multi_profiles')) {
// 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'));
- $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,
$profile['menu'] = array(
'chg_photo' => t('Change profile photo'),
'cr_new' => null,
if ($profile['guid'] != "")
$diaspora = array(
'guid' => $profile['guid'],
if ($profile['guid'] != "")
$diaspora = array(
'guid' => $profile['guid'],
'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ),
'nickname' => $profile['nickname'],
'fullname' => $profile['name'],
'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ),
'nickname' => $profile['nickname'],
'fullname' => $profile['name'],
if (is_array($a->profile) && !$a->profile['hide-friends']) {
$r = q("SELECT `gcontact`.`updated` FROM `contact` INNER JOIN `gcontact` WHERE `gcontact`.`nurl` = `contact`.`nurl` AND `self` AND `uid` = %d LIMIT 1",
intval($a->profile['uid']));
if (is_array($a->profile) && !$a->profile['hide-friends']) {
$r = q("SELECT `gcontact`.`updated` FROM `contact` INNER JOIN `gcontact` WHERE `gcontact`.`nurl` = `contact`.`nurl` AND `self` AND `uid` = %d LIMIT 1",
intval($a->profile['uid']));
$updated = date("c", strtotime($r[0]['updated']));
$r = q("SELECT COUNT(*) AS `total` FROM `contact`
$updated = date("c", strtotime($r[0]['updated']));
$r = q("SELECT COUNT(*) AS `total` FROM `contact`
- intval(local_user()),
- dbesc(datetime_convert('UTC','UTC','now + 6 days')),
- dbesc(datetime_convert('UTC','UTC','now'))
+ local_user(),
+ datetime_convert('UTC','UTC','now + 6 days'),
+ datetime_convert('UTC','UTC','now')
}
$tpl = get_markup_template("birthdays_reminder.tpl");
return replace_macros($tpl, array(
}
$tpl = get_markup_template("birthdays_reminder.tpl");
return replace_macros($tpl, array(
'$classtoday' => $classtoday,
'$count' => $total,
'$event_reminders' => t('Birthday Reminders'),
'$classtoday' => $classtoday,
'$count' => $total,
'$event_reminders' => t('Birthday Reminders'),
- $r = q("SELECT `event`.* FROM `event`
- WHERE `event`.`uid` = %d AND `type` != 'birthday' AND `start` < '%s' AND `start` >= '%s'
+ $s = dba::p("SELECT `event`.* FROM `event`
+ WHERE `event`.`uid` = ? AND `type` != 'birthday' AND `start` < ? AND `start` >= ?
- intval(local_user()),
- dbesc(datetime_convert('UTC','UTC','now + 7 days')),
- dbesc(datetime_convert('UTC','UTC','now - 1 days'))
+ local_user(),
+ datetime_convert('UTC','UTC','now + 7 days'),
+ datetime_convert('UTC','UTC','now - 1 days')
if ($strt === datetime_convert('UTC',$a->timezone,'now','Y-m-d')) {
$istoday = true;
}
if ($strt === datetime_convert('UTC',$a->timezone,'now','Y-m-d')) {
$istoday = true;
}
$title = strip_tags(html_entity_decode(bbcode($rr['summary']),ENT_QUOTES,'UTF-8'));
if (strlen($title) > 35) {
$title = strip_tags(html_entity_decode(bbcode($rr['summary']),ENT_QUOTES,'UTF-8'));
if (strlen($title) > 35) {
$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')) {
$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')) {
$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;
$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;
$tpl = get_markup_template("events_reminder.tpl");
return replace_macros($tpl, array(
$tpl = get_markup_template("events_reminder.tpl");
return replace_macros($tpl, array(
'$event_reminders' => t('Event Reminders'),
'$event_title' => t('Events this week:'),
'$events' => $r,
'$event_reminders' => t('Event Reminders'),
'$event_title' => t('Events this week:'),
'$events' => $r,
- $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'));
'sel' => ((!isset($tab) && $a->argv[0]=='photos') ? 'active' : ''),
'title' => t('Photo Albums'),
'id' => 'photo-tab',
'sel' => ((!isset($tab) && $a->argv[0]=='photos') ? 'active' : ''),
'title' => t('Photo Albums'),
'id' => 'photo-tab',
'sel' =>((!isset($tab) && $a->argv[0]=='events') ? 'active' : ''),
'title' => t('Events and Calendar'),
'id' => 'events-tab',
'sel' =>((!isset($tab) && $a->argv[0]=='events') ? 'active' : ''),
'title' => t('Events and Calendar'),
'id' => 'events-tab',
'sel' =>((!isset($tab) && $a->argv[0]=='cal') ? 'active' : ''),
'title' => t('Events and Calendar'),
'id' => 'events-tab',
'sel' =>((!isset($tab) && $a->argv[0]=='cal') ? 'active' : ''),
'title' => t('Events and Calendar'),
'id' => 'events-tab',
'sel' =>((!isset($tab) && $a->argv[0]=='notes') ? 'active' : ''),
'title' => t('Only You Can See This'),
'id' => 'notes-tab',
'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'),
if ((! $is_owner) && ((count($a->profile)) || (! $a->profile['hide-friends']))) {
$tabs[] = array(
'label' => t('Contacts'),
'sel' => ((!isset($tab) && $a->argv[0]=='viewcontacts') ? 'active' : ''),
'title' => t('Contacts'),
'id' => 'viewcontacts-tab',
'sel' => ((!isset($tab) && $a->argv[0]=='viewcontacts') ? 'active' : ''),
'title' => t('Contacts'),
'id' => 'viewcontacts-tab',
$arr = array('zrl' => $tmp_str, 'url' => $a->cmd);
call_hooks('zrl_init', $arr);
}
$arr = array('zrl' => $tmp_str, 'url' => $a->cmd);
call_hooks('zrl_init', $arr);
}