I realise there's a lot of work going on to sort out a new version of Buddylist but I have a client and a deadline :-) so I'm putting together a module that will do something like the facebook wall using the current buddylist.
Basically, I've got my own message node (which works fine) however for a wall I need to select messages from "all my buddies and me".
Using the existing Buddylist View filters I can only select "all my buddies" and Views can't do "OR" so I can't combine filters.
So first question: Am I right in assuming all this? (i.e. I can't select based on "all my buddies and me").
Subquestion:
Assuming I'm right -- is there a simple addition to the Buddylist view filters that I could add that would allow me to do this? (The necessary code would be very useful -- thanks).
Comments
Comment #1
dldege commentedHum, the fact that views filters are "and"-ed seems to be the biggest hurdle for you. You might looked at the views module and see if there are any hooks that you could implement in you own module that would allow you to customize the query at the last minute.
This one might be something that could work
$replacements = module_invoke_all('views_query_substitutions', $view);in views_cache.inc but I'm not sure.It doesn't look trivial either.
Option 2: don't use views and just write you own - its a pretty simple query.
Hopefully someone with more views experience will have a better idea.
Comment #2
SteveTurnbull-1 commentedThanks for your thoughts on it -- I did end up rolling my own. I realised that, practically speaking, it couldn't be done in a single query anyway.
I created a custom block with a single function call in it, the function then does all the hard work of getting all the messages written by the current user, and another call to fetch all the messages written by his buddies.
Then fetch the message nodes one by one, theme them and output.
It's a bit naughty but the block only appears on one page so I used it to look at the URL and decide whether to go somewhere else instead. (Adding a new message, for example.)
Steve