PDA

View Full Version : Custom code in selected topics


Damer
08-10-2015, 07:09 PM
Hi!
I was wondering if there was a way to add custom javascript to individual threads in vB5. We have a community board where we do "quests", complete certain tasks on a weekly basis. We were wondering if we could add a bit of extra gamification, like:

a) a countdown to every quest's thread
b) confetti - when we complete a quest: http://codepen.io/iprodev/full/azpWBr

Is there some way this can be added to selected threads? Users don't need to have this function, we can add it every time - I am just not sure how to do it or even where to start, vB5 is so complex. When you modify vB5 template it changes every page of this kind and we need to add it just to the quest threads.

Does anyone know how to do it? Thank you so much in advance.

Replicant
08-11-2015, 12:07 AM
If you don't currently use the "featured topic" functionality of vb5, in the display_Topics_item template, there is a vb:if that checks if a topic is featured. You can add your code there and "feature" those topics you wish to contain the extra JS. The best way would be to custom code a mod but like you said, VB5 is to complex. If you don't already know how to do it, you'll spend months learning how to and what kind of fun is that?

Damer
08-11-2015, 05:22 PM
Thank you so much @Replicant!
I edited widget_conversationdisplay and I managed to get it to work with your recommendation:
http://darebee.com/hive/forum/general/68571-wq-august-3-9-save-the-world