Announcement

Collapse
No announcement yet.

Integrate open-x advertisements

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

  • Integrate open-x advertisements

    Hi

    I have been looking at open-x (openx.org) as an advertising solution for our forum. It seems great and it gives me a PHP-hook which will display ads from my inventory. I need to add the following hook to my vBulletin-template (never min the local paths from my test system):

    Code:
    <?php
      //<!--/* OpenX Local Mode Tag v2.6.0 */-->
    
      define('MAX_PATH', 'J:\wamp\www\openx-2.6.0\openx-2.6.0');
      if (@include_once(MAX_PATH . '/www/delivery/alocal.php')) {
        if (!isset($phpAds_context)) {
          $phpAds_context = array();
        }
        $phpAds_raw = view_local('', 1, 0, 0, '', '', '0', $phpAds_context, '');
      }
      echo $phpAds_raw['html'];
    ?>
    I tried modifying the footer in my template and add something simple like

    Code:
    <?php echo "test"; ?>
    but that didn't output test as expected. That means the banner-hook won't work either. How can I embed these PHP-hooks in my template?

    Dan
    --

  • #2
    Please see these instructions for including PHP, TXT or HTML in a template:

    http://www.vbulletin.com/docs/html/t..._externalfiles
    http://www.vbulletin.com/forum/showt...18#post1066718
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      Originally posted by danglund View Post
      I have been looking at open-x (openx.org) as an advertising solution for our forum. It seems great and it gives me a PHP-hook which will display ads from my inventory. --
      Dan,

      Did you manage to get this working ok?

      Thanks

      Shafiq :sK
      Chamber Internet
      http://www.chamberinternet.co.uk

      Comment


      • #4
        I could not actually get the PHP-hook to work, but I went with the JavaScript-hook solution and never looked back. It works like a charm.

        Dan
        --

        Comment


        • #5
          Dan, I installed openx, and now I'm trying to figure out how to make the ads appear somewhere under my header on each page. Openx generated the two pieces of code for me. The first piece of code I placed to my header template, as I believe that is what the instruction was telling me, but I have no idea where to place the second piece of code.

          Would you mind giving me a hint, or a link to a thread, etc.

          Thx.

          Comment


          • #6
            First of all make sure you have some ads, websites and zones in OpenX. Then use OpenX Admin GUI to get the invocation code:

            1. Inventory -> Zones -> [select a zone] -> Invocation code
            2. Choose type of banner invocation: Local mode tag

            You should then have something like this:

            Code:
            <?php
              //<!--/* OpenX Local Mode Tag v2.6.0 */-->
            
              define('MAX_PATH', '/www/example.com/openx-2.6.0');
              if (@include_once(MAX_PATH . '/www/delivery/alocal.php')) {
                if (!isset($phpAds_context)) {
                  $phpAds_context = array();
                }
                $phpAds_raw = view_local('', 5, 0, 0, '', '', '0', $phpAds_context, '');
              }
              echo $phpAds_raw['html'];
            ?>
            Then in vBulletin, find somewhere in your template to paste your invocation code. In VBulletin Admin GUI do:

            1. Styles & Templates -> Search in templates: ad_forumdisplay_afterthreads
            2. Paste your invocation code from above in here
            3. Refresh the forum and you should retrieve some ads

            Comment


            • #7
              Dan, for some reason this just simply doesn't display ads for me. It should, but it doesn't. I don't know why. But a workable solution was found in the following thread: http://www.vbulletin.org/forum/showt...53#post1664612

              Thanks, Dan.

              Comment

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