1
0
Fork 0

get the themes settings of foreign profiles

This commit is contained in:
rabuzarus 2015-06-27 14:10:43 +02:00
commit 373bb0822b
4 changed files with 104 additions and 54 deletions

View file

@ -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'];
@ -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;
}