| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* This file provides a preprocess function for the author pane used by
|
| 7 |
* Advanced Forum and Advanced Profile Kit.
|
| 8 |
*/
|
| 9 |
|
| 10 |
/**
|
| 11 |
* Implementation of hook_preprocess_author_pane().
|
| 12 |
*/
|
| 13 |
function facebook_status_preprocess_author_pane(&$variables) {
|
| 14 |
if ($variables['account']->uid != 0) {
|
| 15 |
$status = facebook_status_get_status($variables['account']->uid);
|
| 16 |
$status = $status[0];
|
| 17 |
//There's no reason to show anything if the status is blank. Check to see if
|
| 18 |
//it will be blank because theme_facebook_status_item() substitutes a
|
| 19 |
//default status if there is none.
|
| 20 |
$themed = '';
|
| 21 |
if ($status->status_time) {
|
| 22 |
$themed = theme('facebook_status_item', $variables['account']);
|
| 23 |
}
|
| 24 |
//Only show the status if the user has permission to see it.
|
| 25 |
$facebook_status = '';
|
| 26 |
$facebook_status_status = '';
|
| 27 |
$facebook_status_time = '';
|
| 28 |
if (user_access('view all statuses', $variables['account'])) {
|
| 29 |
$facebook_status = $themed;
|
| 30 |
$facebook_status_status = check_plain($status->status);
|
| 31 |
$facebook_status_time = theme('facebook_status_time', $status->status_time);
|
| 32 |
}
|
| 33 |
|
| 34 |
//The fully themed status, including the themed username (if settings permit) and the time.
|
| 35 |
$variables['facebook_status'] = $facebook_status;
|
| 36 |
//Just the status.
|
| 37 |
$variables['facebook_status_status'] = $facebook_status_status;
|
| 38 |
//The formatted time the status was submitted.
|
| 39 |
$variables['facebook_status_time'] = $facebook_status_time;
|
| 40 |
}
|
| 41 |
}
|