The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Let's say I want to insert an ad or somesuch in after the first post of every thread. How would you go about doing that?
You would stick it at the bottom of the while loop in showthread that displays the posts. I've taken a look through the code, and frankly it's beyond me how to do this. I think this is very useful for ad driven sites and was wondering if you could give me more guidance? Or should I ask in hacks? |
#2
|
||||
|
||||
This example uses PHPAds.....
In showthread look for: Code:
eval("\$postbits .= \"".gettemplate("postbit")."\";"); Code:
if ($counter==1) { require ("/pathto/phpAds/config.inc.php3"); require ("/pathto/phpAds/view.inc.php3"); require ("/pathto/phpAds/acl.inc.php3"); $postbits .= "<table width=\"{tablewidth}\"><tr><td align=\"center\">".get_view("")."</td></tr></table>"; } Code:
if (($counter%5)==0) { require ("/pathto/phpAds/config.inc.php3"); require ("/pathto/phpAds/view.inc.php3"); require ("/pathto/phpAds/acl.inc.php3"); $postbits .= "<table width=\"{tablewidth}\"><tr><td align=\"center\">".get_view("")."</td></tr></table>"; } |
#3
|
||||
|
||||
change the require to include as require can do funny things like, oh always require the file even if the code block doesn't execute.
|
#4
|
|||
|
|||
Can I expand this question?: Can the same thing be done in the thread list (ie, insert an ad after the 1st thread in a forum)?
Thanks! |
#5
|
||||
|
||||
does this code still work?
I tried it on RC2 and it didn't: thats what I get. Fatal error: Call to undefined function: get_view() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|