vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How do I insert an ad after the first post in a thread? (https://vborg.vbsupport.ru/showthread.php?t=13099)

huss 04-04-2001 07:35 PM

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?

Wayne Luke 04-05-2001 04:57 AM

This example uses PHPAds.....

In showthread look for:
Code:

  eval("\$postbits .= \"".gettemplate("postbit")."\";");
If you only want one ad after the first post put:
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>";
  }

If you want more than one ad say one every 5 posts use this:
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>";
  }


Freddie Bingham 04-05-2001 05:04 AM

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.

kontrabass 05-07-2001 03:05 PM

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!

limey 05-08-2001 01:29 AM

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()


All times are GMT. The time now is 03:53 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00910 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete