How to setup PhpAdsNew using phpinclude template?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mitrofan
    Senior Member
    • Jan 2001
    • 340

    How to setup PhpAdsNew using phpinclude template?

    I saw many posts in here about how great PhpAdsNew is, so I downoaded it and I really like it. It easy to install and easy to use.

    I have yet to figure out how to use it with Vbulletin and phpinclude template

    This is what I tried to do on other pages using both view() and view_raw() methods.

    Using view() is the best and easiest, but I don't think it will work with Vbulletin.

    require("/usr/local/apache/sites/htdocs/ads/phpadsnew.inc.php");
    put this at the beginning of your page

    view("keyword",0,"_blank","",1)

    That's it. It will print banner with the keyword "keyword"

    Now here is how I did it with view_raw:

    require("/usr/local/apache/sites/htdocs/ads/phpadsnew.inc.php");
    <?php
    $banner1=view_raw("banners",0,"_blank","",1);
    echo $banner1[html]
    ?>

    This works too and according to instructions (lacking explanations of this view_raw) this is how your should use it on template driven sites.

    Ok, now could someone suggest how to use it with phpinclude template?

    Thanks.
    'beta tester'
  • Mitrofan
    Senior Member
    • Jan 2001
    • 340

    #2
    I got it working

    Ok, for those of you who has the same questions, and I'm sure many do, here is how I got it to work:

    put this in you phpinclude:

    $Banner= "/path/to/your/ads/";
    include("$Banner" . "phpadsnew.inc.php");
    $banner1=view_raw("forum",0,"_blank","",1);


    I use "forum" keyword to only display banner on my forum that has "forum" keywords in them. This way I can have more control of what banners will appear on my forum. If you don't need to use keywords, just leave this variable blank like this ""


    Then put this in your header template where you want the banner to appear:

    $banner1[html]

    It will print the banner.


    If you need more than one banner on your forum, just use $banner2=view_raw(put different variables here...)
    'beta tester'

    Comment

    • fastforward
      Senior Member
      • Nov 2000
      • 1013

      #3
      A point you should consider before using this method:

      The problem is the phpinclude template is evaluated within global.php. This means that every php file (even ones that don't actually produce a page) will cause phpAds to grab a banner from the database. This will obviously increase the load on your server and the impressions that are reported in phpAdsNew will be totally bogus.

      You'd be better off using the javascript ot IFrame method. Or hack the vB code.
      http://britishexpats.com/ - British expatriate community

      Comment

      • Mitrofan
        Senior Member
        • Jan 2001
        • 340

        #4
        What vbulletin files don't produce a page?

        ALso, I charge my advertisers a flat monthly rate, so the number of impressions that they see in the stats is not important. They know that they are getting plenty of impressions and the number of clicks is still accurate.

        javascript method is good, but I think it's a little bit slower to print a banner and it also relies on cookies, while the direct method does not.
        'beta tester'

        Comment

        • chrispadfield
          Senior Member
          • Aug 2000
          • 5366

          #5
          fastfoward, really i never knew that. That is annoying as it means avatar.php will be pulling a banner every page dosen't it. ek.
          Christopher Padfield
          Web Based Helpdesk
          DeskPRO v3.0.3 Released - Download Demo Now!

          Comment

          • fastforward
            Senior Member
            • Nov 2000
            • 1013

            #6
            Originally posted by chrispadfield
            fastfoward, really i never knew that. That is annoying as it means avatar.php will be pulling a banner every page dosen't it. ek.
            As far as I can determine, that is correct. I got all excited when I noticed I had about 10,000 banner impressions in one day. But then I did some comparing to other logs and saw that I really had about 500 impressions

            I've actually given up on phpAdsNew and intend to use AdCycle. One nice feature with AdCycle is the support for the extra 1x1 gif used by Befree (reporting.net) without having to enter it as an HTML ad.

            There is also an optioin to run it as a daemon. The daemon is written in C so it uses very few resources. Or you can run it under mod_perl, fastcgi or plain old CGI. Plus there's a PHP version being talked about.
            http://britishexpats.com/ - British expatriate community

            Comment

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