]> git.mxchange.org Git - friendica.git/commitdiff
Added an alternate link to the profile in the atom feeds (feature request #925)
authorMichael Vogel <icarus@dabo.de>
Wed, 3 Sep 2014 07:52:31 +0000 (09:52 +0200)
committerMichael Vogel <icarus@dabo.de>
Wed, 3 Sep 2014 07:52:31 +0000 (09:52 +0200)
include/items.php
view/templates/atom_feed.tpl
view/templates/atom_feed_dfrn.tpl

index f9e0203c2781fc90378221c6483bb36c2229de89..0e156beb27524af852a933a3bb39a267b3deefd9 100644 (file)
@@ -163,6 +163,11 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0)
 
        $salmon = feed_salmonlinks($owner_nick);
 
+       $alternatelink = $owner['url'];
+
+       if(isset($category))
+               $alternatelink .= "/category/".$category;
+
        $atom .= replace_macros($feed_template, array(
                '$version'      => xmlify(FRIENDICA_VERSION),
                '$feed_id'      => xmlify($a->get_baseurl() . '/profile/' . $owner_nick),
@@ -170,6 +175,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0)
                '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', 'now' , ATOM_TIME)) ,
                '$hub'          => $hubxml,
                '$salmon'       => $salmon,
+               '$alternatelink' => xmlify($alternatelink),
                '$name'         => xmlify($owner['name']),
                '$profile_page' => xmlify($owner['url']),
                '$photo'        => xmlify($owner['photo']),
index db553d99f4069ab41bc015d7eb7e5700b1a8b6ee..0ce534d038b50226be41c3373966a285a866f1f0 100644 (file)
@@ -19,6 +19,7 @@
   <title>{{$feed_title}}</title>
   <generator uri="http://friendica.com" version="{{$version}}">Friendica</generator>
   <link rel="license" href="http://creativecommons.org/licenses/by/3.0/" />
+  <link rel="alternate" type="text/html" href="{{$alternatelink}}" />
   {{$hub}}
   {{$salmon}}
   {{$community}}
index 87d78a518636c8f7bbf54e928ee283645617da2b..babe2f61e59976ff948590a13f6eeab051650b0d 100644 (file)
@@ -19,6 +19,7 @@
   <title>{{$feed_title}}</title>
   <generator uri="http://friendica.com" version="{{$version}}">Friendica</generator>
   <link rel="license" href="http://creativecommons.org/licenses/by/3.0/" />
+  <link rel="alternate" type="text/html" href="{{$alternatelink}}" />
   {{$hub}}
   {{$salmon}}
   {{$community}}