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.

20 lines
458 B

  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",
  6. intval($id)
  7. );
  8. if (dbm::is_result($r)){
  9. $nick = $r[0]['nickname'];
  10. $url = App::get_baseurl()."/display/$nick/$id";
  11. goaway($url);
  12. } else {
  13. $a->error = 404;
  14. notice( t('Item not found.') . EOL);
  15. }
  16. return;
  17. }