Index: sites/all/modules/facebook_status/facebook_status.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/facebook_status/facebook_status.module,v retrieving revision 1.5.6.141.2.6 diff -u -r1.5.6.141.2.6 facebook_status.module --- sites/all/modules/facebook_status/facebook_status.module 25 Dec 2010 06:35:57 -0000 1.5.6.141.2.6 +++ sites/all/modules/facebook_status/facebook_status.module 15 Jan 2011 23:58:06 -0000 @@ -274,7 +274,7 @@ (arg(0) == 'statuses' && is_numeric(arg(1)) && arg(2) == 'edit') ), 'maxlength' => variable_get('facebook_status_length', 140), - 'refreshLink' => (bool) variable_get('facebook_status_refresh', 0) + 'refreshLink' => (bool) variable_get('facebook_status_refresh', 0)) ), 'setting'); } @@ -420,6 +420,150 @@ } } +/** + * Formats status components. + * + * @param $status + * A full status object. If not passed, gets the last status for the relevant + * user automatically. If there is none, uses a default message. + * @param $cacheable + * Indicates that the complete text of the rendered status will be stored + * for future use, so dynamic timestamps and administrative elements (like + * edit/delete links) should be avoided. + * @return + * An array of themed status components or FALSE if the current user does not + * have permission to view the status. + */ +function facebook_status_item_components($status = FALSE, $cacheable = FALSE) { + global $user; + if ($status === FALSE) { + $status = _facebook_status_get_status_fast($user->uid); + } + $owner = _facebook_status_user_load($status->uid); + $poster = _facebook_status_user_load($status->sender); + if (!user_access('view all statuses') && $user->uid != $owner->uid && $user->uid != $poster->uid) { + return FALSE; + } + $owner_name = theme('username', $owner); + $poster_name = theme('username', $poster); + $status_text = $status->message; + if (!$status_text) { + if (variable_get('facebook_status_hide_blank', 0) == 1) { + return FALSE; + } + if (variable_get('facebook_status_concat', 1) == 0) { + $status_text = t('!user does not have a status.', array('!user' => $owner_name)); + } + else { + $status_text = t('does not have a status.'); + } + } + drupal_add_css(drupal_get_path('module', 'facebook_status') .'/facebook_status.css'); + $status_text = _facebook_status_run_filter($status_text); + if (variable_get('facebook_status_nl2br', 0)) { + $status_text = nl2br($status_text); + } + $status->cacheable = $cacheable; + $edit = ''; + $q = $_GET['q']; + if ($q == 'facebook_status/js') { + $q = 'share-status'; + } + $time = theme('facebook_status_time', $status->created); + if ($cacheable) { + $time = format_date($status->created, 'small'); + } + elseif ($status->created != 0) { + if (_facebook_status_can_edit($status)) { + $edit = ''. l(t('Edit'), 'statuses/'. $status->sid .'/edit', array('query' => array('destination' => $q))) .' '. l(t('Delete'), 'statuses/'. $status->sid .'/delete', array('query' => array('destination' => $q))) .''; + } + elseif (_facebook_status_can_edit($status, TRUE)) { + $edit = ''. l(t('Delete'), 'statuses/'. $status->sid .'/delete', array('query' => array('destination' => $q))) .''; + } + } + $conversation = l(t('Conversation'), 'statuses/conversation/'. check_plain($owner->name) .','. check_plain($poster->name)); + $components = array( + 'poster' => array( + 'value' => $poster_name, + 'suffix' => ' » ', + '#value' => $poster_name, + '#unformatted' => $status->sender, + 'description' => t('The sender of a status message to another user.'), + 'weight' => -50, + ), + 'owner' => array( + 'value' => $owner_name, + 'suffix' => ': ', + '#value' => $owner_name, + '#unformatted' => $status->recipient, + 'description' => t('The recipient of a status message to another user.'), + 'weight' => -45, + ), + 'user' => array( + 'value' => $owner_name, + 'suffix' => ' ', + '#value' => $owner_name, + '#unformatted' => $status->sender, + 'description' => t('The creator of a status update.'), + 'weight' => -45, + ), + 'status' => array( + 'value' => $status_text, + 'suffix' => ' ', + '#value' => $status_text, + '#unformatted' => $status->message, + 'description' => t('The status text.'), + 'weight' => -40, + ), + 'time' => array( + 'value' => $time, + 'prefix' => '', + 'suffix' => '', + '#value' => $time, + '#unformatted' => $status->created, + 'description' => t('The time the status was created.'), + 'weight' => -30, + ), + 'edit' => array( + 'value' => $edit, + '#value' => $edit, + '#unformatted' => $status->sid, + 'description' => t('Links to edit and delete the status, for those with permission.'), + 'weight' => -20, + ), + 'conversation' => array( + 'value' => $conversation, + 'prefix' => ' ', + '#value' => $conversation, + 'description' => t('A link to view the conversation, if applicable.'), + 'weight' => -10, + ), + ); + if ($owner->uid == $poster->uid) { + if (variable_get('facebook_status_concat', 1)) { + $components['owner']['type'] = 'value'; + $components['poster']['type'] = 'value'; + $components['conversation']['type'] = 'value'; + if (_facebook_status_possessive($status->message, $poster)) { + $components['user']['value'] = $owner_name; + } + } + else { + $components['user']['type'] = 'value'; + $components['owner']['type'] = 'value'; + $components['poster']['type'] = 'value'; + $components['conversation']['type'] = 'value'; + } + } + else { + $components['user']['type'] = 'value'; + } + $components += module_invoke_all('facebook_status_render_components', $status); + drupal_alter('facebook_status_render_components', $components, $status); + uasort($components, '_facebook_status_element_sort'); + return $components; +} + //================================== //APPLICATION PROGRAMMING INTERFACE. //================================== @@ -612,10 +756,12 @@ return $contexts; } $result = db_query("SELECT * FROM {facebook_status_contexts}"); - $contexts = array(); + $contexts = module_invoke_all('facebook_status_context_info'); while ($c = db_fetch_array($result)) { - $c['in_db'] = TRUE; - $contexts[$c['type']] = $c; + $contexts[$c['type']]['in_db'] = TRUE; + $contexts[$c['type']]['weight'] = $c['weight']; + $contexts[$c['type']]['view'] = $c['view']; + $contexts[$c['type']]['selectors'] = $c['selectors']; } $contexts += module_invoke_all('facebook_status_context_info'); uasort($contexts, '_facebook_status_element_sort'); @@ -807,6 +953,29 @@ return $accounts[$name]; } +/** + * Determines if the current user can edit or delete the relevant status. + * + * @param $status + * A status object to check for edit/delete permissions. + * @param $delete + * If TRUE, checks for delete permissions; otherwise, checks for edit perms. + * @return + * TRUE if the current user can edit or delete the status; FALSE otherwise. + */ +function _facebook_status_can_edit($status, $delete = FALSE) { + global $user; + //Editing and deleting is allowed if the status was posted by the current user or the current user can edit/delete any status. + if (($user->uid == $status->recipient && user_access('edit own status')) || user_access('edit all statuses')) { + return TRUE; + } + //In addition, deletion is allowed if the status was posted on the profile of the current user. + if ($delete && $user->uid == $status->sender && user_access('edit own status')) { + return TRUE; + } + return FALSE; +} + //======================== //STREAM TYPE DEFINITIONS. //======================== @@ -1085,3 +1254,17 @@ return 'includes/ctools/'. $plugin; } } + +function _facebook_status_exclude($account) { + if (!$account) { + global $user; + $account = $user; + } + //This variable should get saved so that this splits it exactly into the names without needing to trim(). + $names = explode(', ', variable_get('facebook_status_exclude', '')); + if (in_array($account->name, $names)) { + return TRUE; + } + return FALSE; +} + Index: sites/all/modules/facebook_status/facebook_status.views.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status.views.inc diff -N sites/all/modules/facebook_status/facebook_status.views.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status.views.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,373 @@ + array( + 'left_field' => 'uid', + 'field' => 'sender', + 'type' => 'INNER', + ), + ); + $data['users']['table']['join'] = array( + 'facebook_status' => array( + 'left_field' => 'sender', + 'field' => 'uid', + 'type' => 'INNER', + ), + ); + + //Advertise this table as a possible base table. + $data['facebook_status']['table']['base'] = array( + 'field' => 'sid', + 'title' => t('Facebook-style Statuses Updates'), + 'help' => t('Stores status updates.'), + 'weight' => 10, + ); + /* + $data['facebook_status']['users'] = array( + 'group' => t('Facebook-style Statuses'), + 'relationship' => array( + 'title' => t('Users'), + 'label' => t('Users'), + 'help' => t('Add a relationship to gain access to information related to the users who submitted the relevant statuses.'), + 'relationship table' => 'users', + 'relationship field' => 'uid', + 'base' => 'facebook_status', + 'field' => 'sender', + 'type' => 'INNER', + 'handler' => 'views_handler_relationship', + ), + ); + */ + + //Declares the Status ID column. + $data['facebook_status']['sid'] = array( + 'title' => t('Status ID'), + 'help' => t('The ID of the status update.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + 'filter' => array( + 'handler' => 'views_handler_filter_numeric', + ), + 'sort' => array( + 'handler' => 'views_handler_sort', + ), + 'argument' => array( + 'handler' => 'views_handler_argument_numeric', + ), + ); + + //Alias for Status ID to extend its use. + $data['facebook_status']['sid_extra'] = array( + 'title' => t('Last Status per User'), + 'help' => t('Show only the last status update for each user.'), + 'filter' => array( + 'field' => 'sid', + 'handler' => 'facebook_status_views_handler_filter', + 'label' => t('Last Status per User'), + ), + ); + $data['facebook_status']['edit'] = array( + 'title' => t('Edit'), + 'help' => t('Shows a link to edit the status to users with permission to see it.'), + 'field' => array( + 'field' => 'sid', + 'handler' => 'facebook_status_views_handler_field_edit', + 'click sortable' => FALSE, + ), + ); + $data['facebook_status']['delete'] = array( + 'title' => t('Delete'), + 'help' => t('Shows a link to delete the status to users with permission to see it.'), + 'field' => array( + 'field' => 'sid', + 'handler' => 'facebook_status_views_handler_field_delete', + 'click sortable' => FALSE, + ), + ); + $data['facebook_status']['repost'] = array( + 'title' => t('Re-post'), + 'help' => t('Shows a link to re-post a status.'), + 'field' => array( + 'field' => 'sid', + 'handler' => 'facebook_status_views_handler_field_repost', + 'click sortable' => FALSE, + ), + ); + + //Declares the Owner UID column. + $data['facebook_status']['recipient'] = array( + 'title' => t('User ID'), + 'help' => t('The User ID of the owner of the status (if the status is from one user to another, this is the recipient).'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + 'filter' => array( + 'handler' => 'views_handler_filter_numeric', + ), + 'sort' => array( + 'handler' => 'views_handler_sort', + ), + 'argument' => array( + 'handler' => 'views_handler_argument_numeric', + ), + ); + + //Declares the Poster UID column. + $data['facebook_status']['sender'] = array( + 'title' => t('Poster UID'), + 'help' => t('The User ID of the poster of the status.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + 'filter' => array( + 'handler' => 'views_handler_filter_numeric', + ), + 'sort' => array( + 'handler' => 'views_handler_sort', + ), + 'argument' => array( + 'handler' => 'views_handler_argument_numeric', + ), + ); + + //Alias for Poster UID to use the name. + $data['facebook_status']['pid_name'] = array( + 'title' => t('Poster Name'), + 'help' => t('The name of the user who posted the status.'), + 'field' => array( + 'field' => 'sender', + 'handler' => 'facebook_status_views_handler_field_poster', + 'click sortable' => FALSE, + ), + 'filter' => array( + 'field' => 'sender', + 'handler' => 'views_handler_filter_user_name', + ), + 'sort' => array( + 'field' => 'sender', + 'handler' => 'views_handler_sort', + ), + 'argument' => array( + 'field' => 'sender', + 'handler' => 'views_handler_argument_user_uid', + ), + ); + //Alias for poster picture. + $data['facebook_status']['pid_pic'] = array( + 'title' => t('Poster picture'), + 'help' => t('The picture of the user who posted the status.'), + 'field' => array( + 'field' => 'sender', + 'handler' => 'facebook_status_views_handler_field_poster_pic', + 'click sortable' => FALSE, + ), + ); + + //Alias for extras for the poster. + $data['facebook_status']['pid_extra'] = array( + 'title' => t('Usernames (context-aware)'), + 'help' => t('The themed username(s) of either the owner or the sender and recipient of the status, depending on the context.'), + 'field' => array( + 'field' => 'sender', + 'handler' => 'facebook_status_views_handler_field_cross', + 'click sortable' => FALSE, + 'label' => t('Users'), + ), + ); + $data['facebook_status']['pid_extra_2'] = array( + 'title' => t('Not own statuses'), + 'help' => t("Do not show statuses posted to one's own profile."), + 'filter' => array( + 'field' => 'sender', + 'handler' => 'facebook_status_views_handler_filter_not_own', + 'label' => t("Restrict to others' statuses"), + ), + ); + //This is slightly different than, but could probably be combined with, pid_extra_2. + $data['facebook_status']['pid_extra_3'] = array( + 'title' => t('Only own statuses'), + 'help' => t("Only show statuses posted to one's own profile."), + 'filter' => array( + 'field' => 'sender', + 'handler' => 'facebook_status_views_handler_filter_own', + 'label' => t('Restrict to own statuses'), + ), + ); + $data['facebook_status']['crosspost_users_pics'] = array( + 'title' => t('Users with Pictures'), + 'help' => t('The themed username(s) and pictures of either the owner or the sender and recipient of the status, depending on the context.'), + 'field' => array( + 'field' => 'sender', + 'handler' => 'facebook_status_views_handler_field_cross_pic', + 'click sortable' => FALSE, + 'label' => t('Users with Pictures'), + ), + ); + $data['facebook_status']['respond'] = array( + 'title' => t('Respond link'), + 'help' => t('Links to view the conversation or respond to it when appropriate.'), + 'field' => array( + 'field' => 'sender', + 'handler' => 'facebook_status_views_handler_field_respond', + 'click sortable' => FALSE, + 'label' => t('Respond to conversation'), + ), + ); + + //Declares the status message timestamp column. + $data['facebook_status']['created'] = array( + 'title' => t('Created time'), + 'help' => t('The time the status message was posted.'), + 'field' => array( + 'handler' => 'facebook_status_views_handler_field_created', + 'click sortable' => TRUE, + ), + 'sort' => array( + 'handler' => 'views_handler_sort', + ), + 'filter' => array( + 'handler' => 'views_handler_filter_date', + ), + ); + + //Declares the status text column. + $data['facebook_status']['message'] = array( + 'title' => t('Status text'), + 'help' => t('The text of the status update.'), + 'field' => array( + 'handler' => 'facebook_status_views_handler_field_status', + 'click sortable' => TRUE, + ), + 'filter' => array( + 'handler' => 'views_handler_filter_string', + ), + ); + + $data['activity']['activity-fbss-poster-pic'] = array( + 'title' => t('Poster picture'), + 'help' => t("The picture of the user who took action (normally the same as Users: Picture, but shows the poster's picture for status messages)."), + 'field' => array( + 'field' => 'sender', + 'handler' => 'facebook_status_views_handler_field_poster_pic_activity', + 'click sortable' => FALSE, + ), + ); + + if (module_exists('flag')) { + $data['facebook_status']['user-flag-plus-current'] = array( + 'title' => t('Content from flagged users or the current user'), + 'filter' => array( + 'field' => 'recipient', + 'handler' => 'facebook_status_views_handler_filter_flagged_user', + ), + ); + $data['facebook_status']['user-flag-plus-arg'] = array( + 'title' => t('Content from flagged users or the argument user'), + 'argument' => array( + 'field' => 'recipient', + 'handler' => 'facebook_status_views_handler_argument_flagged_user', + ), + ); + } + + return $data; +} + +/** + * Implementation of hook_views_handlers(). + */ +function facebook_status_views_handlers() { + return array( + 'info' => array( + 'path' => drupal_get_path('module', 'facebook_status'), + ), + 'handlers' => array( + 'facebook_status_views_handler_argument_flagged_user' => array( + 'parent' => 'views_handler_argument', + ), + 'facebook_status_views_handler_field_created' => array( + 'parent' => 'views_handler_field_date', + ), + 'facebook_status_views_handler_field_cross' => array( + 'parent' => 'views_handler_field', + ), + 'facebook_status_views_handler_field_cross_pic' => array( + 'parent' => 'views_handler_field', + ), + 'facebook_status_views_handler_field_delete' => array( + 'parent' => 'views_handler_field', + ), + 'facebook_status_views_handler_field_edit' => array( + 'parent' => 'views_handler_field', + ), + 'facebook_status_views_handler_field_poster' => array( + 'parent' => 'views_handler_field_user', + ), + 'facebook_status_views_handler_field_poster_pic' => array( + 'parent' => 'views_handler_field', + ), + 'facebook_status_views_handler_field_poster_pic_activity' => array( + 'parent' => 'views_handler_field', + ), + 'facebook_status_views_handler_field_repost' => array( + 'parent' => 'views_handler_field', + ), + 'facebook_status_views_handler_field_respond' => array( + 'parent' => 'views_handler_field', + ), + 'facebook_status_views_handler_field_status' => array( + 'parent' => 'views_handler_field', + ), + 'facebook_status_views_handler_filter' => array( + 'parent' => 'views_handler_filter_boolean_operator', + ), + 'facebook_status_views_handler_filter_flagged_user' => array( + 'parent' => 'views_handler_filter', + ), + 'facebook_status_views_handler_filter_not_own' => array( + 'parent' => 'views_handler_filter_boolean_operator', + ), + 'facebook_status_views_handler_filter_own' => array( + 'parent' => 'views_handler_filter_boolean_operator', + ), + ), + ); +} + +/** + * Implementation of hook_views_plugins(). + */ +function facebook_status_views_plugins() { + return array( + 'row' => array( + 'facebook_status_rss' => array( + 'title' => t('RSS items'), + 'help' => t('Displays statuses as RSS items.'), + 'handler' => 'facebook_status_views_plugin_row_rss', + 'parent' => 'fields', + 'path' => drupal_get_path('module', 'facebook_status'), + 'theme' => 'views_view_row_rss', + 'base' => array('facebook_status'), + 'uses fields' => FALSE, + 'uses options' => FALSE, + 'type' => 'feed', + ), + ) + ); +} Index: sites/all/modules/facebook_status/facebook_status.views_default.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status.views_default.inc diff -N sites/all/modules/facebook_status/facebook_status.views_default.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status.views_default.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,1095 @@ +name = 'facebook_status'; + $view->description = 'Facebook-style Statuses Profile'; + $view->tag = 'facebook_status'; + $view->view_php = ''; + $view->base_table = 'users'; + $view->is_cacheable = FALSE; + $view->api_version = 2; + $view->disabled = FALSE; + $handler = $view->new_display('default', 'Statuses', 'default'); + $handler->override_option('fields', array( + 'edit' => array( + 'label' => '', + 'alter' => array( + 'alter_text' => 0, + 'text' => '', + 'make_link' => 0, + 'path' => '', + 'link_class' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'strip_tags' => 0, + 'html' => 0, + ), + 'exclude' => 1, + 'id' => 'edit', + 'table' => 'facebook_status', + 'field' => 'edit', + 'relationship' => 'none', + ), + 'delete' => array( + 'label' => '', + 'alter' => array( + 'alter_text' => 0, + 'text' => '', + 'make_link' => 0, + 'path' => '', + 'link_class' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'strip_tags' => 0, + 'html' => 0, + ), + 'exclude' => 1, + 'id' => 'delete', + 'table' => 'facebook_status', + 'field' => 'delete', + 'relationship' => 'none', + ), + 'respond' => array( + 'label' => '', + 'alter' => array( + 'alter_text' => 0, + 'text' => '', + 'make_link' => 0, + 'path' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'strip_tags' => 0, + 'html' => 0, + ), + 'exclude' => 1, + 'id' => 'respond', + 'table' => 'facebook_status', + 'field' => 'respond', + 'relationship' => 'none', + ), + 'pid_extra' => array( + 'label' => '', + 'alter' => array( + 'alter_text' => 0, + 'text' => '', + 'make_link' => 0, + 'path' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'strip_tags' => 0, + 'html' => 0, + ), + 'exclude' => 1, + 'id' => 'pid_extra', + 'table' => 'facebook_status', + 'field' => 'pid_extra', + 'relationship' => 'none', + ), + 'message' => array( + 'label' => '', + 'alter' => array( + 'alter_text' => 0, + 'text' => '', + 'make_link' => 0, + 'path' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'strip_tags' => 0, + 'html' => 0, + ), + 'exclude' => 1, + 'id' => 'message', + 'table' => 'facebook_status', + 'field' => 'message', + 'relationship' => 'none', + 'override' => array( + 'button' => 'Override', + ), + ), + 'created' => array( + 'label' => '', + 'alter' => array( + 'alter_text' => 1, + 'text' => '[pid_extra] [message] [created] [edit] [delete] [respond]', + 'make_link' => 0, + 'path' => '', + 'link_class' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'strip_tags' => 0, + 'html' => 0, + ), + 'date_format' => 'time ago', + 'custom_date_format' => '1', + 'exclude' => 0, + 'id' => 'created', + 'table' => 'facebook_status', + 'field' => 'created', + 'relationship' => 'none', + 'override' => array( + 'button' => 'Override', + ), + ), + )); + $handler->override_option('sorts', array( + 'created' => array( + 'order' => 'DESC', + 'id' => 'created', + 'table' => 'facebook_status', + 'field' => 'created', + 'relationship' => 'none', + ), + 'sid' => array( + 'order' => 'DESC', + 'id' => 'sid', + 'table' => 'facebook_status', + 'field' => 'sid', + 'relationship' => 'none', + ), + )); + $handler->override_option('arguments', array( + 'name' => array( + 'default_action' => 'not found', + 'style_plugin' => 'default_summary', + 'style_options' => array(), + 'wildcard' => 'all', + 'wildcard_substitution' => 'All', + 'title' => '%1\'s Statuses', + 'breadcrumb' => '', + 'default_argument_type' => 'fixed', + 'default_argument' => '', + 'validate_type' => 'php', + 'validate_fail' => 'not found', + 'glossary' => 0, + 'limit' => '0', + 'case' => 'none', + 'path_case' => 'none', + 'transform_dash' => 0, + 'id' => 'name', + 'table' => 'users', + 'field' => 'name', + 'validate_user_argument_type' => 'uid', + 'validate_user_roles' => array( + '2' => 0, + '3' => 0, + '4' => 0, + ), + 'relationship' => 'none', + 'default_options_div_prefix' => '', + 'default_argument_user' => 0, + 'default_argument_fixed' => '', + 'default_argument_php' => '', + 'validate_argument_node_type' => array( + 'page' => 0, + ), + 'validate_argument_node_access' => 0, + 'validate_argument_nid_type' => 'nid', + 'validate_argument_vocabulary' => array( + '1' => 0, + '2' => 0, + ), + 'validate_argument_type' => 'tid', + 'validate_argument_transform' => 0, + 'validate_user_restrict_roles' => 0, + 'validate_argument_node_flag_name' => '*relationship*', + 'validate_argument_node_flag_test' => 'flaggable', + 'validate_argument_node_flag_id_type' => 'id', + 'validate_argument_user_flag_name' => '*relationship*', + 'validate_argument_user_flag_test' => 'flaggable', + 'validate_argument_user_flag_id_type' => 'id', + 'validate_argument_php' => ' //If this view is overridden and then FBSS is disabled, it can + //cause a WSOD if these lines are not included here. + if (!function_exists(\'_facebook_status_user_load\')) { + return; + } + + $return = FALSE; + $account = _facebook_status_user_load($argument); + if ($account->uid) { + $handler->argument = $account->name; + $uid = TRUE; + } + $account2 = _facebook_status_user_load_by_name($argument); + if ($account2->uid) { + $handler->argument = $account2->name; + $name = TRUE; + } + if ($name && $uid) { + $handler->argument = $account->name; + $return = TRUE; + } + else if ($name || $uid) { + $return = TRUE; + if ($name) { + $account = $account2; + } + } + return $return && user_access(\'edit own status\', $account) && !_facebook_status_exclude($account);', + ), + )); + $handler->override_option('filters', array( + 'message' => array( + 'operator' => '!=', + 'value' => '', + 'group' => '0', + 'exposed' => FALSE, + 'expose' => array( + 'operator' => FALSE, + 'label' => '', + ), + 'case' => 1, + 'id' => 'message', + 'table' => 'facebook_status', + 'field' => 'message', + 'relationship' => 'none', + ), + 'pid_extra_3' => array( + 'operator' => '=', + 'value' => '0', + 'group' => '0', + 'exposed' => FALSE, + 'expose' => array( + 'operator' => FALSE, + 'label' => '', + ), + 'id' => 'pid_extra_3', + 'table' => 'facebook_status', + 'field' => 'pid_extra_3', + 'relationship' => 'none', + ), + )); + $handler->override_option('access', array( + 'type' => 'perm', + 'perm' => 'view all statuses', + )); + $handler->override_option('cache', array( + 'type' => 'none', + )); + $handler->override_option('title', 'Statuses'); + if (module_exists('php')) { + $handler->override_option('empty', 'uid) { + echo t(\'This user has no statuses yet.\'); + return; + } + $count = facebook_status_has_status(arg(1)); + if (!$count) { + global $user; + if ($user->uid == $account->uid) { + echo t(\'You have no statuses yet.\'); + } + else { + echo t(\'!name has no statuses yet.\', array(\'!name\' => theme(\'username\', $account))); + } + } + ?>'); + $handler->override_option('empty_format', '3'); + } + $handler->override_option('use_ajax', TRUE); + $handler->override_option('use_pager', '1'); + $handler->override_option('use_more', 1); + $handler->override_option('distinct', 0); + $handler->override_option('style_plugin', 'table'); + $handler->override_option('style_options', array( + 'grouping' => '', + 'override' => 1, + 'sticky' => 1, + 'order' => 'desc', + 'columns' => array( + 'name' => 'name', + 'uid' => 'uid', + 'status' => 'status', + ), + 'info' => array( + 'name' => array( + 'sortable' => 0, + 'separator' => '', + ), + 'uid' => array( + 'sortable' => 0, + 'separator' => '', + ), + 'status' => array( + 'sortable' => 0, + 'separator' => '', + ), + ), + 'default' => '-1', + )); + $handler = $view->new_display('page', 'Page', 'page_1'); + $handler->override_option('path', 'user/%/status'); + $handler->override_option('menu', array( + 'type' => 'tab', + 'title' => 'Statuses', + 'description' => '', + 'weight' => '0', + 'name' => 'navigation', + )); + $handler->override_option('tab_options', array( + 'type' => 'none', + 'title' => '', + 'description' => '', + 'weight' => 0, + )); + $handler = $view->new_display('block', 'Block', 'block_1'); + $handler->override_option('block_description', 'Facebook-style Statuses Profile'); + $handler->override_option('block_caching', -1); + $views[$view->name] = $view; + + $view = new view; + $view->name = 'facebook_status_recent'; + $view->description = 'Facebook-style Statuses Recent Status Updates'; + $view->tag = 'facebook_status'; + $view->view_php = ''; + $view->base_table = 'facebook_status'; + $view->is_cacheable = FALSE; + $view->api_version = 2; + $view->disabled = FALSE; + $handler = $view->new_display('default', 'Latest Status', 'default'); + $handler->override_option('fields', array( + 'edit' => array( + 'label' => '', + 'alter' => array( + 'alter_text' => 0, + 'text' => '', + 'make_link' => 0, + 'path' => '', + 'link_class' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'strip_tags' => 0, + 'html' => 0, + ), + 'exclude' => 1, + 'id' => 'edit', + 'table' => 'facebook_status', + 'field' => 'edit', + 'relationship' => 'none', + ), + 'delete' => array( + 'label' => '', + 'alter' => array( + 'alter_text' => 0, + 'text' => '', + 'make_link' => 0, + 'path' => '', + 'link_class' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'strip_tags' => 0, + 'html' => 0, + ), + 'exclude' => 1, + 'id' => 'delete', + 'table' => 'facebook_status', + 'field' => 'delete', + 'relationship' => 'none', + ), + 'respond' => array( + 'label' => '', + 'alter' => array( + 'alter_text' => 0, + 'text' => '', + 'make_link' => 0, + 'path' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'strip_tags' => 0, + 'html' => 0, + ), + 'exclude' => 1, + 'id' => 'respond', + 'table' => 'facebook_status', + 'field' => 'respond', + 'relationship' => 'none', + ), + 'pid_extra' => array( + 'label' => '', + 'alter' => array( + 'alter_text' => 0, + 'text' => '', + 'make_link' => 0, + 'path' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'strip_tags' => 0, + 'html' => 0, + ), + 'exclude' => 1, + 'id' => 'pid_extra', + 'table' => 'facebook_status', + 'field' => 'pid_extra', + 'relationship' => 'none', + ), + 'message' => array( + 'label' => '', + 'alter' => array( + 'alter_text' => 0, + 'text' => '', + 'make_link' => 0, + 'path' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'strip_tags' => 0, + 'html' => 0, + ), + 'exclude' => 1, + 'id' => 'message', + 'table' => 'facebook_status', + 'field' => 'message', + 'relationship' => 'none', + ), + 'created' => array( + 'label' => '', + 'alter' => array( + 'alter_text' => 1, + 'text' => '[pid_extra] [message] [created] [edit] [delete] [respond]', + 'make_link' => 0, + 'path' => '', + 'link_class' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'strip_tags' => 0, + 'html' => 0, + ), + 'date_format' => 'time ago', + 'custom_date_format' => '1', + 'exclude' => 0, + 'id' => 'created', + 'table' => 'facebook_status', + 'field' => 'created', + 'relationship' => 'none', + ), + )); + $handler->override_option('sorts', array( + 'created' => array( + 'order' => 'DESC', + 'id' => 'created', + 'table' => 'facebook_status', + 'field' => 'created', + 'relationship' => 'none', + ), + 'sid' => array( + 'order' => 'DESC', + 'id' => 'sid', + 'table' => 'facebook_status', + 'field' => 'sid', + 'relationship' => 'none', + ), + )); + $handler->override_option('filters', array( + 'sid_extra' => array( + 'operator' => '=', + 'value' => '0', + 'group' => '0', + 'exposed' => FALSE, + 'expose' => array( + 'operator' => FALSE, + 'label' => '', + ), + 'id' => 'sid_extra', + 'table' => 'facebook_status', + 'field' => 'sid_extra', + 'relationship' => 'none', + ), + 'pid_extra_3' => array( + 'operator' => '=', + 'value' => '0', + 'group' => '0', + 'exposed' => FALSE, + 'expose' => array( + 'operator' => FALSE, + 'label' => '', + ), + 'id' => 'pid_extra_3', + 'table' => 'facebook_status', + 'field' => 'pid_extra_3', + 'relationship' => 'none', + ), + 'message' => array( + 'operator' => '!=', + 'value' => '', + 'group' => '0', + 'exposed' => FALSE, + 'expose' => array( + 'operator' => FALSE, + 'label' => '', + ), + 'case' => 1, + 'id' => 'message', + 'table' => 'facebook_status', + 'field' => 'message', + 'relationship' => 'none', + ), + )); + $handler->override_option('access', array( + 'type' => 'perm', + 'perm' => 'view all statuses', + )); + $handler->override_option('cache', array( + 'type' => 'none', + )); + $handler->override_option('title', 'Latest Status Updates'); + $handler->override_option('use_ajax', TRUE); + $handler->override_option('items_per_page', 15); + $handler->override_option('use_pager', '1'); + $handler->override_option('use_more', 1); + $handler->override_option('style_plugin', 'table'); + $handler->override_option('style_options', array( + 'grouping' => '', + 'override' => 1, + 'sticky' => 0, + 'order' => 'asc', + 'columns' => array( + 'name' => 'name', + 'message' => 'message', + 'created' => 'created', + ), + 'info' => array( + 'name' => array( + 'sortable' => 0, + 'separator' => '', + ), + 'message' => array( + 'sortable' => 0, + 'separator' => '', + ), + 'created' => array( + 'sortable' => 0, + 'separator' => '', + ), + ), + 'default' => '-1', + )); + $handler = $view->new_display('page', 'Page', 'page_1'); + $handler->override_option('path', 'statuses/recent'); + $handler->override_option('menu', array( + 'type' => 'default tab', + 'title' => 'Latest Status Updates', + 'description' => '', + 'weight' => '0', + 'name' => 'navigation', + )); + $handler->override_option('tab_options', array( + 'type' => 'normal', + 'title' => 'Latest Status Updates', + 'description' => '', + 'weight' => '0', + )); + $handler = $view->new_display('block', 'Block', 'block_1'); + $handler->override_option('block_description', 'Facebook-style Statuses Latest Status Updates'); + $handler->override_option('block_caching', -1); + $handler = $view->new_display('feed', 'Feed', 'feed_1'); + $handler->override_option('style_plugin', 'rss'); + $handler->override_option('style_options', array( + 'mission_description' => FALSE, + 'description' => '', + )); + $handler->override_option('row_plugin', 'facebook_status_rss'); + $handler->override_option('path', 'statuses/recent/feed'); + $handler->override_option('menu', array( + 'type' => 'none', + 'title' => '', + 'description' => '', + 'weight' => 0, + 'name' => 'navigation', + )); + $handler->override_option('tab_options', array( + 'type' => 'none', + 'title' => '', + 'description' => '', + 'weight' => 0, + 'name' => 'navigation', + )); + $handler->override_option('displays', array( + 'page_1' => 'page_1', + 'default' => 0, + 'block_1' => 0, + )); + $handler->override_option('sitename_title', FALSE); + $views[$view->name] = $view; + + $view = new view; + $view->name = 'facebook_status_cross_post'; + $view->description = 'Facebook-style Statuses Conversations'; + $view->tag = 'facebook_status'; + $view->view_php = ''; + $view->base_table = 'facebook_status'; + $view->is_cacheable = FALSE; + $view->api_version = 2; + $view->disabled = FALSE; + $handler = $view->new_display('default', 'Conversation', 'default'); + $handler->override_option('fields', array( + 'pid_name' => array( + 'label' => '', + 'alter' => array( + 'alter_text' => 0, + 'text' => '', + 'make_link' => 0, + 'path' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'strip_tags' => 0, + 'html' => 0, + ), + 'link_to_user' => 1, + 'exclude' => 1, + 'id' => 'pid_name', + 'table' => 'facebook_status', + 'field' => 'pid_name', + 'relationship' => 'none', + ), + 'message' => array( + 'label' => '', + 'alter' => array( + 'alter_text' => 0, + 'text' => '', + 'make_link' => 0, + 'path' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'strip_tags' => 0, + 'html' => 0, + ), + 'exclude' => 1, + 'id' => 'message', + 'table' => 'facebook_status', + 'field' => 'message', + 'relationship' => 'none', + ), + 'edit' => array( + 'label' => '', + 'alter' => array( + 'alter_text' => 0, + 'text' => '', + 'make_link' => 0, + 'path' => '', + 'link_class' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'strip_tags' => 0, + 'html' => 0, + ), + 'exclude' => 1, + 'id' => 'edit', + 'table' => 'facebook_status', + 'field' => 'edit', + 'relationship' => 'none', + ), + 'delete' => array( + 'label' => '', + 'alter' => array( + 'alter_text' => 0, + 'text' => '', + 'make_link' => 0, + 'path' => '', + 'link_class' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'strip_tags' => 0, + 'html' => 0, + ), + 'exclude' => 1, + 'id' => 'delete', + 'table' => 'facebook_status', + 'field' => 'delete', + 'relationship' => 'none', + ), + 'created' => array( + 'label' => '', + 'alter' => array( + 'alter_text' => 1, + 'text' => '[pid_name] [message] [created] [edit] [delete]', + 'make_link' => 0, + 'path' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'strip_tags' => 0, + 'html' => 0, + ), + 'date_format' => 'time ago', + 'custom_date_format' => '1', + 'exclude' => 0, + 'id' => 'created', + 'table' => 'facebook_status', + 'field' => 'created', + 'relationship' => 'none', + ), + )); + $handler->override_option('sorts', array( + 'created' => array( + 'order' => 'DESC', + 'id' => 'created', + 'table' => 'facebook_status', + 'field' => 'created', + 'relationship' => 'none', + ), + 'sid' => array( + 'order' => 'DESC', + 'id' => 'sid', + 'table' => 'facebook_status', + 'field' => 'sid', + 'relationship' => 'none', + ), + )); + $handler->override_option('arguments', array( + 'sender' => array( + 'default_action' => 'not found', + 'style_plugin' => 'default_summary', + 'style_options' => array(), + 'wildcard' => 'all', + 'wildcard_substitution' => 'All', + 'title' => 'Conversation', + 'default_argument_type' => 'fixed', + 'default_argument' => '', + 'validate_type' => 'php', + 'validate_fail' => 'not found', + 'break_phrase' => 1, + 'not' => 0, + 'id' => 'sender', + 'table' => 'facebook_status', + 'field' => 'sender', + 'validate_user_argument_type' => 'sender', + 'validate_user_roles' => array( + '2' => 0, + '3' => 0, + '4' => 0, + ), + 'relationship' => 'none', + 'default_options_div_prefix' => '', + 'default_argument_user' => 0, + 'default_argument_fixed' => '', + 'default_argument_php' => '', + 'validate_argument_node_type' => array( + 'page' => 0, + ), + 'validate_argument_node_access' => 0, + 'validate_argument_nid_type' => 'nid', + 'validate_argument_vocabulary' => array( + '1' => 0, + '2' => 0, + ), + 'validate_argument_type' => 'tid', + 'validate_argument_transform' => 0, + 'validate_user_restrict_roles' => 0, + 'validate_argument_node_flag_name' => '*relationship*', + 'validate_argument_node_flag_test' => 'flaggable', + 'validate_argument_node_flag_id_type' => 'id', + 'validate_argument_user_flag_name' => '*relationship*', + 'validate_argument_user_flag_test' => 'flaggable', + 'validate_argument_user_flag_id_type' => 'id', + 'validate_argument_php' => ' //If this view is overridden and then FBSS is disabled, it can + //cause a WSOD if these lines are not included here. + if (!function_exists(\'_facebook_status_user_load\')) { + return; + } + + $names = explode(\',\', $argument); + $uids = array(); + foreach ($names as $name) { + if (!is_numeric($name)) { + $account = _facebook_status_user_load_by_name($name); + } + else { + $account = _facebook_status_user_load($name); + } + if ($account->uid) { + $uids[] = $account->uid; + } + } + if (!empty($uids)) { + global $user; + if (count($uids) === 1 && $uids[0] != $user->uid) { + $uids[1] = $user->uid; + } + $handler->argument = implode(\',\', $uids); + return TRUE; + } + return FALSE;', + ), + 'recipient' => array( + 'default_action' => 'default', + 'style_plugin' => 'default_summary', + 'style_options' => array(), + 'wildcard' => 'all', + 'wildcard_substitution' => 'All', + 'title' => 'Conversation', + 'default_argument_type' => 'php', + 'default_argument' => '', + 'validate_type' => 'php', + 'validate_fail' => 'not found', + 'break_phrase' => 1, + 'not' => 0, + 'id' => 'recipient', + 'table' => 'facebook_status', + 'field' => 'recipient', + 'validate_user_argument_type' => 'uid', + 'validate_user_roles' => array( + '2' => 0, + '3' => 0, + '4' => 0, + ), + 'relationship' => 'none', + 'default_options_div_prefix' => '', + 'default_argument_user' => 0, + 'default_argument_fixed' => '', + 'default_argument_php' => '$arg = arg(2); + $values = explode(\',\', $arg); + global $user; + if (count($values) === 1 && $values[0] != $user->uid && $values[0] != $user->name) { + if (is_numeric($values[0])) { + return $arg .\',\'. $user->uid; + } + else { + return $arg .\',\'. $user->name; + } + } + return $arg;', + 'validate_argument_node_type' => array( + 'page' => 0, + ), + 'validate_argument_node_access' => 0, + 'validate_argument_nid_type' => 'nid', + 'validate_argument_vocabulary' => array( + '1' => 0, + '2' => 0, + ), + 'validate_argument_type' => 'tid', + 'validate_argument_transform' => 0, + 'validate_user_restrict_roles' => 0, + 'validate_argument_node_flag_name' => '*relationship*', + 'validate_argument_node_flag_test' => 'flaggable', + 'validate_argument_node_flag_id_type' => 'id', + 'validate_argument_user_flag_name' => '*relationship*', + 'validate_argument_user_flag_test' => 'flaggable', + 'validate_argument_user_flag_id_type' => 'id', + 'validate_argument_php' => ' //If this view is overridden and then FBSS is disabled, it can + //cause a WSOD if these lines are not included here. + if (!function_exists(\'_facebook_status_user_load\')) { + return; + } + + $names = explode(\',\', $argument); + $uids = array(); + foreach ($names as $name) { + if (!is_numeric($name)) { + $account = _facebook_status_user_load_by_name($name); + } + else { + $account = _facebook_status_user_load($name); + } + if ($account->uid) { + $uids[] = $account->uid; + } + } + if (!empty($uids)) { + $handler->argument = implode(\',\', $uids); + return TRUE; + } + return FALSE;', + ), + )); + $handler->override_option('filters', array( + 'pid_extra_2' => array( + 'operator' => '=', + 'value' => '1', + 'group' => '0', + 'exposed' => FALSE, + 'expose' => array( + 'operator' => FALSE, + 'label' => '', + ), + 'id' => 'pid_extra_2', + 'table' => 'facebook_status', + 'field' => 'pid_extra_2', + 'relationship' => 'none', + ), + )); + $handler->override_option('access', array( + 'type' => 'perm', + 'perm' => 'view all statuses', + )); + $handler->override_option('title', 'Conversation'); + $handler->override_option('empty_format', '1'); + $handler->override_option('use_ajax', TRUE); + $handler->override_option('use_pager', 'mini'); + $handler->override_option('use_more', 1); + $handler->override_option('style_plugin', 'table'); + $handler->override_option('style_options', array( + 'grouping' => '', + 'override' => 1, + 'sticky' => 0, + 'order' => 'asc', + 'columns' => array( + 'name' => 'name', + 'message' => 'message', + 'created' => 'created', + ), + 'info' => array( + 'name' => array( + 'sortable' => 0, + 'separator' => '', + ), + 'message' => array( + 'sortable' => 0, + 'separator' => '', + ), + 'created' => array( + 'sortable' => 0, + 'separator' => '', + ), + ), + 'default' => '-1', + )); + $handler = $view->new_display('page', 'Page', 'page_1'); + $handler->override_option('path', 'statuses/conversations'); + $handler->override_option('menu', array( + 'type' => 'none', + 'title' => '', + 'description' => '', + 'weight' => 0, + 'name' => 'navigation', + )); + $handler->override_option('tab_options', array( + 'type' => 'none', + 'title' => '', + 'description' => '', + 'weight' => 0, + )); + $views[$view->name] = $view; + + return $views; +} Index: sites/all/modules/facebook_status/facebook_status_views_handler_argument_flagged_user.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_handler_argument_flagged_user.inc diff -N sites/all/modules/facebook_status/facebook_status_views_handler_argument_flagged_user.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_handler_argument_flagged_user.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,48 @@ +fid : NULL; + $options['facebook_status_flag_type'] = array( + 'default' => $default, + 'translatable' => FALSE, + ); + return $options; + } + function options_form(&$form, &$form_state) { + parent::options_form($form, $form_state); + $flags = flag_get_flags('user'); + $options = array(); + foreach ($flags as $flag) { + $options[$flag->fid] = $flag->get_title(); + } + $form['warning'] = array( + '#value' => t('Warning: this argument can be slow.'), + '#weight' => -100, + ); + $form['facebook_status_flag_type'] = array( + '#type' => 'radios', + '#title' => t('Flag'), + '#options' => $options, + '#default_value' => $this->options['facebook_status_flag_type'], + '#required' => TRUE, + ); + } + function query() { + $argument = $this->argument; + $field = "$this->table.$this->real_field"; + $query = db_prefix_tables("$field IN (SELECT content_id FROM {flag_content} WHERE fid = %d AND uid = %d) OR $field = %d"); + $this->query->add_where(0, $query, $this->options['facebook_status_flag_type'], $argument, $argument); + } +} \ No newline at end of file Index: sites/all/modules/facebook_status/facebook_status_views_handler_field_created.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_handler_field_created.inc diff -N sites/all/modules/facebook_status/facebook_status_views_handler_field_created.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_handler_field_created.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,57 @@ + 'themed'); + return $options; + } + function options_form(&$form, &$form_state) { + parent::options_form($form, $form_state); + $form['date_format']['#options']['themed'] = t('Themed (changes based on recency)'); + $form['date_format']['#default_value'] = isset($this->options['date_format']) ? $this->options['date_format'] : 'themed'; + } + function render($values) { + $value = $values->{$this->field_alias}; + $format = $this->options['date_format']; + $custom_format = ''; + if (in_array($format, array('custom', 'raw time ago', 'time ago', 'raw time span', 'time span'))) { + $custom_format = $this->options['custom_date_format']; + } + if (!$value) { + return theme('views_nodate'); + } + else { + $time_diff = time() - $value; // will be positive for a datetime in the past (ago), and negative for a datetime in the future (hence) + switch ($format) { + case 'raw time ago': + return format_interval($time_diff, is_numeric($custom_format) ? $custom_format : 2); + case 'time ago': + return t('%time ago', array('%time' => format_interval($time_diff, is_numeric($custom_format) ? $custom_format : 2))); + case 'raw time span': + return ($time_diff < 0 ? '-' : '') . format_interval(abs($time_diff), is_numeric($custom_format) ? $custom_format : 2); + case 'time span': + $args = array('%time' => format_interval(abs($time_diff), is_numeric($custom_format) ? $custom_format : 2)); + if ($time_diff < 0) { + return t('%time hence', $args); + } + return t('%time ago', $args); + case 'custom': + return format_date($value, $format, $custom_format); + case 'themed': + return theme('facebook_status_time', $value); + default: + return format_date($value, $format); + } + } + } +} Index: sites/all/modules/facebook_status/facebook_status_views_handler_field_cross.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_handler_field_cross.inc diff -N sites/all/modules/facebook_status/facebook_status_views_handler_field_cross.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_handler_field_cross.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,30 @@ +additional_fields['sender'] = 'sender'; + } + function render($values) { + $uid = $values->{$this->aliases['sender']}; + $pid = $values->{$this->field_alias}; + if (isset($uid) && $pid == $uid) { + return theme('username', _facebook_status_user_load($uid)); + } + else { + $args = array('!poster' => theme('username', _facebook_status_user_load($pid)), + '!owner' => theme('username', _facebook_status_user_load($uid))); + return t('!poster » !owner', $args); + } + } +} Index: sites/all/modules/facebook_status/facebook_status_views_handler_field_cross_pic.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_handler_field_cross_pic.inc diff -N sites/all/modules/facebook_status/facebook_status_views_handler_field_cross_pic.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_handler_field_cross_pic.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,70 @@ + variable_get('user_picture_imagecache_profiles_default', ''), + 'translatable' => FALSE, + ); + } + return $options; + } + function options_form(&$form, &$form_state) { + parent::options_form($form, $form_state); + if (module_exists('imagecache_profiles')) { + $presets = imagecache_presets(); + $opt = array('' => ''); + foreach ($presets as $preset) { + $opt[$preset['presetname']] = check_plain($preset['presetname']); + } + $options = $this->options; + $form['imagecache_preset'] = array( + '#title' => t('Imagecache preset'), + '#type' => 'select', + '#options' => $opt, + '#default_value' => $options['imagecache_preset'], + ); + } + } + function construct() { + parent::construct(); + $this->additional_fields['uid'] = 'sender'; + } + function render($values) { + $uid = $values->{$this->aliases['sender']}; + $pid = $values->{$this->field_alias}; + $options = $this->options; + if (isset($uid) && $pid == $uid) { + $account = _facebook_status_user_load($uid); + if (isset($options['imagecache_preset']) && $options['imagecache_preset']) { + $account->imagecache_preset = $options['imagecache_preset']; + } + return t('!picture !user', array('!picture' => facebook_status_display_user_picture($account), '!user' => theme('username', $account))); + } + else { + $poster = _facebook_status_user_load($pid); + $owner = _facebook_status_user_load($uid); + if (isset($options['imagecache_preset']) && $options['imagecache_preset']) { + $poster->imagecache_preset = $options['imagecache_preset']; + $owner->imagecache_preset = $options['imagecache_preset']; + } + $args = array('!poster' => theme('username', $poster), '!owner' => theme('username', $owner)); + $args['!poster-picture'] = facebook_status_display_user_picture($poster); + $args['!owner-picture'] = facebook_status_display_user_picture($owner); + return t('!poster-picture !poster » !owner-picture !owner', $args); + } + } +} Index: sites/all/modules/facebook_status/facebook_status_views_handler_field_delete.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_handler_field_delete.inc diff -N sites/all/modules/facebook_status/facebook_status_views_handler_field_delete.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_handler_field_delete.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,32 @@ +additional_fields['sender'] = 'sender'; + $this->additional_fields['recipient'] = 'recipient'; + } + function render($values) { + $status = new stdClass(); + $status->sender = $values->{$this->aliases['sender']}; + $status->recipient = $values->{$this->aliases['recipient']}; + $status->sid = $values->{$this->field_alias}; + if (_facebook_status_can_edit($status, TRUE)) { + drupal_add_css(drupal_get_path('module', 'facebook_status') .'/facebook_status.css'); + $q = $_GET['q']; + if ($q == 'facebook_status/js') { + $q = 'user'; + } + return ''. l(t('Delete'), 'statuses/'. $status->sid .'/delete', array('query' => array('destination' => $q))) .''; + } + } +} Index: sites/all/modules/facebook_status/facebook_status_views_handler_field_edit.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_handler_field_edit.inc diff -N sites/all/modules/facebook_status/facebook_status_views_handler_field_edit.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_handler_field_edit.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,32 @@ +additional_fields['sender'] = 'sender'; + $this->additional_fields['recipient'] = 'recipient'; + } + function render($values) { + $status = new stdClass(); + $status->sender = $values->{$this->aliases['sender']}; + $status->recipient = $values->{$this->aliases['recipient']}; + $status->sid = $values->{$this->field_alias}; + if (_facebook_status_can_edit($status)) { + drupal_add_css(drupal_get_path('module', 'facebook_status') .'/facebook_status.css'); + $q = $_GET['q']; + if ($q == 'facebook_status/js') { + $q = 'user'; + } + return ''. l(t('Edit'), 'statuses/'. $status->sid .'/edit', array('query' => array('destination' => $q))) .''; + } + } +} Index: sites/all/modules/facebook_status/facebook_status_views_handler_field_poster.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_handler_field_poster.inc diff -N sites/all/modules/facebook_status/facebook_status_views_handler_field_poster.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_handler_field_poster.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,20 @@ +{$this->field_alias}); + if (!empty($this->options['link_to_user'])) { + return theme('username', $account); + } + return check_plain($account->name); + } +} \ No newline at end of file Index: sites/all/modules/facebook_status/facebook_status_views_handler_field_poster_pic.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_handler_field_poster_pic.inc diff -N sites/all/modules/facebook_status/facebook_status_views_handler_field_poster_pic.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_handler_field_poster_pic.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,48 @@ + variable_get('user_picture_imagecache_profiles_default', ''), + 'translatable' => FALSE, + ); + } + return $options; + } + function options_form(&$form, &$form_state) { + parent::options_form($form, $form_state); + if (module_exists('imagecache_profiles')) { + $presets = imagecache_presets(); + $opt = array('' => ''); + foreach ($presets as $preset) { + $opt[$preset['presetname']] = check_plain($preset['presetname']); + } + $options = $this->options; + $form['imagecache_preset'] = array( + '#title' => t('Imagecache preset'), + '#type' => 'select', + '#options' => $opt, + '#default_value' => $options['imagecache_preset'], + ); + } + } + function render($values) { + $account = _facebook_status_user_load($values->{$this->field_alias}); + $options = $this->options; + if (isset($options['imagecache_preset']) && $options['imagecache_preset']) { + $account->imagecache_preset = $options['imagecache_preset']; + } + return facebook_status_display_user_picture($account); + } +} \ No newline at end of file Index: sites/all/modules/facebook_status/facebook_status_views_handler_field_poster_pic_activity.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_handler_field_poster_pic_activity.inc diff -N sites/all/modules/facebook_status/facebook_status_views_handler_field_poster_pic_activity.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_handler_field_poster_pic_activity.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,64 @@ +additional_fields['eid'] = array('table' => 'activity', 'field' => 'eid'); + $this->additional_fields['type'] = array('table' => 'activity', 'field' => 'type'); + } + function option_definition() { + $options = parent::option_definition(); + if (module_exists('imagecache_profiles')) { + $options['imagecache_preset'] = array( + 'default' => variable_get('user_picture_imagecache_profiles_default', ''), + 'translatable' => FALSE, + ); + } + return $options; + } + function options_form(&$form, &$form_state) { + parent::options_form($form, $form_state); + if (module_exists('imagecache_profiles')) { + $presets = imagecache_presets(); + $opt = array('' => ''); + foreach ($presets as $preset) { + $opt[$preset['presetname']] = check_plain($preset['presetname']); + } + $options = $this->options; + $form['imagecache_preset'] = array( + '#title' => t('Imagecache preset'), + '#type' => 'select', + '#options' => $opt, + '#default_value' => $options['imagecache_preset'], + ); + } + } + function query() { + $this->ensure_my_table(); + $this->add_additional_fields(); + } + function render($values) { + if ($values->{$this->aliases['type']} == 'facebook_status') { + $sid = $values->{$this->aliases['eid']}; + $status = facebook_status_load($sid); + $account = _facebook_status_user_load($status->pid); + } + else { + $account = _facebook_status_user_load($values->{$this->field_alias}); + } + $options = $this->options; + if (isset($options['imagecache_preset']) && $options['imagecache_preset']) { + $account->imagecache_preset = $options['imagecache_preset']; + } + return facebook_status_display_user_picture($account); + } +} \ No newline at end of file Index: sites/all/modules/facebook_status/facebook_status_views_handler_field_repost.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_handler_field_repost.inc diff -N sites/all/modules/facebook_status/facebook_status_views_handler_field_repost.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_handler_field_repost.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,44 @@ +additional_fields['recipient'] = 'recipient'; + } + function option_definition() { + $options = parent::option_definition(); + $options['repost_text'] = array( + 'default' => t('Share'), + 'translatable' => TRUE, + ); + return $options; + } + function options_form(&$form, &$form_state) { + parent::options_form($form, $form_state); + $form['repost_text'] = array( + '#title' => t('Re-post text'), + '#type' => 'textfield', + '#description' => t('The text that will display for the "Re-post this" link.'), + '#default_value' => $this->options['repost_text'], + ); + } + function render($values) { + if ((user_access('edit own status') || user_access('edit all statuses')) && $values->{$this->aliases['recipient']} != $GLOBALS['user']->uid) { + drupal_add_css(drupal_get_path('module', 'facebook_status') .'/facebook_status.css'); + $options = array( + 'attributes' => array('class' => 'facebook_status_conversation_link'), + 'query' => array('sid' => $values->{$this->field_alias}, 'destination' => $_GET['q']) + ); + return l($this->options['repost_text'], 'share-status', $options); + } + } +} Index: sites/all/modules/facebook_status/facebook_status_views_handler_field_respond.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_handler_field_respond.inc diff -N sites/all/modules/facebook_status/facebook_status_views_handler_field_respond.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_handler_field_respond.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,51 @@ +additional_fields['sender'] = 'sender'; + $this->additional_fields['recipient'] = 'recipient'; + } + function render($values) { + global $user; + $owner = _facebook_status_user_load($values->{$this->aliases['sender']}); + $poster = _facebook_status_user_load($values->{$this->field_alias}); + drupal_add_css(drupal_get_path('module', 'facebook_status') .'/facebook_status.css'); + $options = array('attributes' => array('class' => 'facebook_status_conversation_link')); + if ($owner->uid != $poster->uid && user_access('post on all profiles')) { + $title = t('View conversation'); + if ($owner->uid == $user->uid) { + $title = t('Reply'); + } + if (module_exists('realname')) { + return l($title, 'statuses/conversation/'. $poster->uid .','. $owner->uid, $options); + } + return l($title, 'statuses/conversation/'. check_plain($poster->name) .','. check_plain($owner->name), $options); + } + elseif ((user_access('edit own status') || user_access('edit all statuses')) && $owner->uid == $poster->uid && $poster->uid != $user->uid) { + $s = '@'. $poster->name .' '; + //Properly reference tags with word-break characters in them. + if (preg_match('/.+\b.+/', $poster->name)) { + $s = '[@'. $poster->name .'] '; + } + if (variable_get('facebook_status_reply_type', 'at') == 'at') { + //Evidently url() sanitizes query strings itself, so we don't have to use check_plain() here. + $options['query'] = array('s' => $s, 'rsid' => $values->{$this->aliases['sid']}, 'destination' => $_GET['q']); + return l(t('Respond'), 'share-status', $options); + } + if (module_exists('realname')) { + return l(t('Respond'), 'statuses/conversation/'. $poster->uid .','. $user->uid, $options); + } + return l(t('Respond'), 'statuses/conversation/'. check_plain($poster->name) .','. check_plain($user->name), $options); + } + } +} Index: sites/all/modules/facebook_status/facebook_status_views_handler_field_status.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_handler_field_status.inc diff -N sites/all/modules/facebook_status/facebook_status_views_handler_field_status.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_handler_field_status.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,32 @@ +additional_fields['sid'] = 'sid'; + $this->additional_fields['sender'] = 'sender'; + $this->additional_fields['recipient'] = 'recipient'; + $this->additional_fields['type'] = 'type'; + $this->additional_fields['created'] = 'created'; + } + function render($values) { + $status = new stdClass(); + $status->sid = $values->{$this->aliases['sid']}; + $status->sender = $values->{$this->aliases['sender']}; + $status->recipient = $values->{$this->aliases['recipient']}; + $status->type = $values->{$this->aliases['type']}; + $status->message = $values->{$this->field_alias}; + $status->created = $values->{$this->aliases['created']}; + $components = facebook_status_item_components($status); + return $components['status']['#value']; + } +} Index: sites/all/modules/facebook_status/facebook_status_views_handler_filter.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_handler_filter.inc diff -N sites/all/modules/facebook_status/facebook_status_views_handler_filter.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_handler_filter.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,27 @@ +definition['type'] = 'yes-no'; + $this->definition['label'] = t('Show Latest Status Update Only (per User)'); + $this->value_value = $this->definition['label']; + parent::construct(); + } + + function query() { + if ($this->value) { + $this->ensure_my_table(); + $subquery = "(SELECT MAX(sid) FROM {facebook_status} WHERE uid = recipient GROUP BY uid)"; + $this->query->add_where(0, db_prefix_tables("$this->table_alias.sid IN $subquery")); + } + } +} Index: sites/all/modules/facebook_status/facebook_status_views_handler_filter_flagged_user.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_handler_filter_flagged_user.inc diff -N sites/all/modules/facebook_status/facebook_status_views_handler_filter_flagged_user.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_handler_filter_flagged_user.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,46 @@ +fid : NULL; + $options['facebook_status_flag_type'] = array( + 'default' => $default, + 'translatable' => FALSE, + ); + return $options; + } + function options_form(&$form, &$form_state) { + $flags = flag_get_flags('user'); + $options = array(); + foreach ($flags as $flag) { + $options[$flag->fid] = $flag->get_title(); + } + $form['warning'] = array( + '#value' => t('Warning: this filter can be slow.'), + '#weight' => -100, + ); + $form['facebook_status_flag_type'] = array( + '#type' => 'radios', + '#title' => t('Flag'), + '#options' => $options, + '#default_value' => $this->options['facebook_status_flag_type'], + '#required' => TRUE, + ); + } + function query() { + $query = "({$this->table}.pid IN (SELECT content_id FROM {flag_content} WHERE fid = %d AND uid = %d) OR {$this->table}.pid = %d)"; + $query = db_prefix_tables($query); + $this->query->add_where($this->options['group'], $query, $this->options['facebook_status_flag_type'], $GLOBALS['user']->uid, $GLOBALS['user']->uid); + } +} \ No newline at end of file Index: sites/all/modules/facebook_status/facebook_status_views_handler_filter_not_own.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_handler_filter_not_own.inc diff -N sites/all/modules/facebook_status/facebook_status_views_handler_filter_not_own.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_handler_filter_not_own.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,26 @@ +definition['type'] = 'yes-no'; + $this->definition['label'] = t("Show only posts to other users"); + $this->value_value = $this->definition['label']; + parent::construct(); + } + + function query() { + if ($this->value) { + $this->ensure_my_table(); + $this->query->add_where(0, db_prefix_tables("$this->table_alias.uid <> $this->table_alias.pid")); + } + } +} \ No newline at end of file Index: sites/all/modules/facebook_status/facebook_status_views_handler_filter_own.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_handler_filter_own.inc diff -N sites/all/modules/facebook_status/facebook_status_views_handler_filter_own.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_handler_filter_own.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,26 @@ +definition['type'] = 'yes-no'; + $this->definition['label'] = t('Show only own statuses'); + $this->value_value = $this->definition['label']; + parent::construct(); + } + + function query() { + if ($this->value) { + $this->ensure_my_table(); + $this->query->add_where(0, db_prefix_tables("$this->table_alias.uid = $this->table_alias.pid")); + } + } +} \ No newline at end of file Index: sites/all/modules/facebook_status/facebook_status_views_handler_filter_string_type.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_handler_filter_string_type.inc diff -N sites/all/modules/facebook_status/facebook_status_views_handler_filter_string_type.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_handler_filter_string_type.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,23 @@ +value_options)) { + $this->value_title = t('Tag type'); + $options = array('user' => t('Users')); + if (module_exists('taxonomy')) { + $options['term'] = t('Terms'); + } + $this->value_options = $options; + } + } +} \ No newline at end of file Index: sites/all/modules/facebook_status/facebook_status_views_plugin_row_rss.inc =================================================================== RCS file: sites/all/modules/facebook_status/facebook_status_views_plugin_row_rss.inc diff -N sites/all/modules/facebook_status/facebook_status_views_plugin_row_rss.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/all/modules/facebook_status/facebook_status_views_plugin_row_rss.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,61 @@ +{$this->field_alias}; + if (!is_numeric($sid)) { + return; + } + + // Load the specified status: + $status = facebook_status_load($sid); + if (empty($status)) { + return; + } + $owner = _facebook_status_user_load($status->sender); + $poster = _facebook_status_user_load($status->recipient); + + $item = new stdClass(); + $item->title = filter_xss($status->message); + $item->link = url("statuses/$status->sid", array('absolute' => TRUE)); + $item->sid = $status->sid; + $item->description = ''; + + $item->elements = array( + array('key' => 'pubDate', 'value' => gmdate('r', $status->status_time)), + array( + 'key' => 'dc:creator', + 'value' => check_plain($poster->name), + 'namespace' => array('xmlns:dc' => 'http://purl.org/dc/elements/1.1/'), + ), + array( + 'key' => 'guid', + 'value' => $status->sid . ' at ' . $base_url, + 'attributes' => array('isPermaLink' => 'false') + ), + ); + + foreach ($item->elements as $element) { + if (isset($element['namespace'])) { + $this->view->style_plugin->namespaces = array_merge($this->view->style_plugin->namespaces, $element['namespace']); + } + } + + return theme($this->theme_functions(), $this->view, $this->options, $item); + } +} Index: sites/all/modules/facebook_status/includes/utility/facebook_status.access.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/facebook_status/includes/utility/Attic/facebook_status.access.inc,v retrieving revision 1.1.2.1 diff -u -r1.1.2.1 facebook_status.access.inc --- sites/all/modules/facebook_status/includes/utility/facebook_status.access.inc 30 Nov 2010 07:20:44 -0000 1.1.2.1 +++ sites/all/modules/facebook_status/includes/utility/facebook_status.access.inc 15 Jan 2011 23:58:07 -0000 @@ -39,6 +39,7 @@ * FALSE otherwise. */ function facebook_status_user_access_converse() { + global $user; $uids = explode(',', arg(2), 2); if (empty($uids)) { return FALSE; Index: sites/all/modules/facebook_status/includes/utility/facebook_status.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/facebook_status/includes/utility/Attic/facebook_status.admin.inc,v retrieving revision 1.1.2.1 diff -u -r1.1.2.1 facebook_status.admin.inc --- sites/all/modules/facebook_status/includes/utility/facebook_status.admin.inc 30 Nov 2010 07:20:44 -0000 1.1.2.1 +++ sites/all/modules/facebook_status/includes/utility/facebook_status.admin.inc 15 Jan 2011 23:58:08 -0000 @@ -127,18 +127,18 @@ * Validate function for the advanced settings form. */ function facebook_status_admin_advanced_validate($form, &$form_state) { - $size = $form_state['values']['facebook_status_size_long']; +/* $size = $form_state['values']['facebook_status_size_long']; if (!is_numeric($size) || $size < 1 || $size != round($size)) { form_set_error('facebook_status_size_long', t('The size of the long status update field must be a positive integer.')); - } + }*/ $size = $form_state['values']['facebook_status_box_rows']; if (!is_numeric($size) || $size < 1 || $size != round($size)) { form_set_error('facebook_status_box_rows', t('The number of rows of the status update box must be a positive integer.')); } - $amount = $form_state['values']['facebook_status_flood_user']; +/* $amount = $form_state['values']['facebook_status_flood_user']; if (!is_numeric($amount) || $amount < 1 || $amount != round($amount)) { form_set_error('facebook_status_flood_user', t('The number of OpenAPI Accesses per IP must be a positive integer.')); - } + }*/ } /** @@ -153,7 +153,7 @@ $views = views_get_all_views(); $options = array('' => t('None')); foreach ($views as $name => $view) { - if ($view->disabled == 0) { + if (empty($view->disabled)) { $options[$name] = $name; } } Index: sites/all/modules/facebook_status/includes/utility/facebook_status.form.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/facebook_status/includes/utility/Attic/facebook_status.form.inc,v retrieving revision 1.1.2.2 diff -u -r1.1.2.2 facebook_status.form.inc --- sites/all/modules/facebook_status/includes/utility/facebook_status.form.inc 23 Dec 2010 07:37:07 -0000 1.1.2.2 +++ sites/all/modules/facebook_status/includes/utility/facebook_status.form.inc 15 Jan 2011 23:58:08 -0000 @@ -58,7 +58,7 @@ if ($conversation) { $args = explode(',', $arg); $count = count($args); - if ((($count === 1 && $args[0] != $user->uid) || ($count === 2 && is_numeric($args[1])) && is_numeric($args[0])) { + if (($count === 1 && $args[0] != $user->uid) || ($count === 2 && is_numeric($args[1])) && is_numeric($args[0])) { if (count($args) === 1) { $args[1] = $user->uid; } Index: sites/all/modules/facebook_status/includes/views/facebook_status.views.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/facebook_status.views.inc diff -N sites/all/modules/facebook_status/includes/views/facebook_status.views.inc --- sites/all/modules/facebook_status/includes/views/facebook_status.views.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,373 +0,0 @@ - array( - 'left_field' => 'uid', - 'field' => 'uid', - 'type' => 'INNER', - ), - ); - $data['users']['table']['join'] = array( - 'facebook_status' => array( - 'left_field' => 'uid', - 'field' => 'uid', - 'type' => 'INNER', - ), - ); - - //Advertise this table as a possible base table. - $data['facebook_status']['table']['base'] = array( - 'field' => 'sid', - 'title' => t('Facebook-style Statuses Updates'), - 'help' => t('Stores status updates.'), - 'weight' => 10, - ); - /* - $data['facebook_status']['users'] = array( - 'group' => t('Facebook-style Statuses'), - 'relationship' => array( - 'title' => t('Users'), - 'label' => t('Users'), - 'help' => t('Add a relationship to gain access to information related to the users who submitted the relevant statuses.'), - 'relationship table' => 'users', - 'relationship field' => 'uid', - 'base' => 'facebook_status', - 'field' => 'uid', - 'type' => 'INNER', - 'handler' => 'views_handler_relationship', - ), - ); - */ - - //Declares the Status ID column. - $data['facebook_status']['sid'] = array( - 'title' => t('Status ID'), - 'help' => t('The ID of the status update.'), - 'field' => array( - 'handler' => 'views_handler_field', - 'click sortable' => TRUE, - ), - 'filter' => array( - 'handler' => 'views_handler_filter_numeric', - ), - 'sort' => array( - 'handler' => 'views_handler_sort', - ), - 'argument' => array( - 'handler' => 'views_handler_argument_numeric', - ), - ); - - //Alias for Status ID to extend its use. - $data['facebook_status']['sid_extra'] = array( - 'title' => t('Last Status per User'), - 'help' => t('Show only the last status update for each user.'), - 'filter' => array( - 'field' => 'sid', - 'handler' => 'facebook_status_views_handler_filter', - 'label' => t('Last Status per User'), - ), - ); - $data['facebook_status']['edit'] = array( - 'title' => t('Edit'), - 'help' => t('Shows a link to edit the status to users with permission to see it.'), - 'field' => array( - 'field' => 'sid', - 'handler' => 'facebook_status_views_handler_field_edit', - 'click sortable' => FALSE, - ), - ); - $data['facebook_status']['delete'] = array( - 'title' => t('Delete'), - 'help' => t('Shows a link to delete the status to users with permission to see it.'), - 'field' => array( - 'field' => 'sid', - 'handler' => 'facebook_status_views_handler_field_delete', - 'click sortable' => FALSE, - ), - ); - $data['facebook_status']['repost'] = array( - 'title' => t('Re-post'), - 'help' => t('Shows a link to re-post a status.'), - 'field' => array( - 'field' => 'sid', - 'handler' => 'facebook_status_views_handler_field_repost', - 'click sortable' => FALSE, - ), - ); - - //Declares the Owner UID column. - $data['facebook_status']['uid'] = array( - 'title' => t('User ID'), - 'help' => t('The User ID of the owner of the status (if the status is from one user to another, this is the recipient).'), - 'field' => array( - 'handler' => 'views_handler_field', - 'click sortable' => TRUE, - ), - 'filter' => array( - 'handler' => 'views_handler_filter_numeric', - ), - 'sort' => array( - 'handler' => 'views_handler_sort', - ), - 'argument' => array( - 'handler' => 'views_handler_argument_numeric', - ), - ); - - //Declares the Poster UID column. - $data['facebook_status']['pid'] = array( - 'title' => t('Poster UID'), - 'help' => t('The User ID of the poster of the status.'), - 'field' => array( - 'handler' => 'views_handler_field', - 'click sortable' => TRUE, - ), - 'filter' => array( - 'handler' => 'views_handler_filter_numeric', - ), - 'sort' => array( - 'handler' => 'views_handler_sort', - ), - 'argument' => array( - 'handler' => 'views_handler_argument_numeric', - ), - ); - - //Alias for Poster UID to use the name. - $data['facebook_status']['pid_name'] = array( - 'title' => t('Poster Name'), - 'help' => t('The name of the user who posted the status.'), - 'field' => array( - 'field' => 'pid', - 'handler' => 'facebook_status_views_handler_field_poster', - 'click sortable' => FALSE, - ), - 'filter' => array( - 'field' => 'pid', - 'handler' => 'views_handler_filter_user_name', - ), - 'sort' => array( - 'field' => 'pid', - 'handler' => 'views_handler_sort', - ), - 'argument' => array( - 'field' => 'pid', - 'handler' => 'views_handler_argument_user_uid', - ), - ); - //Alias for poster picture. - $data['facebook_status']['pid_pic'] = array( - 'title' => t('Poster picture'), - 'help' => t('The picture of the user who posted the status.'), - 'field' => array( - 'field' => 'pid', - 'handler' => 'facebook_status_views_handler_field_poster_pic', - 'click sortable' => FALSE, - ), - ); - - //Alias for extras for the poster. - $data['facebook_status']['pid_extra'] = array( - 'title' => t('Usernames (context-aware)'), - 'help' => t('The themed username(s) of either the owner or the sender and recipient of the status, depending on the context.'), - 'field' => array( - 'field' => 'pid', - 'handler' => 'facebook_status_views_handler_field_cross', - 'click sortable' => FALSE, - 'label' => t('Users'), - ), - ); - $data['facebook_status']['pid_extra_2'] = array( - 'title' => t('Not own statuses'), - 'help' => t("Do not show statuses posted to one's own profile."), - 'filter' => array( - 'field' => 'pid', - 'handler' => 'facebook_status_views_handler_filter_not_own', - 'label' => t("Restrict to others' statuses"), - ), - ); - //This is slightly different than, but could probably be combined with, pid_extra_2. - $data['facebook_status']['pid_extra_3'] = array( - 'title' => t('Only own statuses'), - 'help' => t("Only show statuses posted to one's own profile."), - 'filter' => array( - 'field' => 'pid', - 'handler' => 'facebook_status_views_handler_filter_own', - 'label' => t('Restrict to own statuses'), - ), - ); - $data['facebook_status']['crosspost_users_pics'] = array( - 'title' => t('Users with Pictures'), - 'help' => t('The themed username(s) and pictures of either the owner or the sender and recipient of the status, depending on the context.'), - 'field' => array( - 'field' => 'pid', - 'handler' => 'facebook_status_views_handler_field_cross_pic', - 'click sortable' => FALSE, - 'label' => t('Users with Pictures'), - ), - ); - $data['facebook_status']['respond'] = array( - 'title' => t('Respond link'), - 'help' => t('Links to view the conversation or respond to it when appropriate.'), - 'field' => array( - 'field' => 'pid', - 'handler' => 'facebook_status_views_handler_field_respond', - 'click sortable' => FALSE, - 'label' => t('Respond to conversation'), - ), - ); - - //Declares the status message timestamp column. - $data['facebook_status']['status_time'] = array( - 'title' => t('Created time'), - 'help' => t('The time the status message was posted.'), - 'field' => array( - 'handler' => 'facebook_status_views_handler_field_created', - 'click sortable' => TRUE, - ), - 'sort' => array( - 'handler' => 'views_handler_sort', - ), - 'filter' => array( - 'handler' => 'views_handler_filter_date', - ), - ); - - //Declares the status text column. - $data['facebook_status']['status'] = array( - 'title' => t('Status text'), - 'help' => t('The text of the status update.'), - 'field' => array( - 'handler' => 'facebook_status_views_handler_field_status', - 'click sortable' => TRUE, - ), - 'filter' => array( - 'handler' => 'views_handler_filter_string', - ), - ); - - $data['activity']['activity-fbss-poster-pic'] = array( - 'title' => t('Poster picture'), - 'help' => t("The picture of the user who took action (normally the same as Users: Picture, but shows the poster's picture for status messages)."), - 'field' => array( - 'field' => 'uid', - 'handler' => 'facebook_status_views_handler_field_poster_pic_activity', - 'click sortable' => FALSE, - ), - ); - - if (module_exists('flag')) { - $data['facebook_status']['user-flag-plus-current'] = array( - 'title' => t('Content from flagged users or the current user'), - 'filter' => array( - 'field' => 'pid', - 'handler' => 'facebook_status_views_handler_filter_flagged_user', - ), - ); - $data['facebook_status']['user-flag-plus-arg'] = array( - 'title' => t('Content from flagged users or the argument user'), - 'argument' => array( - 'field' => 'pid', - 'handler' => 'facebook_status_views_handler_argument_flagged_user', - ), - ); - } - - return $data; -} - -/** - * Implementation of hook_views_handlers(). - */ -function facebook_status_views_handlers() { - return array( - 'info' => array( - 'path' => drupal_get_path('module', 'facebook_status'), - ), - 'handlers' => array( - 'facebook_status_views_handler_argument_flagged_user' => array( - 'parent' => 'views_handler_argument', - ), - 'facebook_status_views_handler_field_created' => array( - 'parent' => 'views_handler_field_date', - ), - 'facebook_status_views_handler_field_cross' => array( - 'parent' => 'views_handler_field', - ), - 'facebook_status_views_handler_field_cross_pic' => array( - 'parent' => 'views_handler_field', - ), - 'facebook_status_views_handler_field_delete' => array( - 'parent' => 'views_handler_field', - ), - 'facebook_status_views_handler_field_edit' => array( - 'parent' => 'views_handler_field', - ), - 'facebook_status_views_handler_field_poster' => array( - 'parent' => 'views_handler_field_user', - ), - 'facebook_status_views_handler_field_poster_pic' => array( - 'parent' => 'views_handler_field', - ), - 'facebook_status_views_handler_field_poster_pic_activity' => array( - 'parent' => 'views_handler_field', - ), - 'facebook_status_views_handler_field_repost' => array( - 'parent' => 'views_handler_field', - ), - 'facebook_status_views_handler_field_respond' => array( - 'parent' => 'views_handler_field', - ), - 'facebook_status_views_handler_field_status' => array( - 'parent' => 'views_handler_field', - ), - 'facebook_status_views_handler_filter' => array( - 'parent' => 'views_handler_filter_boolean_operator', - ), - 'facebook_status_views_handler_filter_flagged_user' => array( - 'parent' => 'views_handler_filter', - ), - 'facebook_status_views_handler_filter_not_own' => array( - 'parent' => 'views_handler_filter_boolean_operator', - ), - 'facebook_status_views_handler_filter_own' => array( - 'parent' => 'views_handler_filter_boolean_operator', - ), - ), - ); -} - -/** - * Implementation of hook_views_plugins(). - */ -function facebook_status_views_plugins() { - return array( - 'row' => array( - 'facebook_status_rss' => array( - 'title' => t('RSS items'), - 'help' => t('Displays statuses as RSS items.'), - 'handler' => 'facebook_status_views_plugin_row_rss', - 'parent' => 'fields', - 'path' => drupal_get_path('module', 'facebook_status'), - 'theme' => 'views_view_row_rss', - 'base' => array('facebook_status'), - 'uses fields' => FALSE, - 'uses options' => FALSE, - 'type' => 'feed', - ), - ) - ); -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/facebook_status.views_default.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/facebook_status.views_default.inc diff -N sites/all/modules/facebook_status/includes/views/facebook_status.views_default.inc --- sites/all/modules/facebook_status/includes/views/facebook_status.views_default.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,1095 +0,0 @@ -name = 'facebook_status'; - $view->description = 'Facebook-style Statuses Profile'; - $view->tag = 'facebook_status'; - $view->view_php = ''; - $view->base_table = 'users'; - $view->is_cacheable = FALSE; - $view->api_version = 2; - $view->disabled = FALSE; - $handler = $view->new_display('default', 'Statuses', 'default'); - $handler->override_option('fields', array( - 'edit' => array( - 'label' => '', - 'alter' => array( - 'alter_text' => 0, - 'text' => '', - 'make_link' => 0, - 'path' => '', - 'link_class' => '', - 'alt' => '', - 'prefix' => '', - 'suffix' => '', - 'help' => '', - 'trim' => 0, - 'max_length' => '', - 'word_boundary' => 1, - 'ellipsis' => 1, - 'strip_tags' => 0, - 'html' => 0, - ), - 'exclude' => 1, - 'id' => 'edit', - 'table' => 'facebook_status', - 'field' => 'edit', - 'relationship' => 'none', - ), - 'delete' => array( - 'label' => '', - 'alter' => array( - 'alter_text' => 0, - 'text' => '', - 'make_link' => 0, - 'path' => '', - 'link_class' => '', - 'alt' => '', - 'prefix' => '', - 'suffix' => '', - 'help' => '', - 'trim' => 0, - 'max_length' => '', - 'word_boundary' => 1, - 'ellipsis' => 1, - 'strip_tags' => 0, - 'html' => 0, - ), - 'exclude' => 1, - 'id' => 'delete', - 'table' => 'facebook_status', - 'field' => 'delete', - 'relationship' => 'none', - ), - 'respond' => array( - 'label' => '', - 'alter' => array( - 'alter_text' => 0, - 'text' => '', - 'make_link' => 0, - 'path' => '', - 'alt' => '', - 'prefix' => '', - 'suffix' => '', - 'help' => '', - 'trim' => 0, - 'max_length' => '', - 'word_boundary' => 1, - 'ellipsis' => 1, - 'strip_tags' => 0, - 'html' => 0, - ), - 'exclude' => 1, - 'id' => 'respond', - 'table' => 'facebook_status', - 'field' => 'respond', - 'relationship' => 'none', - ), - 'pid_extra' => array( - 'label' => '', - 'alter' => array( - 'alter_text' => 0, - 'text' => '', - 'make_link' => 0, - 'path' => '', - 'alt' => '', - 'prefix' => '', - 'suffix' => '', - 'help' => '', - 'trim' => 0, - 'max_length' => '', - 'word_boundary' => 1, - 'ellipsis' => 1, - 'strip_tags' => 0, - 'html' => 0, - ), - 'exclude' => 1, - 'id' => 'pid_extra', - 'table' => 'facebook_status', - 'field' => 'pid_extra', - 'relationship' => 'none', - ), - 'status' => array( - 'label' => '', - 'alter' => array( - 'alter_text' => 0, - 'text' => '', - 'make_link' => 0, - 'path' => '', - 'alt' => '', - 'prefix' => '', - 'suffix' => '', - 'help' => '', - 'trim' => 0, - 'max_length' => '', - 'word_boundary' => 1, - 'ellipsis' => 1, - 'strip_tags' => 0, - 'html' => 0, - ), - 'exclude' => 1, - 'id' => 'status', - 'table' => 'facebook_status', - 'field' => 'status', - 'relationship' => 'none', - 'override' => array( - 'button' => 'Override', - ), - ), - 'status_time' => array( - 'label' => '', - 'alter' => array( - 'alter_text' => 1, - 'text' => '[pid_extra] [status] [status_time] [edit] [delete] [respond]', - 'make_link' => 0, - 'path' => '', - 'link_class' => '', - 'alt' => '', - 'prefix' => '', - 'suffix' => '', - 'help' => '', - 'trim' => 0, - 'max_length' => '', - 'word_boundary' => 1, - 'ellipsis' => 1, - 'strip_tags' => 0, - 'html' => 0, - ), - 'date_format' => 'time ago', - 'custom_date_format' => '1', - 'exclude' => 0, - 'id' => 'status_time', - 'table' => 'facebook_status', - 'field' => 'status_time', - 'relationship' => 'none', - 'override' => array( - 'button' => 'Override', - ), - ), - )); - $handler->override_option('sorts', array( - 'status_time' => array( - 'order' => 'DESC', - 'id' => 'status_time', - 'table' => 'facebook_status', - 'field' => 'status_time', - 'relationship' => 'none', - ), - 'sid' => array( - 'order' => 'DESC', - 'id' => 'sid', - 'table' => 'facebook_status', - 'field' => 'sid', - 'relationship' => 'none', - ), - )); - $handler->override_option('arguments', array( - 'name' => array( - 'default_action' => 'not found', - 'style_plugin' => 'default_summary', - 'style_options' => array(), - 'wildcard' => 'all', - 'wildcard_substitution' => 'All', - 'title' => '%1\'s Statuses', - 'breadcrumb' => '', - 'default_argument_type' => 'fixed', - 'default_argument' => '', - 'validate_type' => 'php', - 'validate_fail' => 'not found', - 'glossary' => 0, - 'limit' => '0', - 'case' => 'none', - 'path_case' => 'none', - 'transform_dash' => 0, - 'id' => 'name', - 'table' => 'users', - 'field' => 'name', - 'validate_user_argument_type' => 'uid', - 'validate_user_roles' => array( - '2' => 0, - '3' => 0, - '4' => 0, - ), - 'relationship' => 'none', - 'default_options_div_prefix' => '', - 'default_argument_user' => 0, - 'default_argument_fixed' => '', - 'default_argument_php' => '', - 'validate_argument_node_type' => array( - 'page' => 0, - ), - 'validate_argument_node_access' => 0, - 'validate_argument_nid_type' => 'nid', - 'validate_argument_vocabulary' => array( - '1' => 0, - '2' => 0, - ), - 'validate_argument_type' => 'tid', - 'validate_argument_transform' => 0, - 'validate_user_restrict_roles' => 0, - 'validate_argument_node_flag_name' => '*relationship*', - 'validate_argument_node_flag_test' => 'flaggable', - 'validate_argument_node_flag_id_type' => 'id', - 'validate_argument_user_flag_name' => '*relationship*', - 'validate_argument_user_flag_test' => 'flaggable', - 'validate_argument_user_flag_id_type' => 'id', - 'validate_argument_php' => ' //If this view is overridden and then FBSS is disabled, it can - //cause a WSOD if these lines are not included here. - if (!function_exists(\'_facebook_status_user_load\')) { - return; - } - - $return = FALSE; - $account = _facebook_status_user_load($argument); - if ($account->uid) { - $handler->argument = $account->name; - $uid = TRUE; - } - $account2 = _facebook_status_user_load_by_name($argument); - if ($account2->uid) { - $handler->argument = $account2->name; - $name = TRUE; - } - if ($name && $uid) { - $handler->argument = $account->name; - $return = TRUE; - } - else if ($name || $uid) { - $return = TRUE; - if ($name) { - $account = $account2; - } - } - return $return && user_access(\'edit own status\', $account) && !_facebook_status_exclude($account);', - ), - )); - $handler->override_option('filters', array( - 'status' => array( - 'operator' => '!=', - 'value' => '', - 'group' => '0', - 'exposed' => FALSE, - 'expose' => array( - 'operator' => FALSE, - 'label' => '', - ), - 'case' => 1, - 'id' => 'status', - 'table' => 'facebook_status', - 'field' => 'status', - 'relationship' => 'none', - ), - 'pid_extra_3' => array( - 'operator' => '=', - 'value' => '0', - 'group' => '0', - 'exposed' => FALSE, - 'expose' => array( - 'operator' => FALSE, - 'label' => '', - ), - 'id' => 'pid_extra_3', - 'table' => 'facebook_status', - 'field' => 'pid_extra_3', - 'relationship' => 'none', - ), - )); - $handler->override_option('access', array( - 'type' => 'perm', - 'perm' => 'view all statuses', - )); - $handler->override_option('cache', array( - 'type' => 'none', - )); - $handler->override_option('title', 'Statuses'); - if (module_exists('php')) { - $handler->override_option('empty', 'uid) { - echo t(\'This user has no statuses yet.\'); - return; - } - $count = facebook_status_has_status(arg(1)); - if (!$count) { - global $user; - if ($user->uid == $account->uid) { - echo t(\'You have no statuses yet.\'); - } - else { - echo t(\'!name has no statuses yet.\', array(\'!name\' => theme(\'username\', $account))); - } - } - ?>'); - $handler->override_option('empty_format', '3'); - } - $handler->override_option('use_ajax', TRUE); - $handler->override_option('use_pager', '1'); - $handler->override_option('use_more', 1); - $handler->override_option('distinct', 0); - $handler->override_option('style_plugin', 'table'); - $handler->override_option('style_options', array( - 'grouping' => '', - 'override' => 1, - 'sticky' => 1, - 'order' => 'desc', - 'columns' => array( - 'name' => 'name', - 'uid' => 'uid', - 'status' => 'status', - ), - 'info' => array( - 'name' => array( - 'sortable' => 0, - 'separator' => '', - ), - 'uid' => array( - 'sortable' => 0, - 'separator' => '', - ), - 'status' => array( - 'sortable' => 0, - 'separator' => '', - ), - ), - 'default' => '-1', - )); - $handler = $view->new_display('page', 'Page', 'page_1'); - $handler->override_option('path', 'user/%/status'); - $handler->override_option('menu', array( - 'type' => 'tab', - 'title' => 'Statuses', - 'description' => '', - 'weight' => '0', - 'name' => 'navigation', - )); - $handler->override_option('tab_options', array( - 'type' => 'none', - 'title' => '', - 'description' => '', - 'weight' => 0, - )); - $handler = $view->new_display('block', 'Block', 'block_1'); - $handler->override_option('block_description', 'Facebook-style Statuses Profile'); - $handler->override_option('block_caching', -1); - $views[$view->name] = $view; - - $view = new view; - $view->name = 'facebook_status_recent'; - $view->description = 'Facebook-style Statuses Recent Status Updates'; - $view->tag = 'facebook_status'; - $view->view_php = ''; - $view->base_table = 'facebook_status'; - $view->is_cacheable = FALSE; - $view->api_version = 2; - $view->disabled = FALSE; - $handler = $view->new_display('default', 'Latest Status', 'default'); - $handler->override_option('fields', array( - 'edit' => array( - 'label' => '', - 'alter' => array( - 'alter_text' => 0, - 'text' => '', - 'make_link' => 0, - 'path' => '', - 'link_class' => '', - 'alt' => '', - 'prefix' => '', - 'suffix' => '', - 'help' => '', - 'trim' => 0, - 'max_length' => '', - 'word_boundary' => 1, - 'ellipsis' => 1, - 'strip_tags' => 0, - 'html' => 0, - ), - 'exclude' => 1, - 'id' => 'edit', - 'table' => 'facebook_status', - 'field' => 'edit', - 'relationship' => 'none', - ), - 'delete' => array( - 'label' => '', - 'alter' => array( - 'alter_text' => 0, - 'text' => '', - 'make_link' => 0, - 'path' => '', - 'link_class' => '', - 'alt' => '', - 'prefix' => '', - 'suffix' => '', - 'help' => '', - 'trim' => 0, - 'max_length' => '', - 'word_boundary' => 1, - 'ellipsis' => 1, - 'strip_tags' => 0, - 'html' => 0, - ), - 'exclude' => 1, - 'id' => 'delete', - 'table' => 'facebook_status', - 'field' => 'delete', - 'relationship' => 'none', - ), - 'respond' => array( - 'label' => '', - 'alter' => array( - 'alter_text' => 0, - 'text' => '', - 'make_link' => 0, - 'path' => '', - 'alt' => '', - 'prefix' => '', - 'suffix' => '', - 'help' => '', - 'trim' => 0, - 'max_length' => '', - 'word_boundary' => 1, - 'ellipsis' => 1, - 'strip_tags' => 0, - 'html' => 0, - ), - 'exclude' => 1, - 'id' => 'respond', - 'table' => 'facebook_status', - 'field' => 'respond', - 'relationship' => 'none', - ), - 'pid_extra' => array( - 'label' => '', - 'alter' => array( - 'alter_text' => 0, - 'text' => '', - 'make_link' => 0, - 'path' => '', - 'alt' => '', - 'prefix' => '', - 'suffix' => '', - 'help' => '', - 'trim' => 0, - 'max_length' => '', - 'word_boundary' => 1, - 'ellipsis' => 1, - 'strip_tags' => 0, - 'html' => 0, - ), - 'exclude' => 1, - 'id' => 'pid_extra', - 'table' => 'facebook_status', - 'field' => 'pid_extra', - 'relationship' => 'none', - ), - 'status' => array( - 'label' => '', - 'alter' => array( - 'alter_text' => 0, - 'text' => '', - 'make_link' => 0, - 'path' => '', - 'alt' => '', - 'prefix' => '', - 'suffix' => '', - 'help' => '', - 'trim' => 0, - 'max_length' => '', - 'word_boundary' => 1, - 'ellipsis' => 1, - 'strip_tags' => 0, - 'html' => 0, - ), - 'exclude' => 1, - 'id' => 'status', - 'table' => 'facebook_status', - 'field' => 'status', - 'relationship' => 'none', - ), - 'status_time' => array( - 'label' => '', - 'alter' => array( - 'alter_text' => 1, - 'text' => '[pid_extra] [status] [status_time] [edit] [delete] [respond]', - 'make_link' => 0, - 'path' => '', - 'link_class' => '', - 'alt' => '', - 'prefix' => '', - 'suffix' => '', - 'help' => '', - 'trim' => 0, - 'max_length' => '', - 'word_boundary' => 1, - 'ellipsis' => 1, - 'strip_tags' => 0, - 'html' => 0, - ), - 'date_format' => 'time ago', - 'custom_date_format' => '1', - 'exclude' => 0, - 'id' => 'status_time', - 'table' => 'facebook_status', - 'field' => 'status_time', - 'relationship' => 'none', - ), - )); - $handler->override_option('sorts', array( - 'status_time' => array( - 'order' => 'DESC', - 'id' => 'status_time', - 'table' => 'facebook_status', - 'field' => 'status_time', - 'relationship' => 'none', - ), - 'sid' => array( - 'order' => 'DESC', - 'id' => 'sid', - 'table' => 'facebook_status', - 'field' => 'sid', - 'relationship' => 'none', - ), - )); - $handler->override_option('filters', array( - 'sid_extra' => array( - 'operator' => '=', - 'value' => '0', - 'group' => '0', - 'exposed' => FALSE, - 'expose' => array( - 'operator' => FALSE, - 'label' => '', - ), - 'id' => 'sid_extra', - 'table' => 'facebook_status', - 'field' => 'sid_extra', - 'relationship' => 'none', - ), - 'pid_extra_3' => array( - 'operator' => '=', - 'value' => '0', - 'group' => '0', - 'exposed' => FALSE, - 'expose' => array( - 'operator' => FALSE, - 'label' => '', - ), - 'id' => 'pid_extra_3', - 'table' => 'facebook_status', - 'field' => 'pid_extra_3', - 'relationship' => 'none', - ), - 'status' => array( - 'operator' => '!=', - 'value' => '', - 'group' => '0', - 'exposed' => FALSE, - 'expose' => array( - 'operator' => FALSE, - 'label' => '', - ), - 'case' => 1, - 'id' => 'status', - 'table' => 'facebook_status', - 'field' => 'status', - 'relationship' => 'none', - ), - )); - $handler->override_option('access', array( - 'type' => 'perm', - 'perm' => 'view all statuses', - )); - $handler->override_option('cache', array( - 'type' => 'none', - )); - $handler->override_option('title', 'Latest Status Updates'); - $handler->override_option('use_ajax', TRUE); - $handler->override_option('items_per_page', 15); - $handler->override_option('use_pager', '1'); - $handler->override_option('use_more', 1); - $handler->override_option('style_plugin', 'table'); - $handler->override_option('style_options', array( - 'grouping' => '', - 'override' => 1, - 'sticky' => 0, - 'order' => 'asc', - 'columns' => array( - 'name' => 'name', - 'status' => 'status', - 'status_time' => 'status_time', - ), - 'info' => array( - 'name' => array( - 'sortable' => 0, - 'separator' => '', - ), - 'status' => array( - 'sortable' => 0, - 'separator' => '', - ), - 'status_time' => array( - 'sortable' => 0, - 'separator' => '', - ), - ), - 'default' => '-1', - )); - $handler = $view->new_display('page', 'Page', 'page_1'); - $handler->override_option('path', 'statuses/recent'); - $handler->override_option('menu', array( - 'type' => 'default tab', - 'title' => 'Latest Status Updates', - 'description' => '', - 'weight' => '0', - 'name' => 'navigation', - )); - $handler->override_option('tab_options', array( - 'type' => 'normal', - 'title' => 'Latest Status Updates', - 'description' => '', - 'weight' => '0', - )); - $handler = $view->new_display('block', 'Block', 'block_1'); - $handler->override_option('block_description', 'Facebook-style Statuses Latest Status Updates'); - $handler->override_option('block_caching', -1); - $handler = $view->new_display('feed', 'Feed', 'feed_1'); - $handler->override_option('style_plugin', 'rss'); - $handler->override_option('style_options', array( - 'mission_description' => FALSE, - 'description' => '', - )); - $handler->override_option('row_plugin', 'facebook_status_rss'); - $handler->override_option('path', 'statuses/recent/feed'); - $handler->override_option('menu', array( - 'type' => 'none', - 'title' => '', - 'description' => '', - 'weight' => 0, - 'name' => 'navigation', - )); - $handler->override_option('tab_options', array( - 'type' => 'none', - 'title' => '', - 'description' => '', - 'weight' => 0, - 'name' => 'navigation', - )); - $handler->override_option('displays', array( - 'page_1' => 'page_1', - 'default' => 0, - 'block_1' => 0, - )); - $handler->override_option('sitename_title', FALSE); - $views[$view->name] = $view; - - $view = new view; - $view->name = 'facebook_status_cross_post'; - $view->description = 'Facebook-style Statuses Conversations'; - $view->tag = 'facebook_status'; - $view->view_php = ''; - $view->base_table = 'facebook_status'; - $view->is_cacheable = FALSE; - $view->api_version = 2; - $view->disabled = FALSE; - $handler = $view->new_display('default', 'Conversation', 'default'); - $handler->override_option('fields', array( - 'pid_name' => array( - 'label' => '', - 'alter' => array( - 'alter_text' => 0, - 'text' => '', - 'make_link' => 0, - 'path' => '', - 'alt' => '', - 'prefix' => '', - 'suffix' => '', - 'help' => '', - 'trim' => 0, - 'max_length' => '', - 'word_boundary' => 1, - 'ellipsis' => 1, - 'strip_tags' => 0, - 'html' => 0, - ), - 'link_to_user' => 1, - 'exclude' => 1, - 'id' => 'pid_name', - 'table' => 'facebook_status', - 'field' => 'pid_name', - 'relationship' => 'none', - ), - 'status' => array( - 'label' => '', - 'alter' => array( - 'alter_text' => 0, - 'text' => '', - 'make_link' => 0, - 'path' => '', - 'alt' => '', - 'prefix' => '', - 'suffix' => '', - 'help' => '', - 'trim' => 0, - 'max_length' => '', - 'word_boundary' => 1, - 'ellipsis' => 1, - 'strip_tags' => 0, - 'html' => 0, - ), - 'exclude' => 1, - 'id' => 'status', - 'table' => 'facebook_status', - 'field' => 'status', - 'relationship' => 'none', - ), - 'edit' => array( - 'label' => '', - 'alter' => array( - 'alter_text' => 0, - 'text' => '', - 'make_link' => 0, - 'path' => '', - 'link_class' => '', - 'alt' => '', - 'prefix' => '', - 'suffix' => '', - 'help' => '', - 'trim' => 0, - 'max_length' => '', - 'word_boundary' => 1, - 'ellipsis' => 1, - 'strip_tags' => 0, - 'html' => 0, - ), - 'exclude' => 1, - 'id' => 'edit', - 'table' => 'facebook_status', - 'field' => 'edit', - 'relationship' => 'none', - ), - 'delete' => array( - 'label' => '', - 'alter' => array( - 'alter_text' => 0, - 'text' => '', - 'make_link' => 0, - 'path' => '', - 'link_class' => '', - 'alt' => '', - 'prefix' => '', - 'suffix' => '', - 'help' => '', - 'trim' => 0, - 'max_length' => '', - 'word_boundary' => 1, - 'ellipsis' => 1, - 'strip_tags' => 0, - 'html' => 0, - ), - 'exclude' => 1, - 'id' => 'delete', - 'table' => 'facebook_status', - 'field' => 'delete', - 'relationship' => 'none', - ), - 'status_time' => array( - 'label' => '', - 'alter' => array( - 'alter_text' => 1, - 'text' => '[pid_name] [status] [status_time] [edit] [delete]', - 'make_link' => 0, - 'path' => '', - 'alt' => '', - 'prefix' => '', - 'suffix' => '', - 'help' => '', - 'trim' => 0, - 'max_length' => '', - 'word_boundary' => 1, - 'ellipsis' => 1, - 'strip_tags' => 0, - 'html' => 0, - ), - 'date_format' => 'time ago', - 'custom_date_format' => '1', - 'exclude' => 0, - 'id' => 'status_time', - 'table' => 'facebook_status', - 'field' => 'status_time', - 'relationship' => 'none', - ), - )); - $handler->override_option('sorts', array( - 'status_time' => array( - 'order' => 'DESC', - 'id' => 'status_time', - 'table' => 'facebook_status', - 'field' => 'status_time', - 'relationship' => 'none', - ), - 'sid' => array( - 'order' => 'DESC', - 'id' => 'sid', - 'table' => 'facebook_status', - 'field' => 'sid', - 'relationship' => 'none', - ), - )); - $handler->override_option('arguments', array( - 'uid' => array( - 'default_action' => 'not found', - 'style_plugin' => 'default_summary', - 'style_options' => array(), - 'wildcard' => 'all', - 'wildcard_substitution' => 'All', - 'title' => 'Conversation', - 'default_argument_type' => 'fixed', - 'default_argument' => '', - 'validate_type' => 'php', - 'validate_fail' => 'not found', - 'break_phrase' => 1, - 'not' => 0, - 'id' => 'uid', - 'table' => 'facebook_status', - 'field' => 'uid', - 'validate_user_argument_type' => 'uid', - 'validate_user_roles' => array( - '2' => 0, - '3' => 0, - '4' => 0, - ), - 'relationship' => 'none', - 'default_options_div_prefix' => '', - 'default_argument_user' => 0, - 'default_argument_fixed' => '', - 'default_argument_php' => '', - 'validate_argument_node_type' => array( - 'page' => 0, - ), - 'validate_argument_node_access' => 0, - 'validate_argument_nid_type' => 'nid', - 'validate_argument_vocabulary' => array( - '1' => 0, - '2' => 0, - ), - 'validate_argument_type' => 'tid', - 'validate_argument_transform' => 0, - 'validate_user_restrict_roles' => 0, - 'validate_argument_node_flag_name' => '*relationship*', - 'validate_argument_node_flag_test' => 'flaggable', - 'validate_argument_node_flag_id_type' => 'id', - 'validate_argument_user_flag_name' => '*relationship*', - 'validate_argument_user_flag_test' => 'flaggable', - 'validate_argument_user_flag_id_type' => 'id', - 'validate_argument_php' => ' //If this view is overridden and then FBSS is disabled, it can - //cause a WSOD if these lines are not included here. - if (!function_exists(\'_facebook_status_user_load\')) { - return; - } - - $names = explode(\',\', $argument); - $uids = array(); - foreach ($names as $name) { - if (!is_numeric($name)) { - $account = _facebook_status_user_load_by_name($name); - } - else { - $account = _facebook_status_user_load($name); - } - if ($account->uid) { - $uids[] = $account->uid; - } - } - if (!empty($uids)) { - global $user; - if (count($uids) === 1 && $uids[0] != $user->uid) { - $uids[1] = $user->uid; - } - $handler->argument = implode(\',\', $uids); - return TRUE; - } - return FALSE;', - ), - 'pid' => array( - 'default_action' => 'default', - 'style_plugin' => 'default_summary', - 'style_options' => array(), - 'wildcard' => 'all', - 'wildcard_substitution' => 'All', - 'title' => 'Conversation', - 'default_argument_type' => 'php', - 'default_argument' => '', - 'validate_type' => 'php', - 'validate_fail' => 'not found', - 'break_phrase' => 1, - 'not' => 0, - 'id' => 'pid', - 'table' => 'facebook_status', - 'field' => 'pid', - 'validate_user_argument_type' => 'uid', - 'validate_user_roles' => array( - '2' => 0, - '3' => 0, - '4' => 0, - ), - 'relationship' => 'none', - 'default_options_div_prefix' => '', - 'default_argument_user' => 0, - 'default_argument_fixed' => '', - 'default_argument_php' => '$arg = arg(2); - $values = explode(\',\', $arg); - global $user; - if (count($values) === 1 && $values[0] != $user->uid && $values[0] != $user->name) { - if (is_numeric($values[0])) { - return $arg .\',\'. $user->uid; - } - else { - return $arg .\',\'. $user->name; - } - } - return $arg;', - 'validate_argument_node_type' => array( - 'page' => 0, - ), - 'validate_argument_node_access' => 0, - 'validate_argument_nid_type' => 'nid', - 'validate_argument_vocabulary' => array( - '1' => 0, - '2' => 0, - ), - 'validate_argument_type' => 'tid', - 'validate_argument_transform' => 0, - 'validate_user_restrict_roles' => 0, - 'validate_argument_node_flag_name' => '*relationship*', - 'validate_argument_node_flag_test' => 'flaggable', - 'validate_argument_node_flag_id_type' => 'id', - 'validate_argument_user_flag_name' => '*relationship*', - 'validate_argument_user_flag_test' => 'flaggable', - 'validate_argument_user_flag_id_type' => 'id', - 'validate_argument_php' => ' //If this view is overridden and then FBSS is disabled, it can - //cause a WSOD if these lines are not included here. - if (!function_exists(\'_facebook_status_user_load\')) { - return; - } - - $names = explode(\',\', $argument); - $uids = array(); - foreach ($names as $name) { - if (!is_numeric($name)) { - $account = _facebook_status_user_load_by_name($name); - } - else { - $account = _facebook_status_user_load($name); - } - if ($account->uid) { - $uids[] = $account->uid; - } - } - if (!empty($uids)) { - $handler->argument = implode(\',\', $uids); - return TRUE; - } - return FALSE;', - ), - )); - $handler->override_option('filters', array( - 'pid_extra_2' => array( - 'operator' => '=', - 'value' => '1', - 'group' => '0', - 'exposed' => FALSE, - 'expose' => array( - 'operator' => FALSE, - 'label' => '', - ), - 'id' => 'pid_extra_2', - 'table' => 'facebook_status', - 'field' => 'pid_extra_2', - 'relationship' => 'none', - ), - )); - $handler->override_option('access', array( - 'type' => 'perm', - 'perm' => 'view all statuses', - )); - $handler->override_option('title', 'Conversation'); - $handler->override_option('empty_format', '1'); - $handler->override_option('use_ajax', TRUE); - $handler->override_option('use_pager', 'mini'); - $handler->override_option('use_more', 1); - $handler->override_option('style_plugin', 'table'); - $handler->override_option('style_options', array( - 'grouping' => '', - 'override' => 1, - 'sticky' => 0, - 'order' => 'asc', - 'columns' => array( - 'name' => 'name', - 'status' => 'status', - 'status_time' => 'status_time', - ), - 'info' => array( - 'name' => array( - 'sortable' => 0, - 'separator' => '', - ), - 'status' => array( - 'sortable' => 0, - 'separator' => '', - ), - 'status_time' => array( - 'sortable' => 0, - 'separator' => '', - ), - ), - 'default' => '-1', - )); - $handler = $view->new_display('page', 'Page', 'page_1'); - $handler->override_option('path', 'statuses/conversations'); - $handler->override_option('menu', array( - 'type' => 'none', - 'title' => '', - 'description' => '', - 'weight' => 0, - 'name' => 'navigation', - )); - $handler->override_option('tab_options', array( - 'type' => 'none', - 'title' => '', - 'description' => '', - 'weight' => 0, - )); - $views[$view->name] = $view; - - return $views; -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_argument_flagged_user.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_argument_flagged_user.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_argument_flagged_user.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_argument_flagged_user.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,48 +0,0 @@ -fid : NULL; - $options['facebook_status_flag_type'] = array( - 'default' => $default, - 'translatable' => FALSE, - ); - return $options; - } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); - $flags = flag_get_flags('user'); - $options = array(); - foreach ($flags as $flag) { - $options[$flag->fid] = $flag->get_title(); - } - $form['warning'] = array( - '#value' => t('Warning: this argument can be slow.'), - '#weight' => -100, - ); - $form['facebook_status_flag_type'] = array( - '#type' => 'radios', - '#title' => t('Flag'), - '#options' => $options, - '#default_value' => $this->options['facebook_status_flag_type'], - '#required' => TRUE, - ); - } - function query() { - $argument = $this->argument; - $field = "$this->table.$this->real_field"; - $query = db_prefix_tables("$field IN (SELECT content_id FROM {flag_content} WHERE fid = %d AND uid = %d) OR $field = %d"); - $this->query->add_where(0, $query, $this->options['facebook_status_flag_type'], $argument, $argument); - } -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_created.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_created.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_created.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_created.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,57 +0,0 @@ - 'themed'); - return $options; - } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); - $form['date_format']['#options']['themed'] = t('Themed (changes based on recency)'); - $form['date_format']['#default_value'] = isset($this->options['date_format']) ? $this->options['date_format'] : 'themed'; - } - function render($values) { - $value = $values->{$this->field_alias}; - $format = $this->options['date_format']; - $custom_format = ''; - if (in_array($format, array('custom', 'raw time ago', 'time ago', 'raw time span', 'time span'))) { - $custom_format = $this->options['custom_date_format']; - } - if (!$value) { - return theme('views_nodate'); - } - else { - $time_diff = time() - $value; // will be positive for a datetime in the past (ago), and negative for a datetime in the future (hence) - switch ($format) { - case 'raw time ago': - return format_interval($time_diff, is_numeric($custom_format) ? $custom_format : 2); - case 'time ago': - return t('%time ago', array('%time' => format_interval($time_diff, is_numeric($custom_format) ? $custom_format : 2))); - case 'raw time span': - return ($time_diff < 0 ? '-' : '') . format_interval(abs($time_diff), is_numeric($custom_format) ? $custom_format : 2); - case 'time span': - $args = array('%time' => format_interval(abs($time_diff), is_numeric($custom_format) ? $custom_format : 2)); - if ($time_diff < 0) { - return t('%time hence', $args); - } - return t('%time ago', $args); - case 'custom': - return format_date($value, $format, $custom_format); - case 'themed': - return theme('facebook_status_time', $value); - default: - return format_date($value, $format); - } - } - } -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_cross.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_cross.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_cross.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_cross.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,30 +0,0 @@ -additional_fields['uid'] = 'uid'; - } - function render($values) { - $uid = $values->{$this->aliases['uid']}; - $pid = $values->{$this->field_alias}; - if (isset($uid) && $pid == $uid) { - return theme('username', _facebook_status_user_load($uid)); - } - else { - $args = array('!poster' => theme('username', _facebook_status_user_load($pid)), - '!owner' => theme('username', _facebook_status_user_load($uid))); - return t('!poster » !owner', $args); - } - } -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_cross_pic.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_cross_pic.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_cross_pic.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_cross_pic.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,70 +0,0 @@ - variable_get('user_picture_imagecache_profiles_default', ''), - 'translatable' => FALSE, - ); - } - return $options; - } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); - if (module_exists('imagecache_profiles')) { - $presets = imagecache_presets(); - $opt = array('' => ''); - foreach ($presets as $preset) { - $opt[$preset['presetname']] = check_plain($preset['presetname']); - } - $options = $this->options; - $form['imagecache_preset'] = array( - '#title' => t('Imagecache preset'), - '#type' => 'select', - '#options' => $opt, - '#default_value' => $options['imagecache_preset'], - ); - } - } - function construct() { - parent::construct(); - $this->additional_fields['uid'] = 'uid'; - } - function render($values) { - $uid = $values->{$this->aliases['uid']}; - $pid = $values->{$this->field_alias}; - $options = $this->options; - if (isset($uid) && $pid == $uid) { - $account = _facebook_status_user_load($uid); - if (isset($options['imagecache_preset']) && $options['imagecache_preset']) { - $account->imagecache_preset = $options['imagecache_preset']; - } - return t('!picture !user', array('!picture' => facebook_status_display_user_picture($account), '!user' => theme('username', $account))); - } - else { - $poster = _facebook_status_user_load($pid); - $owner = _facebook_status_user_load($uid); - if (isset($options['imagecache_preset']) && $options['imagecache_preset']) { - $poster->imagecache_preset = $options['imagecache_preset']; - $owner->imagecache_preset = $options['imagecache_preset']; - } - $args = array('!poster' => theme('username', $poster), '!owner' => theme('username', $owner)); - $args['!poster-picture'] = facebook_status_display_user_picture($poster); - $args['!owner-picture'] = facebook_status_display_user_picture($owner); - return t('!poster-picture !poster » !owner-picture !owner', $args); - } - } -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_delete.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_delete.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_delete.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_delete.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,32 +0,0 @@ -additional_fields['uid'] = 'uid'; - $this->additional_fields['pid'] = 'pid'; - } - function render($values) { - $status = new stdClass(); - $status->uid = $values->{$this->aliases['uid']}; - $status->pid = $values->{$this->aliases['pid']}; - $status->sid = $values->{$this->field_alias}; - if (_facebook_status_can_edit($status, TRUE)) { - drupal_add_css(drupal_get_path('module', 'facebook_status') .'/facebook_status.css'); - $q = $_GET['q']; - if ($q == 'facebook_status/js') { - $q = 'user'; - } - return ''. l(t('Delete'), 'statuses/'. $status->sid .'/delete', array('query' => array('destination' => $q))) .''; - } - } -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_edit.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_edit.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_edit.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_edit.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,32 +0,0 @@ -additional_fields['uid'] = 'uid'; - $this->additional_fields['pid'] = 'pid'; - } - function render($values) { - $status = new stdClass(); - $status->uid = $values->{$this->aliases['uid']}; - $status->pid = $values->{$this->aliases['pid']}; - $status->sid = $values->{$this->field_alias}; - if (_facebook_status_can_edit($status)) { - drupal_add_css(drupal_get_path('module', 'facebook_status') .'/facebook_status.css'); - $q = $_GET['q']; - if ($q == 'facebook_status/js') { - $q = 'user'; - } - return ''. l(t('Edit'), 'statuses/'. $status->sid .'/edit', array('query' => array('destination' => $q))) .''; - } - } -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_poster.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_poster.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_poster.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_poster.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,20 +0,0 @@ -{$this->field_alias}); - if (!empty($this->options['link_to_user'])) { - return theme('username', $account); - } - return check_plain($account->name); - } -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_poster_pic.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_poster_pic.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_poster_pic.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_poster_pic.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,48 +0,0 @@ - variable_get('user_picture_imagecache_profiles_default', ''), - 'translatable' => FALSE, - ); - } - return $options; - } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); - if (module_exists('imagecache_profiles')) { - $presets = imagecache_presets(); - $opt = array('' => ''); - foreach ($presets as $preset) { - $opt[$preset['presetname']] = check_plain($preset['presetname']); - } - $options = $this->options; - $form['imagecache_preset'] = array( - '#title' => t('Imagecache preset'), - '#type' => 'select', - '#options' => $opt, - '#default_value' => $options['imagecache_preset'], - ); - } - } - function render($values) { - $account = _facebook_status_user_load($values->{$this->field_alias}); - $options = $this->options; - if (isset($options['imagecache_preset']) && $options['imagecache_preset']) { - $account->imagecache_preset = $options['imagecache_preset']; - } - return facebook_status_display_user_picture($account); - } -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_poster_pic_activity.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_poster_pic_activity.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_poster_pic_activity.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_poster_pic_activity.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,64 +0,0 @@ -additional_fields['eid'] = array('table' => 'activity', 'field' => 'eid'); - $this->additional_fields['type'] = array('table' => 'activity', 'field' => 'type'); - } - function option_definition() { - $options = parent::option_definition(); - if (module_exists('imagecache_profiles')) { - $options['imagecache_preset'] = array( - 'default' => variable_get('user_picture_imagecache_profiles_default', ''), - 'translatable' => FALSE, - ); - } - return $options; - } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); - if (module_exists('imagecache_profiles')) { - $presets = imagecache_presets(); - $opt = array('' => ''); - foreach ($presets as $preset) { - $opt[$preset['presetname']] = check_plain($preset['presetname']); - } - $options = $this->options; - $form['imagecache_preset'] = array( - '#title' => t('Imagecache preset'), - '#type' => 'select', - '#options' => $opt, - '#default_value' => $options['imagecache_preset'], - ); - } - } - function query() { - $this->ensure_my_table(); - $this->add_additional_fields(); - } - function render($values) { - if ($values->{$this->aliases['type']} == 'facebook_status') { - $sid = $values->{$this->aliases['eid']}; - $status = facebook_status_load($sid); - $account = _facebook_status_user_load($status->pid); - } - else { - $account = _facebook_status_user_load($values->{$this->field_alias}); - } - $options = $this->options; - if (isset($options['imagecache_preset']) && $options['imagecache_preset']) { - $account->imagecache_preset = $options['imagecache_preset']; - } - return facebook_status_display_user_picture($account); - } -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_repost.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_repost.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_repost.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_repost.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,44 +0,0 @@ -additional_fields['pid'] = 'pid'; - } - function option_definition() { - $options = parent::option_definition(); - $options['repost_text'] = array( - 'default' => t('Share'), - 'translatable' => TRUE, - ); - return $options; - } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); - $form['repost_text'] = array( - '#title' => t('Re-post text'), - '#type' => 'textfield', - '#description' => t('The text that will display for the "Re-post this" link.'), - '#default_value' => $this->options['repost_text'], - ); - } - function render($values) { - if ((user_access('edit own status') || user_access('edit all statuses')) && $values->{$this->aliases['pid']} != $GLOBALS['user']->uid) { - drupal_add_css(drupal_get_path('module', 'facebook_status') .'/facebook_status.css'); - $options = array( - 'attributes' => array('class' => 'facebook_status_conversation_link'), - 'query' => array('sid' => $values->{$this->field_alias}, 'destination' => $_GET['q']) - ); - return l($this->options['repost_text'], 'share-status', $options); - } - } -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_respond.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_respond.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_respond.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_respond.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,51 +0,0 @@ -additional_fields['uid'] = 'uid'; - $this->additional_fields['sid'] = 'sid'; - } - function render($values) { - global $user; - $owner = _facebook_status_user_load($values->{$this->aliases['uid']}); - $poster = _facebook_status_user_load($values->{$this->field_alias}); - drupal_add_css(drupal_get_path('module', 'facebook_status') .'/facebook_status.css'); - $options = array('attributes' => array('class' => 'facebook_status_conversation_link')); - if ($owner->uid != $poster->uid && user_access('post on all profiles')) { - $title = t('View conversation'); - if ($owner->uid == $user->uid) { - $title = t('Reply'); - } - if (module_exists('realname')) { - return l($title, 'statuses/conversation/'. $poster->uid .','. $owner->uid, $options); - } - return l($title, 'statuses/conversation/'. check_plain($poster->name) .','. check_plain($owner->name), $options); - } - elseif ((user_access('edit own status') || user_access('edit all statuses')) && $owner->uid == $poster->uid && $poster->uid != $user->uid) { - $s = '@'. $poster->name .' '; - //Properly reference tags with word-break characters in them. - if (preg_match('/.+\b.+/', $poster->name)) { - $s = '[@'. $poster->name .'] '; - } - if (variable_get('facebook_status_reply_type', 'at') == 'at') { - //Evidently url() sanitizes query strings itself, so we don't have to use check_plain() here. - $options['query'] = array('s' => $s, 'rsid' => $values->{$this->aliases['sid']}, 'destination' => $_GET['q']); - return l(t('Respond'), 'share-status', $options); - } - if (module_exists('realname')) { - return l(t('Respond'), 'statuses/conversation/'. $poster->uid .','. $user->uid, $options); - } - return l(t('Respond'), 'statuses/conversation/'. check_plain($poster->name) .','. check_plain($user->name), $options); - } - } -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_status.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_status.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_status.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_field_status.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,30 +0,0 @@ -additional_fields['uid'] = 'uid'; - $this->additional_fields['pid'] = 'pid'; - $this->additional_fields['sid'] = 'sid'; - $this->additional_fields['status_time'] = 'status_time'; - } - function render($values) { - $status = new stdClass(); - $status->uid = $values->{$this->aliases['uid']}; - $status->pid = $values->{$this->aliases['pid']}; - $status->sid = $values->{$this->aliases['sid']}; - $status->status = $values->{$this->field_alias}; - $status->status_time = $values->{$this->aliases['status_time']}; - $components = facebook_status_item_components($status); - return $components['status']['#value']; - } -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,27 +0,0 @@ -definition['type'] = 'yes-no'; - $this->definition['label'] = t('Show Latest Status Update Only (per User)'); - $this->value_value = $this->definition['label']; - parent::construct(); - } - - function query() { - if ($this->value) { - $this->ensure_my_table(); - $subquery = "(SELECT MAX(sid) FROM {facebook_status} WHERE uid = pid GROUP BY uid)"; - $this->query->add_where(0, db_prefix_tables("$this->table_alias.sid IN $subquery")); - } - } -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter_flagged_user.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter_flagged_user.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter_flagged_user.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter_flagged_user.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,46 +0,0 @@ -fid : NULL; - $options['facebook_status_flag_type'] = array( - 'default' => $default, - 'translatable' => FALSE, - ); - return $options; - } - function options_form(&$form, &$form_state) { - $flags = flag_get_flags('user'); - $options = array(); - foreach ($flags as $flag) { - $options[$flag->fid] = $flag->get_title(); - } - $form['warning'] = array( - '#value' => t('Warning: this filter can be slow.'), - '#weight' => -100, - ); - $form['facebook_status_flag_type'] = array( - '#type' => 'radios', - '#title' => t('Flag'), - '#options' => $options, - '#default_value' => $this->options['facebook_status_flag_type'], - '#required' => TRUE, - ); - } - function query() { - $query = "({$this->table}.pid IN (SELECT content_id FROM {flag_content} WHERE fid = %d AND uid = %d) OR {$this->table}.pid = %d)"; - $query = db_prefix_tables($query); - $this->query->add_where($this->options['group'], $query, $this->options['facebook_status_flag_type'], $GLOBALS['user']->uid, $GLOBALS['user']->uid); - } -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter_not_own.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter_not_own.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter_not_own.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter_not_own.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,26 +0,0 @@ -definition['type'] = 'yes-no'; - $this->definition['label'] = t("Show only posts to other users"); - $this->value_value = $this->definition['label']; - parent::construct(); - } - - function query() { - if ($this->value) { - $this->ensure_my_table(); - $this->query->add_where(0, db_prefix_tables("$this->table_alias.uid <> $this->table_alias.pid")); - } - } -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter_own.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter_own.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter_own.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter_own.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,26 +0,0 @@ -definition['type'] = 'yes-no'; - $this->definition['label'] = t('Show only own statuses'); - $this->value_value = $this->definition['label']; - parent::construct(); - } - - function query() { - if ($this->value) { - $this->ensure_my_table(); - $this->query->add_where(0, db_prefix_tables("$this->table_alias.uid = $this->table_alias.pid")); - } - } -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter_string_type.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter_string_type.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter_string_type.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_handler_filter_string_type.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,23 +0,0 @@ -value_options)) { - $this->value_title = t('Tag type'); - $options = array('user' => t('Users')); - if (module_exists('taxonomy')) { - $options['term'] = t('Terms'); - } - $this->value_options = $options; - } - } -} \ No newline at end of file Index: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_plugin_row_rss.inc =================================================================== RCS file: sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_plugin_row_rss.inc diff -N sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_plugin_row_rss.inc --- sites/all/modules/facebook_status/includes/views/handlers/facebook_status_views_plugin_row_rss.inc 30 Nov 2010 07:20:45 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,61 +0,0 @@ -{$this->field_alias}; - if (!is_numeric($sid)) { - return; - } - - // Load the specified status: - $status = facebook_status_load($sid); - if (empty($status)) { - return; - } - $owner = _facebook_status_user_load($status->uid); - $poster = _facebook_status_user_load($status->pid); - - $item = new stdClass(); - $item->title = filter_xss($status->status); - $item->link = url("statuses/$status->sid", array('absolute' => TRUE)); - $item->sid = $status->sid; - $item->description = ''; - - $item->elements = array( - array('key' => 'pubDate', 'value' => gmdate('r', $status->status_time)), - array( - 'key' => 'dc:creator', - 'value' => check_plain($poster->name), - 'namespace' => array('xmlns:dc' => 'http://purl.org/dc/elements/1.1/'), - ), - array( - 'key' => 'guid', - 'value' => $status->sid . ' at ' . $base_url, - 'attributes' => array('isPermaLink' => 'false') - ), - ); - - foreach ($item->elements as $element) { - if (isset($element['namespace'])) { - $this->view->style_plugin->namespaces = array_merge($this->view->style_plugin->namespaces, $element['namespace']); - } - } - - return theme($this->theme_functions(), $this->view, $this->options, $item); - } -} \ No newline at end of file