summaryrefslogtreecommitdiff
path: root/actions/showstream.php
blob: d3352e77d89cf0a49158bc554f99ec0be6d0409a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php

function handle_showstream() {
	
	$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) {
}