]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - actions/showstream.php
start showstream
[quix0rs-gnu-social.git] / actions / showstream.php
1 <?php
2
3 function handle_showstream() {
4         
5         $user_name = $_REQUEST['profile'];
6         $profile = Profile::staticGet('nickname', $user_name);
7         
8         if (!$profile) {
9                 showstream_no_such_user();
10         } 
11         
12         $user = User::staticGet($profile->id);
13
14         if (!$user) {
15                 // remote profile
16                 showstream_no_such_user();
17         }
18
19         if ($profile->id == current_user()->id) {
20                 showstream_notice_form();
21         }
22         
23         showstream_show_profile($profile);
24
25         $notice = DB_DataObject::factory('notice');
26         $notice->profile_id = $profile->id;
27         $notice->limit(1, 10);
28         
29         $notice->find();
30         
31         while ($notice->fetch()) {
32                 showstream_show_notice($notice);
33         }
34 }
35
36 function showstream_no_such_user() {
37         common_user_error('No such user');
38 }
39
40 function showstream_notice_form() {
41         // print notice form
42 }
43
44 function showstream_show_profile($profile) {
45 }