Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
682 B

  1. <?php
  2. function viewsrc_content(App $a) {
  3. if (! local_user()) {
  4. notice( t('Access denied.') . EOL);
  5. return;
  6. }
  7. $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
  8. if(! $item_id) {
  9. $a->error = 404;
  10. notice( t('Item not found.') . EOL);
  11. return;
  12. }
  13. $r = q("SELECT `item`.`body` FROM `item`
  14. WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
  15. and `item`.`moderated` = 0
  16. AND `item`.`id` = '%s' LIMIT 1",
  17. intval(local_user()),
  18. dbesc($item_id)
  19. );
  20. if (dbm::is_result($r))
  21. if(is_ajax()) {
  22. echo str_replace("\n",'<br />',$r[0]['body']);
  23. killme();
  24. } else {
  25. $o .= str_replace("\n",'<br />',$r[0]['body']);
  26. }
  27. return $o;
  28. }