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

apitimelinenetworkpublic.php 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /* ============================================================================
  3. * Title: APITimelineNetworkPublic
  4. * An extension to the Public timeline that doesn't just show local users
  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. * An extension to the Public timeline that doesn't just show local users
  34. *
  35. * PHP version:
  36. * Tested with PHP 7.0
  37. * ----------------------------------------------------------------------------
  38. * File Authors:
  39. * o Mikael Nordfeldth <mmn@hethane.se>
  40. * o Maiyannah Bishop <maiyannah.bishop@postactiv.com>
  41. *
  42. * Web:
  43. * o postActiv <http://www.postactiv.com>
  44. * o GNU social <https://www.gnu.org/s/social/>
  45. * ============================================================================
  46. */
  47. // This file is formatted so that it provides useful documentation output in
  48. // NaturalDocs. Please be considerate of this before changing formatting.
  49. if (!defined('POSTACTIV')) { exit(1); }
  50. class ApiTimelineNetworkPublicAction extends ApiTimelinePublicAction
  51. {
  52. function title()
  53. {
  54. return sprintf(_("%s network public timeline"), common_config('site', 'name'));
  55. }
  56. protected function getStream()
  57. {
  58. if (!$this->scoped instanceof Profile && common_config('public', 'localonly')) {
  59. $this->clientError(_('Network wide public feed is not permitted without authorization'), 403);
  60. }
  61. return new NetworkPublicNoticeStream($this->scoped);
  62. }
  63. }
  64. // END OF FILE
  65. // ============================================================================
  66. ?>