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.
How do you insert a new discussion that is always below all the others?
Hi Vanilla community:
Here's what I want to do. I have an application that inserts discussions into vanilla. I always want these inserts to be below all the vanilla natural discussions.
What I mean by natural is when a person normally hits the "start a new discussion" link. it creates what a normal natural discussion. So, if I add discussions below that (say Testimonial discussions), I want these testimonials to always show below the natural discussions regardless of the date modified. I'd rather not mark all natural discussions sticky. I don't mind marking all the testimonials as sink, but that doesn't work since it's New it always goes on top.
Any suggestions?
hmm, maybe that's it. I want to sort by sink then by discussion last mod time. So, how do I do that? Is there an easy way to change the default sort of the discussion list?
Thanks in advance.
0
This discussion has been closed.
Comments
(if I'm not bad)
Disclaimer: Make a note of this change because when/if you update Vanilla the change will be erased and you will need to put it back to maintain this new functionality. If you accept this, here is how to prevent certain discussions from showing up in any discussion list:
Open discussion.php and add this to line 12 (currently a blank line):
$discussionId = $Discussion->DiscussionID; if ($discussionId != "31" && $discussionId != "35") {
but change the numbers to the right numbers, if you don't know how to find the IDs just ask. Also add this to line 50:}
Yeah I'm not quite clear on why he would want to do it either, definitely a unique request
But I dunno, maybe there is a good reason for it, I know sometimes I need to do weird things with code so I'm not one to judge One reason could be that he wants the discussions to show up in searches but not on discussions pages (in which case the code I provided above won't work, ssta)
To sstawarz:
The exact functionality you are requesting would require some bigger code changes, the code I gave you is a way to stop those discussions from being accessible via the UI, but I now realize that may not have the desired effect. Let me know if you want to do a big code change to make that work and I might be able to help.
If that doesn't make sense just say and I can give you the code