X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fidentity.php;h=b584896d36c5474372245231cb58df6a707c0260;hb=5b96c7b3e39a4dd6516115e0fb187cc0ecc0e07d;hp=bc930a3c6f4d72836f96a247bf7afc4a69eba38f;hpb=28f0e9a2de449232c6a1eb031f7ba056f9ae11eb;p=friendica.git diff --git a/include/identity.php b/include/identity.php index bc930a3c6f..b584896d36 100644 --- a/include/identity.php +++ b/include/identity.php @@ -90,14 +90,15 @@ if(! function_exists('profile_load')) { } $a->profile = $r[0]; + $a->profile_uid = $r[0]['profile_uid']; $a->profile['mobile-theme'] = get_pconfig($a->profile['profile_uid'], 'system', 'mobile_theme'); $a->profile['network'] = NETWORK_DFRN; $a->page['title'] = $a->profile['name'] . " @ " . $a->config['sitename']; - if (!$profiledata) - $_SESSION['theme'] = $a->profile['theme']; +// if (!$profiledata) +// $_SESSION['theme'] = $a->profile['theme']; $_SESSION['mobile-theme'] = $a->profile['mobile-theme']; @@ -174,7 +175,7 @@ if(! function_exists('profile_sidebar')) { if (($profile['network'] != "") AND ($profile['network'] != NETWORK_DFRN)) { require_once('include/contact_selectors.php'); if ($profile['url'] != "") - $profile['network_name'] = ''.network_to_name($profile['network']).""; + $profile['network_name'] = ''.network_to_name($profile['network'], $profile['url']).""; else $profile['network_name'] = network_to_name($profile['network']); } else @@ -726,3 +727,19 @@ function zrl($s,$force = false) { return $s . $achar . 'zrl=' . urlencode($mine); return $s; } + +// Used from within PCSS themes to set theme parameters. If there's a +// puid request variable, that is the "page owner" and normally their theme +// settings take precedence; unless a local user sets the "always_my_theme" +// system pconfig, which means they don't want to see anybody else's theme +// settings except their own while on this site. + +function get_theme_uid() { + $uid = (($_REQUEST['puid']) ? intval($_REQUEST['puid']) : 0); + if(local_user()) { + if((get_pconfig(local_user(),'system','always_my_theme')) || (! $uid)) + return local_user(); + } + + return $uid; +}