showstream.php 789 Bytes
Newer Older
Evan Prodromou's avatar
Evan Prodromou committed
1 2 3
<?php

function handle_showstream() {
Evan Prodromou's avatar
Evan Prodromou committed
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
	
	$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
Evan Prodromou's avatar
Evan Prodromou committed
42 43
}

Evan Prodromou's avatar
Evan Prodromou committed
44 45
function showstream_show_profile($profile) {
}