}
if (!$cid) {
- if (get_my_url()) {
+ if (Profile::getMyURL()) {
$contact = dba::selectFirst('contact', ['id'],
- ['nurl' => normalise_link(get_my_url()), 'uid' => $profile_uid]);
+ ['nurl' => normalise_link(Profile::getMyURL()), 'uid' => $profile_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'];
}
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
+use Friendica\Model\Profile;
use Friendica\Object\Thread;
use Friendica\Object\Post;
}
}
- $A = '[url=' . zrl($Alink) . ']' . $Aname . '[/url]';
- $B = '[url=' . zrl($Blink) . ']' . $Bname . '[/url]';
+ $A = '[url=' . Profile::zrl($Alink) . ']' . $Aname . '[/url]';
+ $B = '[url=' . Profile::zrl($Blink) . ']' . $Bname . '[/url]';
if ($Bphoto != "") {
- $Bphoto = '[url=' . zrl($Blink) . '][img]' . $Bphoto . '[/img][/url]';
+ $Bphoto = '[url=' . Profile::zrl($Blink) . '][img]' . $Bphoto . '[/img][/url]';
}
$item['body'] = sprintf( t('%1$s is now friends with %2$s'), $A, $B)."\n\n\n".$Bphoto;
}
}
- $A = '[url=' . zrl($Alink) . ']' . $Aname . '[/url]';
- $B = '[url=' . zrl($Blink) . ']' . $Bname . '[/url]';
+ $A = '[url=' . Profile::zrl($Alink) . ']' . $Aname . '[/url]';
+ $B = '[url=' . Profile::zrl($Blink) . ']' . $Bname . '[/url]';
if ($Bphoto != "") {
- $Bphoto = '[url=' . zrl($Blink) . '][img=80x80]' . $Bphoto . '[/img][/url]';
+ $Bphoto = '[url=' . Profile::zrl($Blink) . '][img=80x80]' . $Bphoto . '[/img][/url]';
}
/*
$obj = $r[0];
- $author = '[url=' . zrl($item['author-link']) . ']' . $item['author-name'] . '[/url]';
- $objauthor = '[url=' . zrl($obj['author-link']) . ']' . $obj['author-name'] . '[/url]';
+ $author = '[url=' . Profile::zrl($item['author-link']) . ']' . $item['author-name'] . '[/url]';
+ $objauthor = '[url=' . Profile::zrl($obj['author-link']) . ']' . $obj['author-name'] . '[/url]';
switch ($obj['verb']) {
case ACTIVITY_POST:
$target = $r[0];
$Bname = $target['author-name'];
$Blink = $target['author-link'];
- $A = '[url=' . zrl($Alink) . ']' . $Aname . '[/url]';
- $B = '[url=' . zrl($Blink) . ']' . $Bname . '[/url]';
+ $A = '[url=' . Profile::zrl($Alink) . ']' . $Aname . '[/url]';
+ $B = '[url=' . Profile::zrl($Blink) . ']' . $Bname . '[/url]';
$P = '[url=' . $target['plink'] . ']' . t('post/item') . '[/url]';
$item['body'] = sprintf( t('%1$s marked %2$s\'s %3$s as favorite'), $A, $B, $P)."\n";
}
if (preg_match_all('/@\[url=(.*?)\]/is', $item['body'], $matches, PREG_SET_ORDER)) {
foreach ($matches as $mtch) {
if (! strpos($mtch[1], 'zrl=')) {
- $item['body'] = str_replace($mtch[0], '@[url=' . zrl($mtch[1]) . ']', $item['body']);
+ $item['body'] = str_replace($mtch[0], '@[url=' . Profile::zrl($mtch[1]) . ']', $item['body']);
}
}
}
// add zrl's to public images
$photo_pattern = "/\[url=(.*?)\/photos\/(.*?)\/image\/(.*?)\]\[img(.*?)\]h(.*?)\[\/img\]\[\/url\]/is";
if (preg_match($photo_pattern, $item['body'])) {
- $photo_replace = '[url=' . zrl('$1' . '/photos/' . '$2' . '/image/' . '$3' ,true) . '][img' . '$4' . ']h' . '$5' . '[/img][/url]';
+ $photo_replace = '[url=' . Profile::zrl('$1' . '/photos/' . '$2' . '/image/' . '$3' ,true) . '][img' . '$4' . ']h' . '$5' . '[/img][/url]';
$item['body'] = bb_tag_preg_replace($photo_pattern, $photo_replace, 'url', $item['body']);
}
if ($sp) {
$sparkle = ' sparkle';
} else {
- $profile_link = zrl($profile_link);
+ $profile_link = Profile::zrl($profile_link);
}
if (!x($item, 'author-thumb') || ($item['author-thumb'] == "")) {
$photos_link = $profile_link . '?url=photos';
$profile_link = $profile_link . '?url=profile';
} else {
- $profile_link = zrl($profile_link);
+ $profile_link = Profile::zrl($profile_link);
}
if ($cid && !$item['self']) {
$url = 'redir/' . $item['contact-id'];
$sparkle = ' class="sparkle" ';
} else {
- $url = zrl($url);
+ $url = Profile::zrl($url);
}
$url = '<a href="'. $url . '"'. $sparkle .'>' . htmlentities($item['author-name']) . '</a>';
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
+use Friendica\Model\Profile;
use Friendica\Util\Map;
require_once 'include/bbcode.php';
$profile_link = best_link_url($item, $sp);
if (!$sp) {
- $profile_link = zrl($profile_link);
+ $profile_link = Profile::zrl($profile_link);
}
$event = replace_macros(get_markup_template('event_stream_item.tpl'), array(
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Database\DBM;
+use Friendica\Model\Profile;
function nav(App $a) {
}
// "Home" should also take you home from an authenticated remote profile connection
- $homelink = get_my_url();
+ $homelink = Profile::getMyURL();
if (! $homelink) {
- $homelink = ((x($_SESSION,'visitor_home')) ? $_SESSION['visitor_home'] : '');
+ $homelink = ((x($_SESSION, 'visitor_home')) ? $_SESSION['visitor_home'] : '');
}
if (($a->module != 'home') && (! (local_user()))) {
if (strlen(Config::get('system', 'singleuser'))) {
$gdir = Config::get('system', 'directory');
if (strlen($gdir)) {
- $gdirpath = zrl($gdir, true);
+ $gdirpath = Profile::zrl($gdir, true);
}
}
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
+use Friendica\Model\Profile;
use Friendica\Model\Term;
use Friendica\Util\Map;
$url = $redirect_url;
$sparkle = ' sparkle';
} else {
- $url = zrl($url);
+ $url = Profile::zrl($url);
}
}
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Module\Login;
+use Friendica\Module\Profile;
require_once 'boot.php';
) {
$_SESSION['my_url'] = $_GET['zrl'];
$a->query_string = preg_replace('/[\?&]zrl=(.*?)([\?&]|$)/is', '', $a->query_string);
- zrl_init($a);
+ Profile::zrlInit($a);
} else {
// Someone came with an invalid parameter, maybe as a DDoS attempt
// We simply stop processing here
<?php
-
/**
* @file mod/allfriends.php
*/
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)
$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);
} 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)
);
}
* 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;
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';
return;
}
- $profile = get_profiledata_by_nick($nick, $a->profile_uid);
+ $profile = Profile::getProfiledataByNick($nick, $a->profile_uid);
$account_type = Contact::getAccountType($profile);
$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') {
<?php
-
/**
* @file include/common.php
*/
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)
}
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"]));
+ $c = dba::selectFirst('contact', ['name', 'url', 'photo'], ['id' => $cid, 'uid' => $uid]);
+
+ if (DBM::is_result($c)) {
+ $a->page['aside'] = "";
+ Profile::load($a, "", 0, Contact::getDetailsByURL($c["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
- ));
-
- if (!x($a->page, 'aside')) {
- $a->page['aside'] = '';
+ $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'];
}
<?php
-
/**
* @file mod/contacts.php
*/
-
use Friendica\App;
use Friendica\Content\ContactSelector;
use Friendica\Core\System;
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';
$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"]);
}
<?php
-
/**
* @file mod/crepair.php
*/
use Friendica\Core\Config;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
+use Friendica\Model\Profile;
require_once 'mod/contacts.php';
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"]));
}
}
use Friendica\Model\Contact;
use Friendica\Model\Group;
use Friendica\Model\User;
+use Friendica\Model\Profile;
use Friendica\Module\Login;
use Friendica\Network\Probe;
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;
}
}
// (ignore reply, nothing we can do it failed)
- // Old: goaway(zrl($dfrn_url));
+ // Old: goaway(Profile::zrl($dfrn_url));
goaway($forwardurl);
return; // NOTREACHED
}
}
} else {
// last, try a zrl
- $myaddr = get_my_url();
+ $myaddr = Profile::getMyURL();
}
$target_addr = $a->profile['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3);
<?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);
$gdirpath = '';
$dirurl = Config::get('system','directory');
if(strlen($dirurl)) {
- $gdirpath = zrl($dirurl,true);
+ $gdirpath = Profile::zrl($dirurl,true);
}
if($search) {
$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(
use Friendica\Core\Worker;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
+use Friendica\Model\Profile;
use Friendica\Network\Probe;
use Friendica\Protocol\PortableContact;
$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)
);
}
$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),
<?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;
}
}
}
- profile_load($a, $nick, 0, $profiledata);
+ Profile::load($a, $nick, 0, $profiledata);
}
function display_fetchauthor($a, $item) {
* @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';
$tabs = '';
// tabs
if ($a->theme_events_in_profile) {
- $tabs = profile_tabs($a, true);
+ $tabs = Profile::getTabs($a, true);
}
$mode = 'view';
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()) {
'$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,
$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'),
<?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;
}
$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" ;
}
foreach ($dfrn_pages as $dfrn) {
$a->page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"".System::baseUrl()."/dfrn_{$dfrn}/{$which}\" />\r\n";
}
-
}
'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'],
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';
$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'],
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';
$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();
}
}
}
}
- 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) {
<?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');
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'],
'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
);
header('Content-type: application/json; charset=utf-8');
echo json_encode($json_info);
exit;
-
}
<?php
-
+/**
+ * @file mod/notes.php
+ */
use Friendica\App;
use Friendica\Database\DBM;
+use Friendica\Model\Profile;
function notes_init(App $a) {
nav_set_selected('home');
-// profile_load($a,$which,$profile);
+ //Profile::load($a, $which, $profile);
}
$is_owner = true;
$o ="";
- $o .= profile_tabs($a,True);
+ $o .= Profile::getTabs($a, true);
if(! $update) {
$o .= '<h3>' . t('Personal Notes') . '</h3>';
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;
$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);
// 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') {
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Group;
+use Friendica\Model\Profile;
use Friendica\Module\Login;
use Friendica\Protocol\DFRN;
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'];
$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;
}
}
if ($is_owner && !$update && !Config::get('theme', 'hide_eventlist')) {
- $o .= get_birthdays();
- $o .= get_events();
+ $o .= Profile::getBirthdays();
+ $o .= Profile::getEvents();
}
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) {
return;
}
- profile_load($a,$a->user['nickname'], $r[0]['id']);
+ Profile::load($a, $a->user['nickname'], $r[0]['id']);
}
<?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;
}
$which = $a->user['nickname'];
$profile = $a->argv[1];
- profile_load($a,$which,$profile);
-
+ Profile::load($a, $which, $profile);
}
<?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');
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
+use Friendica\Model\Profile;
require_once 'include/contact_widgets.php';
$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)
);
$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'],
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']);
'$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,
));
$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"]);
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';
$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);
// 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
<?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) {
$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]);
}
}
$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);
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);
<?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;
function wallmessage_content(App $a) {
- if(! get_my_url()) {
- notice( t('Permission denied.') . EOL);
+ if (!Profile::getMyURL()) {
+ notice(t('Permission denied.') . EOL);
return;
}
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
+use Friendica\Model\Profile;
require_once 'include/dba.php';
require_once 'include/html2plain.php';
'contact_id' => $it['contact-id'],
'photo' => ((x($it, 'fphoto')) ? proxy_url($it['fphoto'], false, PROXY_SIZE_SMALL) : "images/person-175.jpg"),
'name' => $it['fname'],
- 'url' => zrl($it['furl']),
+ 'url' => Profile::zrl($it['furl']),
'hidden' => $it['hidden'] == 1,
'post_newfriend' => (intval(PConfig::get(local_user(), 'system', 'post_newfriend')) ? '1' : 0),
'knowyou' => $knowyou,
'hidden' => $it['hidden'] == 1,
'post_newfriend' => (intval(PConfig::get(local_user(), 'system', 'post_newfriend')) ? '1' : 0),
'url' => $it['url'],
- 'zrl' => zrl($it['url']),
+ 'zrl' => Profile::zrl($it['url']),
'addr' => $it['gaddr'],
'network' => $it['gnetwork'],
'knowyou' => $it['knowyou'],
<?php
-
/**
* @file src/Model/Contact.php
*/
-
namespace Friendica\Model;
use Friendica\BaseObject;
use Friendica\Database\DBM;
use Friendica\Network\Probe;
use Friendica\Model\Photo;
+use Friendica\Model\Profile;
use Friendica\Protocol\Diaspora;
use Friendica\Protocol\DFRN;
use Friendica\Protocol\OStatus;
if ($contact['uid'] != $uid) {
if ($uid == 0) {
- $profile_link = zrl($contact['url']);
+ $profile_link = Profile::zrl($contact['url']);
$menu = array('profile' => array(t('View Profile'), $profile_link, true));
return $menu;
if (DBM::is_result($contact_own)) {
return self::photoMenu($contact_own, $uid);
} else {
- $profile_link = zrl($contact['url']);
+ $profile_link = Profile::zrl($contact['url']);
$connlnk = 'follow/?url=' . $contact['url'];
$menu = array(
'profile' => array(t('View Profile'), $profile_link, true),
<?php
-
/**
* @file src/Model/Profile.php
*/
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Protocol\Diaspora;
+use dba;
+require_once 'include/dba.php';
require_once 'include/bbcode.php';
require_once 'mod/proxy.php';
* the theme is chosen before the _init() function of a theme is run, which will usually
* load a lot of theme-specific content
*
- * @param object $a App
- * @param string $nickname string
- * @param int $profile int
- * @param array $profiledata array
+ * @param object $a App
+ * @param string $nickname string
+ * @param int $profile int
+ * @param array $profiledata array
* @param boolean $show_connect Show connect link
*/
- function profile_load(App $a, $nickname, $profile = 0, $profiledata = array(), $show_connect = true)
+ public static function load(App $a, $nickname, $profile = 0, $profiledata = array(), $show_connect = true)
{
- $user = q(
- "SELECT `uid` FROM `user` WHERE `nickname` = '%s' LIMIT 1",
- dbesc($nickname)
- );
+ $user = dba::selectFirst('user', ['uid'], ['nickname' => $nickname]);
if (!$user && !count($user) && !count($profiledata)) {
logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
}
if ($profiledata) {
- $a->page['aside'] .= profile_sidebar($profiledata, true, $show_connect);
+ $a->page['aside'] .= self::sidebar($profiledata, true, $show_connect);
if (!DBM::is_result($user)) {
return;
}
}
- $pdata = get_profiledata_by_nick($nickname, $user[0]['uid'], $profile);
+ $pdata = self::getProfiledataByNick($nickname, $user[0]['uid'], $profile);
if (empty($pdata) && empty($profiledata)) {
logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
* But: When this profile was on the same server, then we could display the contacts
*/
if (!$profiledata) {
- $a->page['aside'] .= profile_sidebar($a->profile, $block, $show_connect);
+ $a->page['aside'] .= self::sidebar($a->profile, $block, $show_connect);
}
return;
* @param int $profile_id ID of the profile
* @returns array
*/
- function get_profiledata_by_nick($nickname, $uid = 0, $profile_id = 0)
+ public static function getProfiledataByNick($nickname, $uid = 0, $profile_id = 0)
{
if (remote_user() && count($_SESSION['remote'])) {
foreach ($_SESSION['remote'] as $visitor) {
* @hooks 'profile_sidebar'
* array $arr
*/
- function profile_sidebar($profile, $block = 0, $show_connect = true)
+ private static function sidebar($profile, $block = 0, $show_connect = true)
{
$a = get_app();
$subscribe_feed = false;
}
- if (remote_user() || (get_my_url() && x($profile, 'unkmail') && ($profile['uid'] != local_user()))) {
+ if (remote_user() || (self::getMyURL() && x($profile, 'unkmail') && ($profile['uid'] != local_user()))) {
$wallmessage = t('Message');
$wallmessage_link = 'wallmessage/' . $profile['nickname'];
$r = q(
"SELECT `url` FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' AND `rel` = %d",
intval($profile['uid']),
- dbesc(normalise_link(get_my_url())),
+ dbesc(normalise_link(self::getMyURL())),
intval(CONTACT_IS_FRIEND)
);
}
return $o;
}
- function get_birthdays()
+ public static function getBirthdays()
{
$a = get_app();
$o = '';
));
}
- function get_events()
+ public static function getEvents()
{
require_once 'include/bbcode.php';
));
}
- function advanced_profile(App $a)
+ public static function getAdvanced(App $a)
{
$o = '';
$uid = $a->profile['uid'];
return '';
}
- function profile_tabs($a, $is_owner = false, $nickname = null)
+ public static function getTabs($a, $is_owner = false, $nickname = null)
{
if (is_null($nickname)) {
$nickname = $a->user['nickname'];
*
* @return string
*/
- function get_my_url()
+ public static function getMyURL()
{
if (x($_SESSION, 'my_url')) {
return $_SESSION['my_url'];
return null;
}
- function zrl_init(App $a)
+ public static function zrlInit(App $a)
{
- $my_url = get_my_url();
+ $my_url = self::getMyURL();
$my_url = validate_url($my_url);
if ($my_url) {
// Is it a DDoS attempt?
}
}
- function zrl($s, $force = false)
+ public static function zrl($s, $force = false)
{
if (!strlen($s)) {
return $s;
$s = $s . '/';
}
$achar = strpos($s, '?') ? '&' : '?';
- $mine = get_my_url();
+ $mine = self::getMyURL();
if ($mine && !link_compare($mine, $s)) {
return $s . $achar . 'zrl=' . urlencode($mine);
}
* @note Returns local_user instead of user ID if "always_my_theme"
* is set to true
*/
- function get_theme_uid()
+ public static function getThemeUid()
{
$uid = ((!empty($_REQUEST['puid'])) ? intval($_REQUEST['puid']) : 0);
if ((local_user()) && ((PConfig::get(local_user(), 'system', 'always_my_theme')) || (!$uid))) {
return $uid;
}
-
}
use Friendica\Core\PConfig;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
+use Friendica\Model\Profile;
use dba;
require_once 'include/dba.php';
if ($sp) {
$sparkle = ' sparkle';
} else {
- $profile_link = zrl($profile_link);
+ $profile_link = Profile::zrl($profile_link);
}
if (!isset($item['author-thumb']) || ($item['author-thumb'] == "")) {
// This will have been stored in $a->page_contact by our calling page.
// Put this person as the wall owner of the wall-to-wall notice.
- $this->owner_url = zrl($a->page_contact['url']);
+ $this->owner_url = Profile::zrl($a->page_contact['url']);
$this->owner_photo = $a->page_contact['thumb'];
$this->owner_name = $a->page_contact['name'];
$this->wall_to_wall = true;
) {
$this->owner_url = $this->getRedirectUrl();
} else {
- $this->owner_url = zrl($this->getDataValue('owner-link'));
+ $this->owner_url = Profile::zrl($this->getDataValue('owner-link'));
}
}
}
<?php
-
+/**
+ * @file view/theme/duepuntozero/style.php
+ */
use Friendica\Core\Config;
use Friendica\Core\PConfig;
+use Friendica\Model\Profile;
-if (file_exists("$THEMEPATH/style.css")){
- echo file_get_contents("$THEMEPATH/style.css");
+if (file_exists("$THEMEPATH/style.css")) {
+ echo file_get_contents("$THEMEPATH/style.css");
}
-$uid = get_theme_uid();
-$s_colorset = Config::get('duepuntozero','colorset');
-$colorset = PConfig::get( $uid, 'duepuntozero', 'colorset');
-if (!x($colorset))
- $colorset = $s_colorset;
+$uid = Profile::getThemeUid();
+
+$s_colorset = Config::get('duepuntozero', 'colorset');
+$colorset = PConfig::get($uid, 'duepuntozero', 'colorset');
+
+if (!x($colorset)) {
+ $colorset = $s_colorset;
+}
if ($colorset) {
- if ($colorset == 'greenzero')
- $setcss = file_get_contents('view/theme/duepuntozero/deriv/greenzero.css');
- if ($colorset == 'purplezero')
- $setcss = file_get_contents('view/theme/duepuntozero/deriv/purplezero.css');
- if ($colorset == 'easterbunny')
- $setcss = file_get_contents('view/theme/duepuntozero/deriv/easterbunny.css');
- if ($colorset == 'darkzero')
- $setcss = file_get_contents('view/theme/duepuntozero/deriv/darkzero.css');
- if ($colorset == 'comix')
- $setcss = file_get_contents('view/theme/duepuntozero/deriv/comix.css');
- if ($colorset == 'slackr')
- $setcss = file_get_contents('view/theme/duepuntozero/deriv/slackr.css');
+ if ($colorset == 'greenzero') {
+ $setcss = file_get_contents('view/theme/duepuntozero/deriv/greenzero.css');
+ }
+
+ if ($colorset == 'purplezero') {
+ $setcss = file_get_contents('view/theme/duepuntozero/deriv/purplezero.css');
+ }
+
+ if ($colorset == 'easterbunny') {
+ $setcss = file_get_contents('view/theme/duepuntozero/deriv/easterbunny.css');
+ }
+
+ if ($colorset == 'darkzero') {
+ $setcss = file_get_contents('view/theme/duepuntozero/deriv/darkzero.css');
+ }
+
+ if ($colorset == 'comix') {
+ $setcss = file_get_contents('view/theme/duepuntozero/deriv/comix.css');
+ }
+
+ if ($colorset == 'slackr') {
+ $setcss = file_get_contents('view/theme/duepuntozero/deriv/slackr.css');
+ }
}
echo $setcss;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
+use Friendica\Model\Profile;
require_once 'view/theme/frio/php/frio_boot.php';
// It makes mobile Chrome UI match Frio's top bar color.
$uid = $a->profile_uid;
if (is_null($uid)) {
- $uid = get_theme_uid();
+ $uid = Profile::getThemeUid();
}
$schema = PConfig::get($uid, 'frio', 'schema');
if (($schema) && ($schema != '---')) {
<?php
-require_once 'view/theme/frio/php/PHPColors/Color.php';
+/**
+ * @file view/theme/frio/style.php
+ */
use Friendica\Core\Config;
use Friendica\Core\PConfig;
+require_once 'view/theme/frio/php/PHPColors/Color.php';
+
$schemecss = "";
$schemecssfile = false;
$scheme_modified = 0;
if ($a->module !== 'install') {
// Get the UID of the profile owner.
- $uid = get_theme_uid();
+ $uid = Profile::getThemeUid();
if ($uid) {
PConfig::load($uid, 'frio');
// should leave it for admins to define for themselves.
// default.php and default.css MUST be symlinks to existing schema files.
if (! $schema) {
- if(file_exists('view/theme/frio/schema/default.php')) {
+ if (file_exists('view/theme/frio/schema/default.php')) {
$schemefile = 'view/theme/frio/schema/default.php';
require_once $schemefile;
}
- if(file_exists('view/theme/frio/schema/default.css')) {
+ if (file_exists('view/theme/frio/schema/default.css')) {
$schemecssfile = 'view/theme/frio/schema/default.css';
}
}
} else {
$link_hover_color = '#' . $lhc->lighten(5);
}
-
}
// Convert $bg_image_options into css.
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
+use Friendica\Model\Profile;
use Friendica\Object\Image;
$frio = "view/theme/frio";
function frio_remote_nav($a, &$nav)
{
// get the homelink from $_XSESSION
- $homelink = get_my_url();
+ $homelink = Profile::getMyURL();
if (!$homelink) {
$homelink = defaults($_SESSION, 'visitor_home', '');
}
} elseif (!local_user() && remote_user()) {
$r = q("SELECT `name`, `nick`, `micro` AS `photo` FROM `contact` WHERE `id` = %d", intval(remote_user()));
$nav['remote'] = t("Guest");
- } elseif (get_my_url()) {
+ } elseif (Profile::getMyURL()) {
$r = q("SELECT `name`, `nick`, `photo` FROM `gcontact`
WHERE `addr` = '%s' AND `network` = 'dfrn'",
dbesc($webbie));
<?php
+/**
+ * @file view/theme/quattro/style.php
+ */
+use Friendica\Core\Config;
+use Friendica\Core\PConfig;
+use Friendica\Model\Profile;
- use Friendica\Core\Config;
- use Friendica\Core\PConfig;
+$uid = Profile::getThemeUid();
- $uid = get_theme_uid();
+$color = false;
+$quattro_align = false;
+$site_color = Config::get("quattro", "color", "dark");
+$site_quattro_align = Config::get("quattro", "align", false);
- $color = false;
- $quattro_align = false;
- $site_color = Config::get("quattro", "color", "dark");
- $site_quattro_align = Config::get("quattro", "align", false);
+if ($uid) {
+ $color = PConfig::get($uid, "quattro", "color", false);
+ $quattro_align = PConfig::get($uid, 'quattro', 'align', false);
+}
- if ($uid) {
- $color = PConfig::get($uid, "quattro", "color", false);
- $quattro_align = PConfig::get($uid, 'quattro', 'align', false);
- }
+if ($color === false) {
+ $color = $site_color;
+}
- if ($color === false) {
- $color = $site_color;
- }
+if ($quattro_align === false) {
+ $quattro_align = $site_quattro_align;
+}
- if ($quattro_align === false) {
- $quattro_align = $site_quattro_align;
- }
+if (file_exists("$THEMEPATH/$color/style.css")) {
+ echo file_get_contents("$THEMEPATH/$color/style.css");
+}
- if (file_exists("$THEMEPATH/$color/style.css")){
- echo file_get_contents("$THEMEPATH/$color/style.css");
- }
-
- if ($quattro_align == "center"){
- echo "
- html { width: 100%; margin:0px; padding:0px; }
- body {
- margin: 50px auto;
- width: 900px;
- }
- ";
- }
+if ($quattro_align == "center") {
+ echo "
+ html { width: 100%; margin:0px; padding:0px; }
+ body {
+ margin: 50px auto;
+ width: 900px;
+ }
+ ";
+}
- $textarea_font_size = false;
- $post_font_size = false;
+$textarea_font_size = false;
+$post_font_size = false;
- $site_textarea_font_size = Config::get("quattro", "tfs", "20");
- $site_post_font_size = Config::get("quattro", "pfs", "12");
+$site_textarea_font_size = Config::get("quattro", "tfs", "20");
+$site_post_font_size = Config::get("quattro", "pfs", "12");
- if ($uid) {
- $textarea_font_size = PConfig::get($uid, "quattro", "tfs", false);
- $post_font_size = PConfig::get($uid, "quattro", "pfs", false);
- }
+if ($uid) {
+ $textarea_font_size = PConfig::get($uid, "quattro", "tfs", false);
+ $post_font_size = PConfig::get($uid, "quattro", "pfs", false);
+}
- if ($textarea_font_size === false) {
- $textarea_font_size = $site_textarea_font_size;
- }
- if ($post_font_size === false) {
- $post_font_size = $site_post_font_size;
- }
+if ($textarea_font_size === false) {
+ $textarea_font_size = $site_textarea_font_size;
+}
+if ($post_font_size === false) {
+ $post_font_size = $site_post_font_size;
+}
- echo "
- textarea { font-size: ${textarea_font_size}px; }
- .wall-item-comment-wrapper .comment-edit-text-full { font-size: ${textarea_font_size}px; }
- #jot .profile-jot-text:focus { font-size: ${textarea_font_size}px; }
- .wall-item-container .wall-item-content { font-size: ${post_font_size}px; }
- ";
+echo "
+ textarea { font-size: ${textarea_font_size}px; }
+ .wall-item-comment-wrapper .comment-edit-text-full { font-size: ${textarea_font_size}px; }
+ #jot .profile-jot-text:focus { font-size: ${textarea_font_size}px; }
+ .wall-item-container .wall-item-content { font-size: ${post_font_size}px; }
+";
<?php
-
+/**
+ * @file view/theme/vier/style.php
+ */
use Friendica\Core\Config;
use Friendica\Core\PConfig;
+use Friendica\Model\Profile;
-$uid = get_theme_uid();
+$uid = Profile::getThemeUid();
$style = PConfig::get($uid, 'vier', 'style');
-if ($style == "")
+if ($style == "") {
$style = Config::get('vier', 'style');
+}
-if ($style == "")
+if ($style == "") {
$style = "plus";
+}
-if ($style == "flat")
+if ($style == "flat") {
$stylecssfile = 'view/theme/vier/flat.css';
-else if ($style == "netcolour")
+} else if ($style == "netcolour") {
$stylecssfile = 'view/theme/vier/netcolour.css';
-else if ($style == "breathe")
+} else if ($style == "breathe") {
$stylecssfile = 'view/theme/vier/breathe.css';
-else if ($style == "plus")
+} else if ($style == "plus") {
$stylecssfile = 'view/theme/vier/plus.css';
-else if ($style == "dark")
+} else if ($style == "dark") {
$stylecssfile = 'view/theme/vier/dark.css';
-else if ($style == "plusminus")
+} else if ($style == "plusminus") {
$stylecssfile = 'view/theme/vier/plusminus.css';
+}
if (file_exists($THEMEPATH."//style.css")) {
$stylecss = file_get_contents($THEMEPATH."//style.css")."\n";
$stylemodified = filemtime($stylecssfile);
$stylecss .= file_get_contents($stylecssfile);
-if ($stylemodified > $modified)
+if ($stylemodified > $modified) {
$modified = $stylemodified;
+}
$modified = gmdate('r', $modified);
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\GContact;
+use Friendica\Model\Profile;
require_once "include/plugin.php";
require_once "mod/proxy.php";
foreach ($r as $rr) {
$entry = replace_macros($tpl,array(
'$id' => $rr['id'],
- //'$profile_link' => zrl($rr['url']),
+ //'$profile_link' => Profile::zrl($rr['url']),
'$profile_link' => 'follow/?url='.urlencode($rr['url']),
'$photo' => proxy_url($rr['photo'], false, PROXY_SIZE_MICRO),
'$alt_text' => $rr['name'],
}
foreach ($r AS $index => $helper)
- $r[$index]["url"] = zrl($helper["url"]);
+ $r[$index]["url"] = Profile::zrl($helper["url"]);
$r[] = array("url" => "help/Quick-Start-guide", "name" => t("Quick Start"));