The official, canonical postActiv repository. http://www.postactiv.com

allrss.php 3.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. /* ============================================================================
  3. * Title: AllRSS
  4. * RSS feed for user and friends timeline action class.
  5. *
  6. * postActiv:
  7. * the micro-blogging software
  8. *
  9. * Copyright:
  10. * Copyright (C) 2016-2018, Maiyannah Bishop
  11. *
  12. * Derived from code copyright various sources:
  13. * o GNU Social (C) 2013-2016, Free Software Foundation, Inc
  14. * o StatusNet (C) 2008-2012, StatusNet, Inc
  15. * ----------------------------------------------------------------------------
  16. * License:
  17. * This program is free software: you can redistribute it and/or modify
  18. * it under the terms of the GNU Affero General Public License as published by
  19. * the Free Software Foundation, either version 3 of the License, or
  20. * (at your option) any later version.
  21. *
  22. * This program is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. * GNU Affero General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU Affero General Public License
  28. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  29. *
  30. * <https://www.gnu.org/licenses/agpl.html>
  31. * ----------------------------------------------------------------------------
  32. * About:
  33. * RSS feed for user and friends timeline action class.
  34. *
  35. * PHP version:
  36. * Tested with PHP 7.0
  37. * ----------------------------------------------------------------------------
  38. * File Authors:
  39. * o Evan Prodromou
  40. * o Mike Cochrane <mikec@mikenz.geek.nz>
  41. * o Robin Millette <millette@controlyourself.ca>
  42. * o Adrian Lang <mail@adrianlang.de>
  43. * o Zach Copley
  44. * o Siebrand Mazeland <s.mazeland@xs4all.nl>
  45. * o Brion Vibber <brion@pobox.com>
  46. * o Mikael Nordfeldth <mmn@hethane.se>
  47. * o Maiyannah Bishop <maiyannah.bishop@postactiv.com>
  48. *
  49. * Web:
  50. * o postActiv <http://www.postactiv.com>
  51. * o GNU social <https://www.gnu.org/s/social/>
  52. * ============================================================================
  53. */
  54. // This file is formatted so that it provides useful documentation output in
  55. // NaturalDocs. Please be considerate of this before changing formatting.
  56. if (!defined('POSTACTIV')) { exit(1); }
  57. /**
  58. * RSS feed for user and friends timeline.
  59. *
  60. * Formatting of RSS handled by Rss10Action
  61. */
  62. class AllrssAction extends TargetedRss10Action
  63. {
  64. protected function getNotices()
  65. {
  66. $stream = new InboxNoticeStream($this->target, $this->scoped);
  67. return $stream->getNotices(0, $this->limit)->fetchAll();
  68. }
  69. /**
  70. * Get channel.
  71. *
  72. * @return array associative array on channel information
  73. */
  74. function getChannel()
  75. {
  76. $c = array('url' => common_local_url('allrss',
  77. array('nickname' =>
  78. $this->target->getNickname())),
  79. // TRANS: Message is used as link title. %s is a user nickname.
  80. 'title' => sprintf(_('%s and friends'), $this->target->getNickname()),
  81. 'link' => common_local_url('all',
  82. array('nickname' =>
  83. $this->target->getNickname())),
  84. // TRANS: Message is used as link description. %1$s is a username, %2$s is a site name.
  85. 'description' => sprintf(_('Updates from %1$s and friends on %2$s!'),
  86. $this->target->getNickname(), common_config('site', 'name')));
  87. return $c;
  88. }
  89. }
  90. // END OF FILE
  91. // ============================================================================
  92. ?>