Not sure where to ask > banner after first post

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pingu
    Senior Member
    • Jan 2001
    • 498
    • 4.2.5

    Not sure where to ask > banner after first post

    I know I've seen this before and I've spent days looking for this thread, but...

    What's going on? Umm, nothing yet, hence this post...

    I've got phpAdsNew 2b1 installed, and I want to display a banner after the first post of each thread (maybe after each 5 posts, dunno). I've got to do stuff with showthread.php, that I know, and it's all I know...

    How on earth would I do a thing like this? I wouldn't mind at all if one of you answered this in great detail since I barely know what I'm doing
  • shri
    Senior Member
    • Apr 2000
    • 478
    • 3.6.x

    #2
    Look for (I think this is where its at)

    PHP Code:
    $counter=0;
    while (
    $post=$DB_site->fetch_array($posts) and $counter++<$perpage) {

      if (
    $postdone[$post[postid]]) {
        
    $counter--;
        continue;
      } else {
        
    $postdone[$post[postid]]=1;
      }

      if (
    $counter%2==0) {
        
    $post[backcolor]="{firstaltcolor}";
      } else {
        
    $post[backcolor]="{secondaltcolor}";
      } 
    This is the begining of the loop where the post is setup.

    Look for

    PHP Code:
      eval("\$postbits .= \"".gettemplate("postbit")."\";"); 
    Do something like right below that.
    PHP Code:
    if ($counter whatevervalue)
      {
       
    $postbits .=  "<br>" $ad_banner;
       } 
    This will append the html from ad_banner to the postbit template.

    Use view_raw to get $ad_banner

    Comment

    • Pingu
      Senior Member
      • Jan 2001
      • 498
      • 4.2.5

      #3
      Thank you very much. This was what I was looking for
      I'll start playing with this as soon as I have time

      shri rulez!

      Comment

      • shri
        Senior Member
        • Apr 2000
        • 478
        • 3.6.x

        #4
        Lemme know how it goes. Would be interesting to see what sort of click through rates banners in non standard locations get.

        Comment

        • George L
          Former vBulletin Support
          • May 2000
          • 32996
          • 3.8.x

          #5
          i am doing something similar but instead with simplate text advertisements on the top of forums, and showthread and private message areas

          haven't tried it with real advertisements yet though
          :: Always Back Up Forum Database + Attachments BEFORE upgrading !
          :: Nginx SPDY SSL - World Flags Demo [video results]
          :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

          Comment

          • Pingu
            Senior Member
            • Jan 2001
            • 498
            • 4.2.5

            #6
            Well, out of experience I can tell you that a banner on the top of a forum does not do well. I guess it's because visitors are focussed on the discussions and don't have eyes for anything else, at least untill they're finished reading and discussing. So during that they are set to "text mode" and ignore graphics. I know I see nothing but text when discussing

            The idea for this set up is to make banners appear after for example the first post. No graphics though, but text or HTML banners of something like that, (if we have a choice that is...) Maybe it'll make a difference. If it doesn't then we'll at least have a noticable place for announcements

            Mind you, the very first idea was to place little text ads in the posts themselves, in a small table at the bottom where signatures are now. But with such a thing it's really easy to over-do things, so that will need to be looked at closely in the future...

            I'm going to ruin my forum now and let you know soon

            Comment

            • Pingu
              Senior Member
              • Jan 2001
              • 498
              • 4.2.5

              #7
              Can't get it to work

              All it shows now is "Array" where a banner should be, in a gap between the first and the second post. I'm halfway there then...

              What I've done, is add this code to showthread.php:
              Code:
                if ($counter==1) {
                    require("/blah/blah/phpadsnew.inc.php"); 
                 $postbits .=  "<table width=\"100%\"><tr><td align=\"center\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\">".view_raw("")."</tr></td></table>";
                }
              What am I doing wrong???

              Comment

              • Wayne Luke
                vBulletin Technical Support Lead
                • Aug 2000
                • 74167

                #8
                We use:
                PHP Code:
                require("/path/to/da/script/phpadsnew.inc.php"); 
                $adbanner get_view(""); 
                And put $adbanner were ever we want it.
                Translations provided by Google.

                Wayne Luke
                The Rabid Badger - a vBulletin Cloud demonstration site.
                vBulletin 5 API

                Comment

                • Pingu
                  Senior Member
                  • Jan 2001
                  • 498
                  • 4.2.5

                  #9
                  Hmm, don't think "get_view" is supported anymore. I can find nothing like that...

                  And I can't see how I can make a view appear after the first post with "$adbanner = get_view("");". Can you explain please?

                  When I replace "view_raw" with "view" then a banner shows up, at completely the wrong spot but it shows...
                  When I use "view_raw" all it shows is "Array", at the right spot. Here's an example of what I mean:


                  I really want this icky bit solved

                  Comment

                  • Fred
                    Senior Member
                    • Jun 2000
                    • 933
                    • 3.5.0 Pre-Release

                    #10
                    Why cloud your forum up with sponsors. Thats hella annoying.

                    Comment

                    • shri
                      Senior Member
                      • Apr 2000
                      • 478
                      • 3.6.x

                      #11
                      i use this ..


                      PHP Code:
                      include("/home/gandu/www/ads/phpadsnew.inc.php");
                      $adbanner view_raw("top_banner");
                      $mybanner $adbanner[html]; 

                      Comment

                      • Pingu
                        Senior Member
                        • Jan 2001
                        • 498
                        • 4.2.5

                        #12


                        Me happy. It works thanks to the tips suggested here...

                        Ok, here's the final code:
                        Code:
                          if ($counter==1) {
                        	include("/blah/blah/phpAdsNew/phpadsnew.inc.php");
                        	$adbanner = view_raw("");
                        	$mybanner = $adbanner[html];
                        
                                $postbits .=  "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\"><tr><td align=\"center\">" . $mybanner;
                        	$postbits = $postbits ."</tr></td></table>";
                          }
                        And Fred, I would prefer not to show banners at all, but this decision is based on the content (or lack of it) of my wallet

                        Comment

                        • Byron
                          Senior Member
                          • Nov 2000
                          • 525
                          • 3.0.0 Beta 6

                          #13
                          include("/home/gandu/www/ads/phpadsnew.inc.php");
                          $adbanner = view_raw("top_banner");
                          $mybanner = $adbanner[html];

                          I tried the above method by Shri. It works but i get the following warning messages when i tried to logout.


                          Warning: Cannot add header information - headers already sent by (output started at /my/server/ads/phpadsnew.inc.php:47) in /my/server/ads/forums/admin/functions.php on line 1173

                          Warning: Cannot add header information - headers already sent by (output started at /my/server/path/ads/ads/phpadsnew.inc.php:47) in /my/server/path/ads/forums/admin/functions.php on line 1173

                          Warning: Cannot add header information - headers already sent by (output started at /my/server/path/ads/phpadsnew.inc.php:47) in /my/server/path/forums/admin/functions.php on line 1173
                          Last edited by Byron; Tue 26 Feb '02, 7:57pm.
                          .

                          Comment

                          • George L
                            Former vBulletin Support
                            • May 2000
                            • 32996
                            • 3.8.x

                            #14
                            you're phpadsnew.inc.php has white space or extra line breaks in the file - check line 47 of phpadsnew.inc.php to see
                            :: Always Back Up Forum Database + Attachments BEFORE upgrading !
                            :: Nginx SPDY SSL - World Flags Demo [video results]
                            :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

                            Comment

                            • Byron
                              Senior Member
                              • Nov 2000
                              • 525
                              • 3.0.0 Beta 6

                              #15
                              thanks eva2000,

                              no more error msg after i removed the blank spaces.
                              May i know why is the blank space causing the errors?

                              Are you using the same method to call your banners as well?
                              Last edited by Byron; Tue 26 Feb '02, 7:57pm.
                              .

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...