Unconfigured Ad Widget

Collapse

Programing help needed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • #16
    Kestryll
    Head Janitor
    • Oct 2005
    • 21584

    Originally posted by reverser
    What makes you say this? Have you properly preregistered your variable? What hook are you using? Are you getting any output at all from the template?
    When I tried it out on a test install it didn't work so I asked on the vBulletin support forums if something changed in how 4.x.x deals with PHP that would prevent this from working and was told by one of the developers 'Yes, we've made some changes to how things work in 4.x, you'd need to go over and post @ vBulletin.org for assistance with custom coding.'

    I was referred to this link which may address what you're referring to but to be honest it's a bit beyond my current knowledge: https://www.vbulletin.org/forum/showthread.php?t=228078
    I can do a lot of things within the vBulletin software but I'm not a coder or programmer. After a few moments of trying to follow it my eyes glaze over and I become Homer Simpson thinking about donuts.

    Originally posted by Cokebottle
    Ivanimal is stepping down?
    *OUCH*
    sigpic NRA Benefactor Life Member / CRPA Life Member / SAF Life Member
    Calguns.net an incorported entity - President.
    The Calguns Shooting Sports Assoc. - Vice President.
    The California Rifle & Pistol Assoc. - Director.
    DONATE TO NRA-ILA, CGSSA, AND CRPAF NOW!
    Opinions posted in this account are my own and unless specifically stated as such are not the approved position of Calguns.net, CGSSA or CRPA.

    Comment

    • #17
      cyclopes85
      Member
      • May 2015
      • 191

      Tried to view the forum linked but the code snippets are only for members.

      Sent from my SM-G955U using Tapatalk

      Comment

      • #18
        bellts
        Senior Member
        • Sep 2011
        • 2378

        I would try to accomplish this in Javascript. Maybe using this jquery library:

        Justified.js
        jQuery Plugin to create Justified Image Gallery


        Pretty easy task...
        1) Have an javascript array of images which you can edit (when you add or drop an advertiser).
        2) Write a tiny (smart) random selector (which will give back the right amount of small banners, if one or more big banners was selected).
        3) Then use justified.js to arrange the banners to fit.

        ------------------------------------

        If I'm bored I might play with this tomorrow (and have a working demo). Something to keep my mind off of not having a job!
        Last edited by bellts; 05-15-2017, 5:42 PM.

        Comment

        • #19
          bellts
          Senior Member
          • Sep 2011
          • 2378

          Alright.... here's my (javascript based) proof of concept:



          The demo uses images (ads) which are sized in increments of 60px (to mimic current ops - standard ad right now is 120x60). I'm only using one image for the demo (each resized based on advert size) but each image that shows up is a unique advertisement (entry) which are selected randomly, and no duplicates. Each time the page is displayed it will randomly select images, and randomly place them in the table. Sometimes there will be a bunch of small ads. Sometimes large ads. Sometimes a good mix.... it's all random.

          There's a array of ads that someone must change when ads are added or dropped.

          Ex. of array entries:

          //really small ads
          ads.push({"id":"0","width":60,"height":60,"name":"Addax Tactical","img_url":"http://www.pathient.com/tbell/calguns/ads/Addax120x60.gif","link":"http://www.addaxtactical.com/"});

          //small ads
          ads.push({"id":"8","width":120,"height":60,"name":"Addax Tactical","img_url":"http://www.pathient.com/tbell/calguns/ads/Addax120x60.gif","link":"http://www.addaxtactical.com/"});

          //large ads
          ads.push({"id":"17","width":240,"height":60,"name":"Addax Tactical","img_url":"http://www.pathient.com/tbell/calguns/ads/Addax120x60.gif","link":"http://www.addaxtactical.com/"});

          //even larger ads
          ads.push({"id":"27","width":360,"height":60,"name":"Addax Tactical","img_url":"http://www.pathient.com/tbell/calguns/ads/Addax120x60.gif","link":"http://www.addaxtactical.com/"});

          //even larger larger ads
          ads.push({"id":"28","width":420,"height":60,"name":"Addax Tactical","img_url":"http://www.pathient.com/tbell/calguns/ads/Addax120x60.gif","link":"http://www.addaxtactical.com/"});

          .... and on and on up to 960px in width (or whatever ads_width_of_rows is set to -- see below).
          There are also two variables which must be changed if you want to add rows or change the width of the advertising table (in increments of 60 of course):

          var ads_num_of_rows = 2;
          var ads_width_of_rows = 960;
          Last edited by bellts; 05-17-2017, 9:09 AM.

          Comment

          • #20
            bellts
            Senior Member
            • Sep 2011
            • 2378

            Small update: added the ability always include a certain ad(s).

            To include a specific ad, call the "getRandomAds(specific_ad_id)" before calling the "showAds()" function.

            I.E.
            $(document).ready(function(){
            getRandomAds("4");
            getRandomAds("29");
            showAds();
            });
            If anyone needs a programmer (I've been doing this a long time) I'm in dire need of a job. I started/co-founded a business 7 years ago and it recently went under (investor pulled funding). I was working as the company's CTO (but basically doing everything). I'm also an ex-marine (combat vet) if that helps any.
            Last edited by bellts; 05-17-2017, 8:05 AM.

            Comment

            • #21
              deephouse
              Veteran Member
              • Sep 2012
              • 3858

              You can also call a file in the header and put all the custom ad edits in a separate file so that when it comes time to upgrade (again) you only have to know about that one insert line, and then the extra file with all the ad coding. Generally it's easier to call a separate file than to remember where all your in line edits are...


              Sent from my iPhone using Tapatalk

              Comment

              • #22
                deephouse
                Veteran Member
                • Sep 2012
                • 3858

                If you're also monitoring the click through rate on those header ads, I'm guessing you send reports to the advertisers so they can see how much traffic is going to their site via Calguns. That said a 300x250 "side bar" type ad is more visible and could be used for different types of ads (say) affiliate links for products. Or your could charge more from advertisers for impression based visibility that's not in contention with the other randomized ads in the header.

                I'm not saying what you're doing is wrong but there are other ways... "newer ways" if you will, to monetize ad space.

                The viewer pays the price being that the look starts to become cluttered, but in all honestly side ads are pretty standard on content pages, and I see them often in forums now too.
                AND obviously you run the risk of the viewer clicking off your site, but you could also run internal promotions in that ad space.... "click here to donate to Calguns"...contests, meetups, PSAs, etc.

                You'll have to ask yourself if that's the direction you want to head down - a more prominent ad as the viewer reads content. Or continue displaying ads that (for the most part) disappear once we scroll down to read content.

                Lastly - its possible that the newer version of BB has a plug-in or module designed for ads, and you wont have to customize things moving forward, just keep the ad module updated.

                Food for thought. I've run a CMS before, it's a lot of work, and you can't please everyone.
                Last edited by deephouse; 05-17-2017, 3:13 PM.

                Comment

                • #23
                  Noble Cause
                  Veteran Member
                  • Jan 2013
                  • 2633

                  Originally posted by Marauder2003
                  Please consider an automatic photo resizer to the board. Like
                  http://vbulletin-mods.com/forum/showthread.php?t=2456


                  This would be a nice feature to have.



                  Noble

                  Comment

                  Working...
                  UA-8071174-1