Update function calls

update function calls to use profile class
This commit is contained in:
Adam Magness 2018-01-14 21:22:39 -05:00
commit 4fb2547df8
45 changed files with 360 additions and 294 deletions

View file

@ -1,5 +1,4 @@
<?php
/**
* @file mod/allfriends.php
*/
@ -9,7 +8,10 @@ use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Model\Profile;
use dba;
require_once 'include/dba.php';
require_once 'mod/contacts.php';
function allfriends_content(App $a)
@ -31,17 +33,14 @@ function allfriends_content(App $a)
$uid = $a->user['uid'];
$c = q("SELECT `name`, `url`, `photo` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($cid),
intval(local_user())
);
$c = dba::selectFirst('contact', ['name', 'url', 'photo'], ['id' => $cid, 'uid' => local_user()]);
if (!DBM::is_result($c)) {
return;
}
$a->page['aside'] = "";
profile_load($a, "", 0, Contact::getDetailsByURL($c[0]["url"]));
Profile::load($a, "", 0, Contact::getDetailsByURL($c[0]["url"]));
$total = GContact::countAllFriends(local_user(), $cid);
@ -71,7 +70,7 @@ function allfriends_content(App $a)
} else {
$connlnk = System::baseUrl() . '/follow/?url=' . $rr['url'];
$photo_menu = array(
'profile' => array(t("View Profile"), zrl($rr['url'])),
'profile' => array(t("View Profile"), Profile::zrl($rr['url'])),
'follow' => array(t("Connect/Follow"), $connlnk)
);
}

View file

