Example:
User "Pepe" have created an event
I'm logged in with user "Juanito" and I go to see the event node for register on it. At Facebook Status Block now appears the status of user "Pepe", the user who created the event, rather than my own status(Juanito).

I'm using:
drupal-5.15
facebook_status-5.x-1.0-rc2
event-5.x-1.0
event_manager-5.x-1.0
event_manager_block-5.x-1.0

Sincerely
jesus4763.

Comments

icecreamyou’s picture

Title: Error in Facebook_status with Events » FBS block shows other user's status on nodes and profiles
Status: Active » Closed (works as designed)

It is the intended behavior of the module, as explicitly explained in the documentation, that the Facebook Status block follows these rules:

1. On user profiles, it displays the relevant user's status;
2. On nodes, it displays the node author's status;
3. Anywhere else, it displays the current user's status.

If you want the block to always show the current user's status, create a new block with the PHP input format and put this in it:

5.x:

global $user;
echo facebook_status_display_form($user->uid);

6.x:

global $user;
echo facebook_status_display_b(NULL, $user->uid);
barrett’s picture

I see that the solution given for 6.x does work, but I have no idea why it does. Putting the same code into a new block type defined inside the module results in the default handling (i.e., the user displayed varies by what you're viewing). Can someone enlighten me?

icecreamyou’s picture

It's not the same code that's in the module. It's intentionally different so it gives a different result.

In the 2.x branch admin can choose whether to enable this kind of behavior ("Legacy") or just have the block consistently display the current user's status like the code above does.

barrett’s picture

Yeah, I meant that it doesn't work even when I put that code into the module as a new block. For instance, in the code below I define the new block and set its view op to call facebook_status_display_b() passing the $user->uid as the id but I still get the default/"Legacy" behavior.

function facebook_status_block($op='list', $delta=0) {
  if ($op == "list") {
    $block[0]["info"] = t("Facebook Status");
    $block[1]["info"] = t("Facebook Status Recent Updates");
    $block[2]["info"] = t("Facebook Status User Update History");
    $block[3]["info"] = t("Facebook Status Individual User");
    if (module_exists('user_relationships')) {
      $block[4]["info"] = t("Facebook Status UR Recent Updates");
    }
    $block["current_user"]["info"] = t("Facebook Status Current User");  //using string key to avoid numeric key clashes and make code more self-documenting
    return $block;
  }
  else if ($op == 'view') {
    global $user;
    switch ($delta) {
    case 0:
    case 3:
      $block['subject'] = 'Status';
      $block['content'] = facebook_status_display_b(NULL, 0, $delta);
      break;
    case "current_user":
      $block['subject'] = 'Current User Status';
      $block['content'] = facebook_status_display_b(NULL, $user->uid);
      break;
    case 1:
      $x = -1;
    case 2:
.......
icecreamyou’s picture

Never modify the module file unless you absolutely have to.