Announcement

Collapse
No announcement yet.

phpAdsNew error with showthread.php

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • phpAdsNew error with showthread.php

    I am tryng to use phpAdsNew2. I got the phpadsnew.inc.php included in the phpinclude and I'm working with view_raw(). Everything is ok, everything workes fine...
    BUT when I come to a showthread.php page, I get the following php warning:

    Warning: Cannot add header information - headers already sent by (output started at /usr/local/etc/httpd/htdocs/ads/phpadsnew.inc.php:47) in /usr/local/etc/httpd/htdocs/forum/admin/functions.php on line 1187

    So, line 47 is just the end of the document where the other three old includes are included. No real hint there.

    But line 1187 is the vbsetcookie() function.
    And that is called from showthreads only at one place in showthread.php. Nothing special to me, there. vbsetcookie gets called from all kinds of other pages, too - without this php warning.

    Does anybody know what so special about it? and *much* more important: Can anyone tell me how to get rid of the warning by either editing phpAdsNew2 or vBulletin?

    Thanx

    Oh, don't waste your time on telling me things about the remote invokation by simply using the image tag and forgetting about the inclusion of phpadsnew.inc.php. I *need* html-banners and wise-cracking about the buggy remote invocation (even thourgh JavaScript) is no help.

    Thanx, again
    Last edited by habu; Thu 31 May '01, 8:39am.

  • #2
    I'm bettiner there's whitespace in that phpAdsNew file that you have to get rid of.

    Comment


    • #3
      still no clue, anybody?

      What do you mean by whitespace? Spaces, tabs, ... (C library function isspace() recognized) or something like that?
      Where can whitespaces cause problems within phpAdsNew2?

      Why should that problem only appear with the showthread.php page? Btw, it also happens (twice, [two setcookies() calls]) in some interim refresh pages.

      Comment


      • #4
        White space = extra spaces or lines outside the PHP tags (<? ?>). These cause the web server to think it has data to send to the end user and therefore it initiates the proper headers which then cause the errors you are seeing.
        Translations provided by Google.

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

        Comment


        • #5
          make sure:

          i) you are using the view_raw() function and not just view()
          and
          ii) that at the END of phpadsnew.inc.php that there is no whitespace. Just go down as far as you can select and press delete until you get to the ?>
          Christopher Padfield
          Web Based Helpdesk
          DeskPRO v3.0.3 Released - Download Demo Now!

          Comment


          • #6
            habu,

            This may or may not be helpful, but...

            Here's what I have in my phpinclude for phpadsnew.
            Code:
            include("/www/htdocs/ads/phpadsnew.inc.php");
            $ads_array=view_raw("468x60");
            $ad468x60 = $ads_array["html"];
            Then I just put the $ad468x60 variable in any template at the position I want the ad to show.
            http://britishexpats.com/ - British expatriate community

            Comment


            • #7
              to save you a line of code, you can leave out

              $ad468x60 = $ads_array["html"];

              and just put $ads_array[html] inside the template.

              not that it makes much difference
              Christopher Padfield
              Web Based Helpdesk
              DeskPRO v3.0.3 Released - Download Demo Now!

              Comment


              • #8
                Originally posted by chrispadfield
                to save you a line of code, you can leave out

                $ad468x60 = $ads_array["html"];

                and just put $ads_array[html] inside the template.

                not that it makes much difference
                But I like typing.. OK I love the sound of my own keyboard
                http://britishexpats.com/ - British expatriate community

                Comment


                • #9
                  Thank You Folks!

                  To bring this thread to a good end:

                  It was a 'whitespace' at the end of the included file.
                  After deletion everything worked fine.

                  I still do not know why the warning only came up with certain files like showthread.php, since the same file was included in every page of vBulletin. Anyway, it now works.

                  Thanx!

                  Comment


                  • #10
                    Re: Thank You Folks!

                    Originally posted by habu
                    To bring this thread to a good end:

                    It was a 'whitespace' at the end of the included file.
                    After deletion everything worked fine.

                    I still do not know why the warning only came up with certain files like showthread.php, since the same file was included in every page of vBulletin. Anyway, it now works.

                    Thanx!
                    Showthread updates the user's cookies so the threads are marked as read for that visit.
                    Translations provided by Google.

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

                    Comment

                    Loading...
                    Working...
                    X