/[drupal]/contributions/modules/facebook_status/facebook_status_views_handler_field_cross.inc
ViewVC logotype

Contents of /contributions/modules/facebook_status/facebook_status_views_handler_field_cross.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Tue Jun 2 02:14:39 2009 UTC (5 months, 3 weeks ago) by icecreamyou
Branch: MAIN
CVS Tags: DRUPAL-6--2-0-RC2, DRUPAL-6--2-0-RC1, DRUPAL-6--2-0-BETA4, HEAD
Branch point for: DRUPAL-6--2
File MIME type: text/x-php
Added Views support for posting on other users' profiles
Fixed a bug with Views relationships
*Major updates to default Views
Removed trailing spaces in facebook_status.author_pane.inc
Removed theme_facebook_status_flag_create()
Optimized code for better performance
Lots of other minor improvements and bug fixes

Note: most Views now require the PHP module to be enabled.
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 &raquo; !owner', $args);
30 }
31 }
32 }

  ViewVC Help
Powered by ViewVC 1.1.2