@ -5,7 +5,6 @@
* This calendar is for profile visitors and contains only the events
* of the profile owner
*/
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Core\Config;
@ -13,6 +12,7 @@ use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Group;
use Friendica\Model\Profile;
use Friendica\Protocol\DFRN;
require_once 'include/event.php';
@ -45,7 +45,7 @@ function cal_init(App $a)
return;
}
$profile = get_profiledata_by_nick($nick, $a->profile_uid);
$profile = Profile::getProfiledataByNick($nick, $a->profile_uid);
$account_type = Contact::getAccountType($profile);
@ -144,7 +144,7 @@ function cal_content(App $a)
$sql_extra = " AND `event`.`cid` = 0 " . $sql_perms;
// get the tab navigation bar
$tabs = profile_tabs($a, false, $a->data['user']['nickname']);
$tabs = Profile::getTabs($a, false, $a->data['user']['nickname']);
// The view mode part is similiar to /mod/events.php
if ($mode == 'view') {

View file

@ -1,5 +1,4 @@
<?php
/**
* @file include/common.php
*/
@ -8,7 +7,10 @@ use Friendica\Content\ContactSelector;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Model\Profile;
use dba;
require_once 'include/dba.php';
require_once 'mod/contacts.php';
function common_content(App $a)
@ -34,40 +36,39 @@ function common_content(App $a)
}
if ($cmd === 'loc' && $cid) {
$c = q("SELECT `name`, `url`, `photo` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($cid),
intval($uid)
);
/// @TODO Handle $c with DBM::is_result()
$a->page['aside'] = "";
profile_load($a, "", 0, Contact::getDetailsByURL($c[0]["url"]));
} else {
$c = q("SELECT `name`, `url`, `photo` FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
intval($uid)
);
/// @TODO Handle $c with DBM::is_result()
$vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"), array(
'$name' => htmlentities($c[0]['name']),
'$photo' => $c[0]['photo'],
'url' => 'contacts/' . $cid
));
$c = dba::selectFirst('contact', ['name', 'url', 'photo'], ['id' => $cid, 'uid' => $uid]);
if (!x($a->page, 'aside')) {
$a->page['aside'] = '';
if (DBM::is_result($c)) {
$a->page['aside'] = "";
Profile::load($a, "", 0, Contact::getDetailsByURL($c["url"]));
}
} else {
$c = dba::selectFirst('contact', ['name', 'url', 'photo'], ['self' => true, 'uid' => $uid]);
if (DBM::is_result($c)) {
$vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"), array(
'$name' => htmlentities($c['name']),
'$photo' => $c['photo'],
'url' => 'contacts/' . $cid
));
if (!x($a->page, 'aside')) {
$a->page['aside'] = '';
}
$a->page['aside'] .= $vcard_widget;
}
$a->page['aside'] .= $vcard_widget;
}
if (!DBM::is_result($c)) {
return;
}
if (!$cid && get_my_url()) {
$contact = dba::selectFirst('contact', ['id'], ['nurl' => normalise_link(get_my_url()), 'uid' => $uid]);
if (!$cid && Profile::getMyURL()) {
$contact = dba::selectFirst('contact', ['id'], ['nurl' => normalise_link(Profile::getMyURL()), 'uid' => $uid]);
if (DBM::is_result($contact)) {
$cid = $contact['id'];
} else {
$gcontact = dba::selectFirst('gcontact', ['id'], ['nurl' => normalise_link(get_my_url())]);
$gcontact = dba::selectFirst('gcontact', ['id'], ['nurl' => normalise_link(Profile::getMyURL())]);
if (DBM::is_result($gcontact)) {
$zcid = $gcontact['id'];
}

View file

@ -1,9 +1,7 @@
<?php
/**
* @file mod/contacts.php
*/
use Friendica\App;
use Friendica\Content\ContactSelector;
use Friendica\Core\System;
@ -12,6 +10,7 @@ use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Model\Group;
use Friendica\Model\Profile;
use Friendica\Network\Probe;
require_once 'include/contact_widgets.php';
@ -902,7 +901,7 @@ function contact_posts($a, $contact_id)
$contact = dba::selectFirst('contact', ['url'], ['id' => $contact_id]);
if (DBM::is_result($contact)) {
$a->page['aside'] = "";
profile_load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
Profile::load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
$o .= Contact::getPostsFromUrl($contact["url"]);
}

View file

@ -1,5 +1,4 @@
<?php
/**
* @file mod/crepair.php
*/
@ -7,6 +6,7 @@ use Friendica\App;
use Friendica\Core\Config;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
require_once 'mod/contacts.php';
@ -27,7 +27,7 @@ function crepair_init(App $a)
if (DBM::is_result($contact)) {
$a->data['contact'] = $contact;
profile_load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
Profile::load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
}
}

View file

@ -19,6 +19,7 @@ use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Group;
use Friendica\Model\User;
use Friendica\Model\Profile;
use Friendica\Module\Login;
use Friendica\Network\Probe;
@ -26,10 +27,11 @@ require_once 'include/enotify.php';
function dfrn_request_init(App $a)
{
if ($a->argc > 1)
if ($a->argc > 1) {
$which = $a->argv[1];
}
profile_load($a, $which);
Profile::load($a, $which);
return;
}
@ -183,7 +185,7 @@ function dfrn_request_post(App $a)
}
// (ignore reply, nothing we can do it failed)
// Old: goaway(zrl($dfrn_url));
// Old: goaway(Profile::zrl($dfrn_url));
goaway($forwardurl);
return; // NOTREACHED
}
@ -618,7 +620,7 @@ function dfrn_request_content(App $a)
}
} else {
// last, try a zrl
$myaddr = get_my_url();
$myaddr = Profile::getMyURL();
}
$target_addr = $a->profile['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3);

View file

@ -1,9 +1,12 @@
<?php
/**
* @file mod/directory.php
*/
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
function directory_init(App $a) {
$a->set_pager_itemspage(60);
@ -46,7 +49,7 @@ function directory_content(App $a) {
$gdirpath = '';
$dirurl = Config::get('system','directory');
if(strlen($dirurl)) {
$gdirpath = zrl($dirurl,true);
$gdirpath = Profile::zrl($dirurl,true);
}
if($search) {
@ -146,7 +149,7 @@ function directory_content(App $a) {
$location_e = $location;
$photo_menu = array(
'profile' => array(t("View Profile"), zrl($profile_link))
'profile' => array(t("View Profile"), Profile::zrl($profile_link))
);
$entry = array(

View file

@ -9,6 +9,7 @@ use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Model\Profile;
use Friendica\Network\Probe;
use Friendica\Protocol\PortableContact;
@ -214,7 +215,7 @@ function dirfind_content(App $a, $prefix = "") {
$connlnk = System::baseUrl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url);
$conntxt = t('Connect');
$photo_menu = array(
'profile' => array(t("View Profile"), zrl($jj->url)),
'profile' => array(t("View Profile"), Profile::zrl($jj->url)),
'follow' => array(t("Connect/Follow"), $connlnk)
);
}
@ -223,7 +224,7 @@ function dirfind_content(App $a, $prefix = "") {
$entry = array(
'alt_text' => $alt_text,
'url' => zrl($jj->url),
'url' => Profile::zrl($jj->url),
'itemurl' => $itemurl,
'name' => htmlentities($jj->name),
'thumb' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB),

View file

@ -1,15 +1,19 @@
<?php
/**
* @file mod/display.php
*/
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Group;
use Friendica\Model\Profile;
use Friendica\Protocol\DFRN;
function display_init(App $a) {
if (Config::get('system','block_public') && !local_user() && !remote_user()) {
function display_init(App $a)
{
if (Config::get('system', 'block_public') && !local_user() && !remote_user()) {
return;
}
@ -103,7 +107,7 @@ function display_init(App $a) {
}
}
profile_load($a, $nick, 0, $profiledata);
Profile::load($a, $nick, 0, $profiledata);
}
function display_fetchauthor($a, $item) {

View file

@ -3,12 +3,12 @@
* @file mod/events.php
* @brief The events module
*/
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Model\Profile;
require_once 'include/bbcode.php';
require_once 'include/datetime.php';
@ -237,7 +237,7 @@ function events_content(App $a) {
$tabs = '';
// tabs
if ($a->theme_events_in_profile) {
$tabs = profile_tabs($a, true);
$tabs = Profile::getTabs($a, true);
}
$mode = 'view';

View file

@ -6,9 +6,9 @@ use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Network\Probe;
function follow_post(App $a) {
if (!local_user()) {
@ -163,7 +163,7 @@ function follow_content(App $a) {
'$nickname' => "",
'$name' => $ret["name"],
'$url' => $ret["url"],
'$zrl' => zrl($ret["url"]),
'$zrl' => Profile::zrl($ret["url"]),
'$url_label' => t("Profile URL"),
'$myaddr' => $myaddr,
'$request' => $request,
@ -177,7 +177,7 @@ function follow_content(App $a) {
$a->page['aside'] = "";
profile_load($a, "", 0, Contact::getDetailsByURL($ret["url"]), false);
Profile::load($a, "", 0, Contact::getDetailsByURL($ret["url"]), false);
if ($gcontact_id <> 0) {
$o .= replace_macros(get_markup_template('section_title.tpl'),

View file

@ -1,18 +1,19 @@
<?php
/**
* @file mod/hcard.php
*/
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\System;
function hcard_init(App $a) {
$blocked = (((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
function hcard_init(App $a)
{
$blocked = (((Config::get('system', 'block_public')) && (! local_user()) && (! remote_user())) ? true : false);
if ($a->argc > 1) {
$which = $a->argv[1];
}
else {
notice( t('No profile') . EOL );
} else {
notice(t('No profile') . EOL);
$a->error = 404;
return;
}
@ -23,22 +24,22 @@ function hcard_init(App $a) {
$profile = $a->argv[1];
}
profile_load($a,$which,$profile);
Profile::load($a, $which, $profile);
if ((x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY)) {
if ((x($a->profile, 'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY)) {
$a->page['htmlhead'] .= '<meta name="friendica.community" content="true" />';
}
if (x($a->profile,'openidserver')) {
if (x($a->profile, 'openidserver')) {
$a->page['htmlhead'] .= '<link rel="openid.server" href="' . $a->profile['openidserver'] . '" />' . "\r\n";
}
if (x($a->profile,'openid')) {
$delegate = ((strstr($a->profile['openid'],'://')) ? $a->profile['openid'] : 'http://' . $a->profile['openid']);
if (x($a->profile, 'openid')) {
$delegate = ((strstr($a->profile['openid'], '://')) ? $a->profile['openid'] : 'http://' . $a->profile['openid']);
$a->page['htmlhead'] .= '<link rel="openid.delegate" href="' . $delegate . '" />' . "\r\n";
}
if (! $blocked) {
$keywords = ((x($a->profile,'pub_keywords')) ? $a->profile['pub_keywords'] : '');
$keywords = str_replace(array(',',' ',',,'),array(' ',',',','),$keywords);
$keywords = ((x($a->profile, 'pub_keywords')) ? $a->profile['pub_keywords'] : '');
$keywords = str_replace(array(',',' ',',,'), array(' ',',',','), $keywords);
if (strlen($keywords)) {
$a->page['htmlhead'] .= '<meta name="keywords" content="' . $keywords . '" />' . "\r\n" ;
}
@ -54,5 +55,4 @@ function hcard_init(App $a) {
foreach ($dfrn_pages as $dfrn) {
$a->page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"".System::baseUrl()."/dfrn_{$dfrn}/{$which}\" />\r\n";
}
}

View file

@ -70,7 +70,7 @@ function hovercard_content()
'nick' => $contact['nick'],
'addr' => defaults($contact, 'addr', $contact['url']),
'thumb' => proxy_url($contact['thumb'], false, PROXY_SIZE_THUMB),
'url' => $cid ? ('redir/' . $cid) : zrl($contact['url']),
'url' => $cid ? ('redir/' . $cid) : Profile::zrl($contact['url']),
'nurl' => $contact['nurl'], // We additionally store the nurl as identifier
'location' => $contact['location'],
'gender' => $contact['gender'],

View file

@ -7,6 +7,7 @@ use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
require_once 'include/text.php';
require_once 'include/contact_widgets.php';
@ -83,14 +84,14 @@ function match_content(App $a)
$jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo);
$connlnk = System::baseUrl() . '/follow/?url=' . $jj->url;
$photo_menu = array(
'profile' => array(t("View Profile"), zrl($jj->url)),
'profile' => array(t("View Profile"), Profile::zrl($jj->url)),
'follow' => array(t("Connect/Follow"), $connlnk)
);
$contact_details = Contact::getDetailsByURL($jj->url, local_user());
$entry = array(
'url' => zrl($jj->url),
'url' => Profile::zrl($jj->url),
'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $jj->url),
'name' => $jj->name,
'details' => $contact_details['location'],

View file

@ -11,6 +11,7 @@ use Friendica\Core\PConfig;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Group;
use Friendica\Model\Profile;
use Friendica\Module\Login;
require_once 'include/conversation.php';
@ -459,9 +460,9 @@ function networkFlatView(App $a, $update = 0) {
$o .= status_editor($a, $x);
if (!Config::get('theme','hide_eventlist')) {
$o .= get_birthdays();
$o .= get_events();
if (!Config::get('theme', 'hide_eventlist')) {
$o .= Profile::getBirthdays();
$o .= Profile::getEvents();
}
}
@ -700,9 +701,9 @@ function networkThreadedView(App $a, $update = 0) {
}
}
if (!$gid && !$cid && !$update && !Config::get('theme','hide_eventlist')) {
$o .= get_birthdays();
$o .= get_events();
if (!$gid && !$cid && !$update && !Config::get('theme', 'hide_eventlist')) {
$o .= Profile::getBirthdays();
$o .= Profile::getEvents();
}
if ($datequery) {

View file

@ -1,23 +1,26 @@
<?php
/**
* @file mod/noscrape.php
*/
use Friendica\App;
use Friendica\Core\System;
use Friendica\Database\DBM;
function noscrape_init(App $a) {
if($a->argc > 1)
function noscrape_init(App $a)
{
if ($a->argc > 1) {
$which = $a->argv[1];
else
} else {
killme();
}
$profile = 0;
if((local_user()) && ($a->argc > 2) && ($a->argv[2] === 'view')) {
if ((local_user()) && ($a->argc > 2) && ($a->argv[2] === 'view')) {
$which = $a->user['nickname'];
$profile = $a->argv[1];
}
profile_load($a,$which,$profile);
Profile::load($a, $which, $profile);
if (!$a->profile['net-publish'] || $a->profile['hidewall']) {
header('Content-type: application/json; charset=utf-8');
@ -26,12 +29,11 @@ function noscrape_init(App $a) {
exit;
}
$keywords = ((x($a->profile,'pub_keywords')) ? $a->profile['pub_keywords'] : '');
$keywords = str_replace(array('#',',',' ',',,'),array('',' ',',',','),$keywords);
$keywords = ((x($a->profile, 'pub_keywords')) ? $a->profile['pub_keywords'] : '');
$keywords = str_replace(array('#',',',' ',',,'), array('',' ',',',','), $keywords);
$keywords = explode(',', $keywords);
$r = q("SELECT `photo` FROM `contact` WHERE `self` AND `uid` = %d",
intval($a->profile['uid']));
$r = dba::selectFirst('contact', ['photo'], ['self' => true, 'uid' => $a->profile['uid']]);
$json_info = array(
'fn' => $a->profile['name'],
@ -40,8 +42,8 @@ function noscrape_init(App $a) {
'guid' => $a->profile['guid'],
'key' => $a->profile['pubkey'],
'homepage' => System::baseUrl()."/profile/{$which}",
'comm' => (x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY),
'photo' => $r[0]["photo"],
'comm' => (x($a->profile, 'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY),
'photo' => $r["photo"],
'tags' => $keywords
);
@ -99,5 +101,4 @@ function noscrape_init(App $a) {
header('Content-type: application/json; charset=utf-8');
echo json_encode($json_info);
exit;
}

View file

@ -1,7 +1,10 @@
<?php
/**
* @file mod/notes.php
*/
use Friendica\App;
use Friendica\Database\DBM;
use Friendica\Model\Profile;
function notes_init(App $a) {
@ -15,7 +18,7 @@ function notes_init(App $a) {
nav_set_selected('home');
// profile_load($a,$which,$profile);
//Profile::load($a, $which, $profile);
}
@ -44,7 +47,7 @@ function notes_content(App $a, $update = false) {
$is_owner = true;
$o ="";
$o .= profile_tabs($a,True);
$o .= Profile::getTabs($a, true);
if(! $update) {
$o .= '<h3>' . t('Personal Notes') . '</h3>';

View file

@ -11,6 +11,7 @@ use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Group;
use Friendica\Model\Photo;
use Friendica\Model\Profile;
use Friendica\Network\Probe;
use Friendica\Object\Image;
use Friendica\Protocol\DFRN;
@ -48,7 +49,7 @@ function photos_init(App $a) {
$a->profile_uid = $user[0]['uid'];
$is_owner = (local_user() && (local_user() == $a->profile_uid));
$profile = get_profiledata_by_nick($nick, $a->profile_uid);
$profile = Profile::getProfiledataByNick($nick, $a->profile_uid);
$account_type = Contact::getAccountType($profile);
@ -1074,7 +1075,7 @@ function photos_content(App $a)
// tabs
$is_owner = (local_user() && (local_user() == $owner_uid));
$o .= profile_tabs($a, $is_owner, $a->data['user']['nickname']);
$o .= Profile::getTabs($a, $is_owner, $a->data['user']['nickname']);
// Display upload form
if ($datatype === 'upload') {

View file

@ -8,6 +8,7 @@ use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Group;
use Friendica\Model\Profile;
use Friendica\Module\Login;
use Friendica\Protocol\DFRN;
@ -41,7 +42,7 @@ function profile_init(App $a)
DFRN::autoRedir($a, $which);
}
profile_load($a, $which, $profile);
Profile::load($a, $which, $profile);
$blocked = !local_user() && !remote_user() && Config::get('system', 'block_public');
$userblock = !local_user() && !remote_user() && $a->profile['hidewall'];
@ -175,10 +176,10 @@ function profile_content(App $a, $update = 0)
$tab = notags(trim($_GET['tab']));
}
$o .= profile_tabs($a, $is_owner, $a->profile['nickname']);
$o .= Profile::getTabs($a, $is_owner, $a->profile['nickname']);
if ($tab === 'profile') {
$o .= advanced_profile($a);
$o .= Profile::getAdvanced($a);
call_hooks('profile_advanced', $o);
return $o;
}
@ -346,8 +347,8 @@ function profile_content(App $a, $update = 0)
}
if ($is_owner && !$update && !Config::get('theme', 'hide_eventlist')) {
$o .= get_birthdays();
$o .= get_events();
$o .= Profile::getBirthdays();
$o .= Profile::getEvents();
}

View file

@ -8,15 +8,16 @@ use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Model\Photo;
use Friendica\Model\Profile;
use Friendica\Object\Image;
function profile_photo_init(App $a) {
function profile_photo_init(App $a)
{
if (! local_user()) {
return;
}
profile_load($a,$a->user['nickname']);
Profile::load($a, $a->user['nickname']);
}
function profile_photo_post(App $a) {

View file

@ -142,7 +142,7 @@ function profiles_init(App $a) {
return;
}
profile_load($a,$a->user['nickname'], $r[0]['id']);
Profile::load($a, $a->user['nickname'], $r[0]['id']);
}

View file

@ -1,12 +1,14 @@
<?php
/**
* @file mod/profperm.php
*/
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Database\DBM;
function profperm_init(App $a) {
function profperm_init(App $a)
{
if (! local_user()) {
return;
}
@ -14,8 +16,7 @@ function profperm_init(App $a) {
$which = $a->user['nickname'];
$profile = $a->argv[1];
profile_load($a,$which,$profile);
Profile::load($a, $which, $profile);
}

View file

@ -1,14 +1,18 @@
<?php
/**
* @file mod/randprof.php
*/
use Friendica\App;
use Friendica\Core\System;
use Friendica\Model\GContact;
use Friendica\Model\Profile;
function randprof_init(App $a) {
function randprof_init(App $a)
{
$x = GContact::getRandomUrl();
if ($x) {
goaway(zrl($x));
goaway(Profile::zrl($x));
}
goaway(System::baseUrl() . '/profile');

View file

@ -8,6 +8,7 @@ use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Model\Profile;
require_once 'include/contact_widgets.php';
@ -82,7 +83,7 @@ function suggest_content(App $a) {
$connlnk = System::baseUrl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']);
$ignlnk = System::baseUrl() . '/suggest?ignore=' . $rr['id'];
$photo_menu = array(
'profile' => array(t("View Profile"), zrl($rr["url"])),
'profile' => array(t("View Profile"), Profile::zrl($rr["url"])),
'follow' => array(t("Connect/Follow"), $connlnk),
'hide' => array(t('Ignore/Hide'), $ignlnk)
);
@ -90,7 +91,7 @@ function suggest_content(App $a) {
$contact_details = Contact::getDetailsByURL($rr["url"], local_user(), $rr);
$entry = array(
'url' => zrl($rr['url']),
'url' => Profile::zrl($rr['url']),
'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
'img_hover' => $rr['url'],
'name' => $contact_details['name'],

View file

@ -6,9 +6,10 @@ use Friendica\App;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
function unfollow_post(App $a) {
function unfollow_post(App $a)
{
if (!local_user()) {
notice(t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
@ -116,7 +117,7 @@ function unfollow_content(App $a) {
'$nickname' => "",
'$name' => $contact["name"],
'$url' => $contact["url"],
'$zrl' => zrl($contact["url"]),
'$zrl' => Profile::zrl($contact["url"]),
'$url_label' => t("Profile URL"),
'$myaddr' => $myaddr,
'$request' => $request,
@ -125,11 +126,9 @@ function unfollow_content(App $a) {
));
$a->page['aside'] = "";
profile_load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
Profile::load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
$o .= replace_macros(get_markup_template('section_title.tpl'),
array('$title' => t('Status Messages and Posts')
));
$o .= replace_macros(get_markup_template('section_title.tpl'), array('$title' => t('Status Messages and Posts')));
// Show last public posts
$o .= Contact::getPostsFromUrl($contact["url"]);

View file

@ -9,6 +9,7 @@ use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Group;
use Friendica\Model\Profile;
use Friendica\Protocol\DFRN;
require_once 'include/items.php';
@ -41,7 +42,7 @@ function videos_init(App $a) {
$a->data['user'] = $user[0];
$a->profile_uid = $user[0]['uid'];
$profile = get_profiledata_by_nick($nick, $a->profile_uid);
$profile = Profile::getProfiledataByNick($nick, $a->profile_uid);
$account_type = Contact::getAccountType($profile);
@ -327,7 +328,7 @@ function videos_content(App $a) {
// tabs
$_is_owner = (local_user() && (local_user() == $owner_uid));
$o .= profile_tabs($a,$_is_owner, $a->data['user']['nickname']);
$o .= Profile::getTabs($a, $_is_owner, $a->data['user']['nickname']);
//
// dispatch request

View file

@ -1,10 +1,13 @@
<?php
/**
* @file mod/viewcontacts.php
*/
use Friendica\App;
use Friendica\Content\ContactSelector;
use Friendica\Core\Config;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
function viewcontacts_init(App $a) {
@ -28,7 +31,7 @@ function viewcontacts_init(App $a) {
$a->profile_uid = $r[0]['uid'];
$is_owner = (local_user() && (local_user() == $a->profile_uid));
profile_load($a,$a->argv[1]);
Profile::load($a, $a->argv[1]);
}
}
@ -44,7 +47,7 @@ function viewcontacts_content(App $a) {
$o = "";
// tabs
$o .= profile_tabs($a,$is_owner, $a->data['user']['nickname']);
$o .= Profile::getTabs($a, $is_owner, $a->data['user']['nickname']);
if(((! count($a->profile)) || ($a->profile['hide-friends']))) {
notice( t('Permission denied.') . EOL);
@ -97,7 +100,7 @@ function viewcontacts_content(App $a) {
if($is_owner && ($rr['network'] === NETWORK_DFRN) && ($rr['rel']))
$url = 'redir/' . $rr['id'];
else
$url = zrl($url);
$url = Profile::zrl($url);
$contact_details = Contact::getDetailsByURL($rr['url'], $a->profile['uid'], $rr);

View file

@ -1,14 +1,17 @@
<?php
/**
* @file mod/wallmessage.php
*/
use Friendica\App;
use \Friendica\Core\System;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Profile;
require_once('include/message.php');
require_once 'include/message.php';
function wallmessage_post(App $a) {
$replyto = get_my_url();
$replyto = Profile::getMyURL();
if(! $replyto) {
notice( t('Permission denied.') . EOL);
return;
@ -73,8 +76,8 @@ function wallmessage_post(App $a) {
function wallmessage_content(App $a) {
if(! get_my_url()) {
notice( t('Permission denied.') . EOL);
if (!Profile::getMyURL()) {
notice(t('Permission denied.') . EOL);
return;
}