]> git.mxchange.org Git - friendica.git/blobdiff - include/identity.php
Merge pull request #1765 from annando/1507-redmatrix-network-name
[friendica.git] / include / identity.php
index bc930a3c6f4d72836f96a247bf7afc4a69eba38f..b584896d36c5474372245231cb58df6a707c0260 100644 (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'];
 
@@ -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'] = '<a href="'.$profile['url'].'">'.network_to_name($profile['network'])."</a>";
+                               $profile['network_name'] = '<a href="'.$profile['url'].'">'.network_to_name($profile['network'], $profile['url'])."</a>";
                        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;
+}