|
|
|
@@ -4,6 +4,7 @@
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
use Friendica\App;
|
|
|
|
|
use Friendica\Core\Cache;
|
|
|
|
|
use Friendica\Core\Config;
|
|
|
|
|
use Friendica\Core\PConfig;
|
|
|
|
|
use Friendica\Core\System;
|
|
|
|
@@ -13,7 +14,6 @@ use Friendica\Database\DBM;
|
|
|
|
|
require_once 'include/ForumManager.php';
|
|
|
|
|
require_once 'include/bbcode.php';
|
|
|
|
|
require_once 'mod/proxy.php';
|
|
|
|
|
require_once 'include/cache.php';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
@@ -34,20 +34,21 @@ require_once 'include/cache.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 App $a
|
|
|
|
|
* @param string $nickname
|
|
|
|
|
* @param int $profile
|
|
|
|
|
* @param array $profiledata
|
|
|
|
|
* @param object $a App
|
|
|
|
|
* @param string $nickname string
|
|
|
|
|
* @param int $profile int
|
|
|
|
|
* @param array $profiledata array
|
|
|
|
|
*/
|
|
|
|
|
function profile_load(App $a, $nickname, $profile = 0, $profiledata = array()) {
|
|
|
|
|
|
|
|
|
|
$user = q("SELECT `uid` FROM `user` WHERE `nickname` = '%s' LIMIT 1",
|
|
|
|
|
function profile_load(App $a, $nickname, $profile = 0, $profiledata = array())
|
|
|
|
|
{
|
|
|
|
|
$user = q(
|
|
|
|
|
"SELECT `uid` FROM `user` WHERE `nickname` = '%s' LIMIT 1",
|
|
|
|
|
dbesc($nickname)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (!$user && count($user) && !count($profiledata)) {
|
|
|
|
|
logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
|
|
|
|
|
notice( t('Requested account is not available.') . EOL );
|
|
|
|
|
notice(t('Requested account is not available.') . EOL);
|
|
|
|
|
$a->error = 404;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@@ -56,7 +57,7 @@ function profile_load(App $a, $nickname, $profile = 0, $profiledata = array()) {
|
|
|
|
|
|
|
|
|
|
if (empty($pdata) && empty($profiledata)) {
|
|
|
|
|
logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
|
|
|
|
|
notice( t('Requested profile is not available.') . EOL );
|
|
|
|
|
notice(t('Requested profile is not available.') . EOL);
|
|
|
|
|
$a->error = 404;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@@ -64,8 +65,9 @@ function profile_load(App $a, $nickname, $profile = 0, $profiledata = array()) {
|
|
|
|
|
// fetch user tags if this isn't the default profile
|
|
|
|
|
|
|
|
|
|
if (!$pdata['is-default']) {
|
|
|
|
|
$x = q("SELECT `pub_keywords` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
|
|
|
|
|
intval($pdata['profile_uid'])
|
|
|
|
|
$x = q(
|
|
|
|
|
"SELECT `pub_keywords` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
|
|
|
|
|
intval($pdata['profile_uid'])
|
|
|
|
|
);
|
|
|
|
|
if ($x && count($x))
|
|
|
|
|
$pdata['pub_keywords'] = $x[0]['pub_keywords'];
|
|
|
|
@@ -79,8 +81,9 @@ function profile_load(App $a, $nickname, $profile = 0, $profiledata = array()) {
|
|
|
|
|
|
|
|
|
|
$a->page['title'] = $a->profile['name'] . " @ " . $a->config['sitename'];
|
|
|
|
|
|
|
|
|
|
if (!$profiledata && !PConfig::get(local_user(),'system','always_my_theme'))
|
|
|
|
|
$_SESSION['theme'] = $a->profile['theme'];
|
|
|
|
|
if (!$profiledata && !PConfig::get(local_user(), 'system', 'always_my_theme')) {
|
|
|
|
|
$_SESSION['theme'] = $a->profile['theme'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$_SESSION['mobile-theme'] = $a->profile['mobile-theme'];
|
|
|
|
|
|
|
|
|
@@ -92,30 +95,35 @@ function profile_load(App $a, $nickname, $profile = 0, $profiledata = array()) {
|
|
|
|
|
|
|
|
|
|
$theme_info_file = "view/theme/" . current_theme() . "/theme.php";
|
|
|
|
|
if (file_exists($theme_info_file)) {
|
|
|
|
|
require_once $theme_info_file;
|
|
|
|
|
include_once $theme_info_file;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (! (x($a->page,'aside')))
|
|
|
|
|
if (! (x($a->page, 'aside'))) {
|
|
|
|
|
$a->page['aside'] = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (local_user() && local_user() == $a->profile['uid'] && $profiledata) {
|
|
|
|
|
$a->page['aside'] .= replace_macros(get_markup_template('profile_edlink.tpl'),array(
|
|
|
|
|
'$editprofile' => t('Edit profile'),
|
|
|
|
|
'$profid' => $a->profile['id']
|
|
|
|
|
));
|