]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
start showstream
authorEvan Prodromou <evan@prodromou.name>
Thu, 8 May 2008 16:21:45 +0000 (12:21 -0400)
committerEvan Prodromou <evan@prodromou.name>
Thu, 8 May 2008 16:21:45 +0000 (12:21 -0400)
darcs-hash:20080508162145-84dde-9ae0fdcc75d794df754708642d8786ccd95d9461.gz

actions/showstream.php

index 2aaaacd0a180159f464695b2b66fa00a4aa395ca..d3352e77d89cf0a49158bc554f99ec0be6d0409a 100644 (file)
@@ -1,6 +1,45 @@
 <?php
 
 function handle_showstream() {
-       $profile_name = $_REQUEST['profile'];
+       
+       $user_name = $_REQUEST['profile'];
+       $profile = Profile::staticGet('nickname', $user_name);
+       
+       if (!$profile) {
+               showstream_no_such_user();
+       } 
+       
+       $user = User::staticGet($profile->id);
+
+       if (!$user) {
+               // remote profile
+               showstream_no_such_user();
+       }
+
+       if ($profile->id == current_user()->id) {
+               showstream_notice_form();
+       }
+       
+       showstream_show_profile($profile);
+
+       $notice = DB_DataObject::factory('notice');
+       $notice->profile_id = $profile->id;
+       $notice->limit(1, 10);
+       
+       $notice->find();
+       
+       while ($notice->fetch()) {
+               showstream_show_notice($notice);
+       }
+}
+
+function showstream_no_such_user() {
+       common_user_error('No such user');
+}
+
+function showstream_notice_form() {
+       // print notice form
 }
 
+function showstream_show_profile($profile) {
+}
\ No newline at end of file