From b070666120fc6cbc0d90a0ad160274f8ecf7a027 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Mon, 7 Nov 2011 17:39:00 +0100 Subject: [PATCH] statusnet-friendika post permalink compatibility --- mod/notice.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 mod/notice.php diff --git a/mod/notice.php b/mod/notice.php new file mode 100644 index 0000000000..9d8aeed700 --- /dev/null +++ b/mod/notice.php @@ -0,0 +1,20 @@ + friendika items permanent-url compatibility */ + + function notice_init(&$a){ + $id = $a->argv[1]; + $r = q("SELECT user.nickname FROM user LEFT JOIN item ON item.uid=user.uid WHERE item.id=%d", + intval($id) + ); + if (count($r)){ + $nick = $r[0]['nickname']; + $url = $a->get_baseurl()."/display/$nick/$id"; + goaway($url); + } else { + $a->error = 404; + notice( t('Item not found.') . EOL); + + } + return; + + }