Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Hiding Discussions...
JasonP
✭
Alright so I'm working up an extension that allows a user to click [hide] next to any discussion, and then they can no longer see it unless select Hidden Discussions from the Discussion Filters in the panel. I'm reasonably far along, but getting Vanilla to actually hide the discussion seems trickier than I first imagined.
I have a new DB setup that holds a list of the user hidden discussion ids. This part all works. Now I need to filter out the results, blocking any discussion id in that set.
My first thought was to alter the data in the DiscussionGrid's PreRender() delegate, but its working with a mysql resource pointer instead of actual data. This doesn't get used until we are already in the theme itself, disussions.php.
So, given a list/array of discussion ids to hide, how would one approach this easily?
0
This discussion has been closed.
Comments
The admin can then give permissions for others to view hidden discussions.
So you can work off that.
Can you perhaps append the query, by getting the SQL builder and add a WHERE to it?
It would be very simple to adapt that to hide by discussion IDs instead of CategoryIDs.
Note that its probably better to use a for loop than a foreach, as foreach moves a position pointer through the array, and I found that if you follow the foreach with a second one without resetting it, it starts at the end of the array. (hence the two separate lines you to edit in my posted example) Count($Array) will return the number of items.
http://lussumo.com/community/discussion/6283/discussion-expiry/#Item_14
The "expired" item would be hidden but still searchable.
Couple of questions:
Would Stickies be allowed to be hidden? What happens when a post is commented on or edited? Does it become "unhidden"?