Hello,

I just installed 2008-Nov-23 dev release of Facebook-style Statuses. On the Advanced Forum modules support page (http://drupal.org/node/227121) it says that it integrates with Facebook-style Statuses module, however, I don't see any status messages in the forum posts.

Am I missing something here?

Thanks,
Andrey.

Comments

psicomante’s picture

michelle’s picture

Status: Active » Postponed (maintainer needs more info)

Facebook statuses was actually the first to add my code so it shouldn't need to be patched. However, I didn't have the variable printing by default until recently so you may need to add it to advf-author-pane.tpl.php yourself if you have an older version of that.

Michelle

mr.andrey’s picture

Odd.. in advanced_forum/styles/naked/advf-author-pane.tpl.php, there's already this code:

    <?php if (!empty($facebook_status)): ?>
      <div class="author-pane-facebook-status"><?php print $facebook_status; ?></div>
    <?php endif; ?>

facebook_status/facebook_status.author-pane.inc has this:

function facebook_status_preprocess_author_pane(&$variables) {
  $account_id = $variables['account']->uid;
  if ($account_id != 0) {
    $variables['facebook_status'] = facebook_status_advf($account_id);
  }
}

It seems like it should all work...

Now if I add a drupal_set_message('.'.facebook_status_advf($account_id)); line right after the $variables... line in facebook_status_preprocess_author_pane(), it only shows the dots, no actual statuses.

Then if I look in facebook_status.module:

function facebook_status_advf($account) {
  global $user;
  if (!$account->uid) {
    return;
  }

$account->uid returns 0, since $account is actually the uid. So either the facebook_status_advf() needs to change to take in $account as uid or the code in facebook_status.author-pane.inc needs to pass the uid in an $account->uid form.

Any ideas?

Andrey.

mr.andrey’s picture

Replacing

variables['facebook_status'] = facebook_status_advf($account_id);

with:

$variables['facebook_status'] = facebook_status_advf($variables['account']);

Fixes the problem.

Best,
Andrey.

icecreamyou’s picture

Status: Postponed (maintainer needs more info) » Needs review

Michelle, is this something you would like me to do in facebook_status, or would you prefer to do it in advforum?

I would prefer that it be fixed in advforum because if I remember correctly I use the whole user object to theme the username, so it would save a user_load().

michelle’s picture

Project: Advanced Forum » Facebook-style Statuses (Microblog)
Version: 6.x-1.0-alpha16 » 6.x-1.x-dev
Status: Needs review » Reviewed & tested by the community

I confirmed that his fix works. Not sure how we had that wrong to begin with... I could have sworn it worked when I tested it way back when you first added it.

Anyway, I don't understand why you think this should be fixed in AF? Did you forget that you were one of the few maintainers that committed the .inc file? :)

Anyway, just change it to use the whole account object instead of the ID like mr.andrey said in #4 and it will work fine.

Michelle

michelle’s picture

As long as we're on the subject... Any chance of an FR? Could you possibly set another variable in the preprocess that doesn't include the user name? I've been struggling with where to put this in the author pane and it occured to me that putting it right under the username would be a nice spot. But including the user name would be redundant. Making another variable would give people the option of which they want to use.

Thanks!

Michelle

icecreamyou’s picture

Status: Reviewed & tested by the community » Fixed

Haha yep I did forget. I could have sworn it worked too, but I'm still on Alpha 10! Yikes. It probably did work at that point.

The preprocess function is now:

function facebook_status_preprocess_author_pane(&$variables) {
  if ($variables['account']->uid != 0) {
    //TRUE includes the themed username; FALSE is just the status.
    $variables['facebook_status'] = facebook_status_advf($variables['account'], TRUE);
    $variables['facebook_status_status'] = facebook_status_advf($variables['account'], FALSE);
  }
}

So the facebook_status variable includes the username, the facebook_status_status variable is just the status. Committed in 5.x and 6.x devs.

In the process, I cleaned up the facebook_status_advf() function a little. It looked like I was confused about whether I was dealing with a user object or a UID when I wrote it; I had been re-loading the entire user object using the UID from the passed user object. *shrug*

michelle’s picture

Wow, you're awesome!

The thing I really like about this method is that people don't have to wait for a new AF/APK release from me. They just need to update your module and they've got it. It's too bad most of the other maintainers I approached didn't see the logic in this. :(

Anyway, thanks for adding it! I'll probably be using the plain status one as a default for my modules because I think it will look nice there under the user name. But this way it will continue working like it did for those who are already using it.

Michelle

icecreamyou’s picture

It comes to me naturally. :-P

Yep. I think the reality is that most other maintainers just aren't on top of things. Most people write modules because they need them for a project and don't have any motivation to update them afterwards.

That sounds like a good idea to me. I've been thinking about doing that on my own site(s) for awhile now, I'm glad I finally had a reason to get on that. :)

michelle’s picture

Yeah, I guess that's an advantage to having Drupal as a hobby. :)

I'm off to bed. Have a good night.

Michelle

michelle’s picture

Status: Fixed » Active

I hate to keep bugging you but is there any chance you could remove the <p class="submitted"> bit? That extra paragraph in there is throwing off the formatting. :( Author pane really just needs the raw info.

Thanks,

Michelle

icecreamyou’s picture

Title: Facebook-style status integration not working? » Advanced Forum integration problems
Assigned: Unassigned » icecreamyou
Status: Active » Postponed (maintainer needs more info)

Would it work better with a <span>? I feel like because the text is so long there should be an easy way to reduce the font size through CSS, instead of editing the template.

michelle’s picture

We discussed on IRC but just to have it documented... What we have now is:

<div class="author-pane-line author-facebook-status">…<p class="submitted"> is testing</p></div>

That paragraph means we can't put anything before / after the status in the template and it also gives a lot of extra spacing. Making the text smaller could already be done with

.author-facebook-status {
  font-size: 1px;
}

Michelle

icecreamyou’s picture

Status: Postponed (maintainer needs more info) » Fixed

Changed to a span after discussion with Michelle on IRC (and also--I realized later--because there's a necessary title attribute). Added to both branches locally; will commit after I fix another minor problem.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.