Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 04 Mar 2016, 14:08
robertw795 robertw795 is offline
 
Join Date: Feb 2016
Finding the right hook(s) for plugin(s) in vBulletin 5.2.0

I am currently adding advertisements to a forum and I want to place an advertisement after every 5 posts in a thread. To do this I have to write a custom plug-in.

I used to have a similar custom plug-in in a vBulletin 3.8.5 forum which I wanted to use as a reference. I noticed that the hooks have changed over the years. At this point my problem is that I don't know what hook I have to use for my plug-in, as the hooks of 3.8.5 don't correspond to those of 5.2.0 anymore.

I'd like to ask you which hook I have to use for my plug-in. And in general, where to find documentation about hooks and their functionality for future reference.

Where can I find this?

Thanks in advance.
Reply With Quote
  #2  
Old 04 Mar 2016, 18:35
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Real name: Mel
Hooks have just been re-implemented in vb5. There are only two in 5.2.0 and they are pretty much for testing. The hook system is in it infancy on vb5.

I would add a template hook in the conversation display templates to accomplish what you're trying to do. The only problem with that is the modification won't survivr an upgrade and will need to be re-added which is really not that big of a deal. I have several on my site that I do it on every upgrade.
__________________
VB5 mods - RepliClock VB4 mods - Member Online Status
Reply With Quote
  #3  
Old 07 Mar 2016, 09:15
robertw795 robertw795 is offline
 
Join Date: Feb 2016
Originally Posted by Replicant View Post
I would add a template hook in the conversation display templates to accomplish what you're trying to do.
Hello,

Thanks for your reaction.
I've managed to display my plug-ins custom template below the reaction to a topic form using the conversation_below_entry hook location.

Now I want to display it inbetween the posts, so what I want to do is fetch the number of the posts in the topic, and place my custom template after every 5. Is it possible to write a custom hook location for this?
Reply With Quote
  #4  
Old 07 Mar 2016, 14:20
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Real name: Mel
From the VB5 manual

{vb:hook}

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

There is also {vbhp} available which provides for a limited amount of php functions in you template code.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

For more info on the VB5 template syntax, go here.

This is too funny. -->> {vbhp}
__________________
VB5 mods - RepliClock VB4 mods - Member Online Status
Reply With Quote
  #5  
Old 08 Mar 2016, 08:03
robertw795 robertw795 is offline
 
Join Date: Feb 2016
Thanks, I've got all the information I need now.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 06:30.

Layout Options | Width: Wide Color: