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