Closed (fixed)
Project:
Facebook-style Statuses (Microblog)
Version:
6.x-3.0
Component:
Code - API
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 Feb 2012 at 19:54 UTC
Updated:
25 Feb 2012 at 20:20 UTC
Hi all,
i want to hide the shoutbox for the users that are not friends. In my first attempt, i've used tpl.php, where i have:
echo '<div class="fbstatus">' . $profile['facebook_status'] . '</div>';
i'm not sure if there is a better way to embed, or if there is a posibility to embed shoutbox and view separately.
Ok, i've added this code in my first attempt:
if($friends != 0) echo '<div class="fbstatus">' . $profile['facebook_status'] . '</div>';
doing a previous chekings and returning $friends = 0 for none friends of the actual browsing user.
The approach is rudimentary, i know. I want to include in a module but, which hooks do i have to "touch" to modify the shoutbox? Is the embeding code which i use right? Can be done separetely, shoutbox and shouts, as i was asking?
Thanks a lot in advance.
Comments
Comment #1
icecreamyou commentedThe easiest way to do this is to implement hook_facebook_status_user_access_alter(), e.g.:
Comment #2
alexmoreno commentedhello icecreamyou, and firstly thanks a lot for this great module.
i'm gonna try this, and i'll tell how it was, thanks a lot.
Is the way which i was doing the embedding correct? Using the $profile['facebook_status'] is correct?
There is not too much information about.
Thanks a lot again.
Comment #3
icecreamyou commentedYeah, that's the right way to do it in the theming layer. Although generally instead of putting business logic in the template itself, you should do any computation (like determining whether two users are friends) in template.php. See also https://drupal.org/node/223430
Comment #4
alexmoreno commentedthanks a lot IceCreamYou, i'll put my hands on it this week :-)
Have a nice week end.