Log in

View Full Version : Looking to make a simple PHP include...


Crash_SCM
08-06-2008, 08:45 PM
I want to include a PHP file ever 5 posts. I've been looking through the templates and reading how to do certain stuff on this board. What I believe I need to do is create a hook(?) and then have the code include the php. Is this correct?

To be more specific, I'd like to place the file after the 5th and 10th posts in a thread on each page of the thread, (so obviously it would be after post 5, 10, 20, 25, 35, 40, etc..)

Anyone have some insight for me? A path to get me started on? I'm not new to programming, but I'm new to vB mods.

Thanks,
Matt

Dismounted
08-07-2008, 10:23 AM
Firstly, I suggest having a look at the vBulletin Manual (http://www.vbulletin.com/docs/html).

You could probably hook in at postbit_display_complete and use the variable "$post['postcount']" with modulus to add something after the fifth post, etc.

Crash_SCM
08-07-2008, 01:00 PM
Thanks. I created a custom hook which allowed me to do what I wanted, but ran into a weird issue with it. I eventually modified the template instead and added a new variable in the code that pulls from an include file. So far, it works like a charm.

I went through the manual and noticed it was very sparse for information about programming plugins. Luckily, I'm not writing this plugin for the masses, just for one site...

Thanks for your help.