]> git.mxchange.org Git - friendica.git/blob - mod/notice.php
Merge pull request #2314 from rabuzarus/0302_datetime_cleanup
[friendica.git] / mod / notice.php
1 <?php
2 /* identi.ca -> friendica items permanent-url compatibility */
3
4 if(! function_exists('notice_init')) {
5         function notice_init(&$a) {
6                 $id = $a->argv[1];
7                 $r = q("SELECT user.nickname FROM user LEFT JOIN item ON item.uid=user.uid WHERE item.id=%d",
8                                 intval($id)
9                                 );
10                 if (count($r)){
11                         $nick = $r[0]['nickname'];
12                         $url = $a->get_baseurl()."/display/$nick/$id";
13                         goaway($url);
14                 } else {
15                         $a->error = 404;
16                         notice( t('Item not found.') . EOL);
17
18                 }
19                 return;
20         }
21 }