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.

notice.php 463 B

1234567891011121314151617181920
  1. <?php
  2. /* identi.ca -> friendica items permanent-url compatibility */
  3. function notice_init(App $a) {
  4. $id = $a->argv[1];
  5. $r = q("SELECT `user`.`nickname` FROM `user` LEFT JOIN `item` ON `item`.`uid` = `user`.`uid` WHERE `item`.`id` = %d", intval($id));
  6. if (dbm::is_result($r)) {
  7. $nick = $r[0]['nickname'];
  8. $url = App::get_baseurl() . "/display/$nick/$id";
  9. goaway($url);
  10. } else {
  11. $a->error = 404;
  12. notice(t('Item not found.') . EOL);
  13. }
  14. return;
  15. }