root/devel/mod/rpc/lib/function_taguri_object.php

Revision 269, 1.5 kB (checked in by ben, 3 years ago)

--

  • Property svn:eol-style set to native
Line 
1 <?php
2
3     /*
4      * Tag URI handling
5      */
6
7     $run_result = null;
8
9     if (isset($parameters) && $parameters != "")
10     {
11         // Pickup the tag from the parameters
12         $tag = $parameters['tag'];
13
14         // Examine the tag
15         $elements = explode(":", $tag);
16
17         // Get the owner
18         $user     = explode("@", $elements[1]);
19         $username = $user[0];
20         $user_id  = run('users:instance', array('user_id' => $username));
21
22         // Get the object type
23         $type = $elements[2];
24
25         // Get the object id
26         $ident = $elements[3];
27
28         switch ($type)
29         {
30             case "person":
31                 $run_result = run('users:instance', array('user_id' => $username));
32                 break;
33
34             case "community":
35                 $run_result = run('users:instance', array('user_id' => $username));
36                 break;
37
38             case "weblog":
39                 $run_result = run('users:weblog', array('user_id' => $user_id,
40                                                         'blog_id' => $ident));
41                 break;
42
43             case "post":
44                 $run_result = run('posts:instance', array('id' => $ident));
45                 break;
46
47             case "comment":
48                 $run_result = run('comments:instance', array('id' => $ident));
49                 break;
50
51             case "tag":
52                 $run_result = run('tags:instance', array('id' => $ident));
53                 break;
54
55         }
56     }
57 ?>
58
Note: See TracBrowser for help on using the browser.