[buddypress-trac] [BuddyPress] #1721: Filter Hooks needed for plugins to custom filter activity streams [Has patch]

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Mon Feb 8 18:26:10 UTC 2010


#1721: Filter Hooks needed for plugins to custom filter activity streams [Has
patch]
-----------------------+----------------------------------------------------
  Reporter:  rvenable  |       Owner:           
      Type:  defect    |      Status:  reopened 
  Priority:  major     |   Milestone:  1.2      
Resolution:            |    Keywords:  has-patch
-----------------------+----------------------------------------------------
Changes (by rvenable):

  * status:  closed => reopened
  * resolution:  invalid =>


Comment:

 Replying to [comment:6 apeatling]:
 > Pass an array to the meta functions that will store all the values you
 need. It isn't limited to a single piece of data.
 >
 > I'm fundamentally against filtering the SQL since plugins should be
 using the API layer above this. Once you add filters to SQL you are
 starting on a slippery slope that ends in broken queries, conflicts and
 trouble with compatibility.

 I won't reopen this any more this milestone if you invalidate it again,
 but please listen to my final argument.

 It is your decision, but the BP API does not support what I want to do. A
 smart plugin developer will use the BP API when he can, but don't tie him
 to the API if he is trying to do something that the API can't support.
 Sure, it is a slippery slope, but the plugin developers are responsible
 for their own code.

 Let me explain what my plugin does: it indexes content by Bible references
 mentioned. Someone might mention the Bible verses John 3:10-20 in an
 activity update. My plugin detects the Bible reference and stores an
 integer start verse and and integer end verse. Then if someone is looking
 for activity about John 3:16, he would find the activity about John
 3:10-20 (because John 3:16 is in John 3:10-20). A query for John 3 would
 also return that activity (because John 3 includes John 3:10-20). I do
 this by creating a table with start verses and end verses and write
 queries for finding range intersections.

 Here would be a WHERE statement that finds all activities which mention
 verses in John 3:
 (seqs.start BETWEEN 2818816 AND 2819071) OR
 (seqs.end BETWEEN 2818816 AND 2819071) OR
 (2818816 BETWEEN seqs.start AND seqs.end) OR
 (2819071 BETWEEN seqs.start AND seqs.end)

 2818816 is the starting verse in John 3 and 2819071 is the ending verse,
 so this query is just searching the activity tables for intersecting
 integer ranges.

 Can the BP API handle this kind of data?

-- 
Ticket URL: <http://trac.buddypress.org/ticket/1721#comment:7>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list