HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Category specific code on top each post
JoshuaO
New
Please, I'll like to add code on top of every post a user posts on my forum.
I would have used the POCKETS plugin, but I want every category or subcategory to have its own specific code that I can edit anytime.
Specifically, I want to add HTML code that can play/stream audio while the users discuss.
Different categories will have different stream links.
Please help me, I'm building a discussion forum for community interests and I am a novice.
Thank you
Tagged:
0
Comments
Here is some untested code (but I assume it should work) which you certainly would have to customize and wrap up in a plugin of your own:
I hope it is mostly readable what's happening: Before a pocket is printed out, you can hook into the process flow and take some actions. I have thrown together some lines which a) ensure we are dealing with the /discussion view (and not e.g. with the Recent Discussions view) b) the pocket that we are checking is one pocket that really should be treated based on the category and not a pocket that should be shown for every one on every page and c) the category of the current discussion matches the array of allowed categories for this pocket
Oh Boy!
This then mean I must work with code afterall. I thought I could use Vanilla without codes, so far it's been working just fine but then, I guess I'm going into deeper waters.
I was hoping there was already a plugin I could use.
Thank you @R_J
@JoshuaO: We have a plugin for sale that does exactly what you are looking for. "Pocket Categories" is an additional plugin to Pockets that allows you to define in which categories your custom HTML code will appear.
https://vanillaskins.com/plugins.html#pocketCategories
@phreak I realise this post was a while ago but does your Pockets Add On allow content to placed on specific tag pages too?
I advice you to install a plugin