| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Handling for cross-posting.
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Shows either the status owner (if the status was posted to one's own profile)
|
| 11 |
* or the status owner and status poster (if the status was posted elsewhere).
|
| 12 |
*/
|
| 13 |
class facebook_status_views_handler_field_cross extends views_handler_field {
|
| 14 |
function render($values) {
|
| 15 |
if ($values->facebook_status_pid && $values->facebook_status_uid) {
|
| 16 |
$uid = $values->facebook_status_uid;
|
| 17 |
$pid = $values->facebook_status_pid;
|
| 18 |
}
|
| 19 |
else if ($values->facebook_status_sid) {
|
| 20 |
$status = facebook_status_load($values->facebook_status_sid);
|
| 21 |
$uid = $status->uid;
|
| 22 |
$pid = $status->pid;
|
| 23 |
}
|
| 24 |
if (isset($uid) && $pid == $uid) {
|
| 25 |
return theme('username', user_load(array('uid' => $uid)));
|
| 26 |
}
|
| 27 |
else {
|
| 28 |
$args = array('!poster' => theme('username', user_load(array('uid' => $pid))), '!owner' => theme('username', user_load(array('uid' => $uid))));
|
| 29 |
return t('!poster » !owner', $args);
|
| 30 |
}
|
| 31 |
}
|
| 32 |
}
|