]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add SUP link to User RSS
authorEvan Prodromou <evan@controlyourself.ca>
Sat, 25 Oct 2008 02:28:49 +0000 (22:28 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Sat, 25 Oct 2008 02:28:49 +0000 (22:28 -0400)
darcs-hash:20081025022849-5ed1f-edd99a830ff285f4d0468e0e9ce3ceba4a885352.gz

actions/userrss.php
htaccess.sample
lib/util.php

index 1f103dc084b0cf6da07d96d3c193afe06e70b70f..a30c7bc28f64722de13ffdc9b15f5a56525c34ae 100644 (file)
@@ -79,4 +79,14 @@ class UserrssAction extends Rss10Action {
                $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
                return ($avatar) ? $avatar->url : NULL;
        }
+
+       # override parent to add X-SUP-ID URL
+       
+       function show_rss($limit=0) {
+               $url = common_local_url('sup', NULL, $this->user->id);
+               header('X-SUP-ID', $url);
+               parent::show_rss($limit);
+       }
+       
+       
 }
\ No newline at end of file
index d05a7460333a403625b9cfef734f83f6056d5123..58b060b6c3b4687bda44ab2be3492c3ab78e2e63 100644 (file)
@@ -38,6 +38,8 @@ RewriteRule ^main/invite$ index.php?action=invite [L,QSA]
 RewriteRule ^main/favor$ index.php?action=favor [L,QSA]
 RewriteRule ^main/disfavor$ index.php?action=disfavor [L,QSA]
 
+RewriteRule ^main/sup$ index.php?action=sup [L,QSA]
+
 RewriteRule ^settings/profile$ index.php?action=profilesettings [L,QSA]
 RewriteRule ^settings/openid$ index.php?action=openidsettings [L,QSA]
 RewriteRule ^settings/im$ index.php?action=imsettings [L,QSA]
index 924625e02d5bc41933f2b13747c4ec0c338b82ff..1bc5b95b00ca452581a4c2ffb3f3753134efe804 100644 (file)
@@ -809,13 +809,17 @@ function common_default_avatar($size) {
        return theme_path('default-avatar-'.$sizenames[$size].'.png');
 }
 
-function common_local_url($action, $args=NULL) {
-       global $config;
-       if ($config['site']['fancy']) {
-               return common_fancy_url($action, $args);
+function common_local_url($action, $args=NULL, $fragment=NULL) {
+       $url = NULL;
+       if (common_config('site','fancy')) {
+               $url = common_fancy_url($action, $args);
        } else {
-               return common_simple_url($action, $args);
+               $url = common_simple_url($action, $args);
+       }
+       if (!is_null($fragment)) {
+               $url .= '#'.$fragment;
        }
+       return $url;
 }
 
 function common_fancy_url($action, $args=NULL) {
@@ -971,6 +975,8 @@ function common_fancy_url($action, $args=NULL) {
                        }
                 default: return common_simple_url($action, $args);
                }
+        case 'sup':
+               return common_path('main/sup');
         default:
                return common_simple_url($action, $args);
        }