dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: Embarrassing 'n00b' question...

  1. #1
    Join Date
    Jun 2013
    Posts
    11

    Embarrassing 'n00b' question...

    I'm a designer who used to hand off his work to coders to finish, but ended up picking up a thing or two about programming over the years. Nowhere near as much as you guys, just enough to get by.

    I have a webpage I need to modify (that I did not create) that has an interstitial ad on it. This ad needs to disappear. It might come back later, but for now, we want it gone. Ideally, by modifying as little code as possible.

    After searching for every instance of the word "interstitial" on the page, I found these two small scripts :

    <script type="text/javascript">
    function pmc_ads_interruptus_single() {
    if ( typeof pmc == 'undefined' || ! pmc ) {
    return;
    }

    var home_url = "http://website.com";
    var endpoints = ["interstitial"];
    var current_url = window.location.href;

    for ( var i = 0; i < endpoints.length; i++ ) {
    if ( pmc.is_empty( endpoints[ i ] ) ) {
    continue;
    }

    var endpoint = endpoints[ i ].toLowerCase();

    //check cookie
    var yummy_cookie = pmc.cookie.get( endpoint );

    if ( ! pmc.is_empty( yummy_cookie ) ) {
    //cookie is set, skip to next endpoint
    continue;
    }

    //cookie not set, save current_url in cookie
    pmc.cookie.set( 'pmc_interrupted_url', encodeURIComponent( current_url ), 300, '/' );

    //redirect to endpoint url
    window.location.href = home_url + "/" + endpoint + "/";

    //exit this loop
    break;
    }
    }

    pmc_ads_interruptus_single();
    </script>
    <script type="text/javascript">
    var pmc_gallery_jsdata = { "gallery_first":0,"ad_click":"2","ad_interstitial":"","interstitial_duration":"","interstitial_start ":0,"shortcode":"0","interstitial_ad_code":"" };
    </script>
    I thought I could solve this on my own, but I was wrong. I tried minor integer modifications (no effect) and even removing both scripts (seems to affect other areas on the site).

    Is the quoted code above enough to work with to simply turn the darn interstitial off for a while? I bet all I had to do all along was change one word. But which?

    Thx!

  2. #2
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,434
    What sort of changes have you attempted that did not work and what were the error console messages you received?
    Do you have an active link to the site with all relevant code?

    Have you tried something as simple as? :
    // pmc_ads_interruptus_single();

    Suggestion: Might want to remove all cookie settings during testing mode
    in case finding the active cookie results bypass all your JS removal attempts.

  3. #3
    Join Date
    Jun 2013
    Posts
    11
    All tests involving minor changes (like changing a 0 to a 1 or a "") made zero difference.

    Removing the function completely (by deleting the whole thing) worked, but it affected other ads on the site (they're *all* gone). We just want to get rid of the interstitial for now.

    The people I work with would rather these files not be shared publicly for now (so I deferred to Plan B, just posting the 2 scripts I found).

    I tried your suggestion, and it had the same effect as removing the function completely (see above).

  4. #4
    Join Date
    Jun 2013
    Posts
    11
    Hold on, I think I just uncovered another problem in the code that was responsible for all the ads disappearing when the interstitial did. As of my writing this, your suggestion actually does the trick. Issue resolved for now. Thanks!

    With pmc_ads_interruptus_single(); commented out at your suggestion, what happens to the cookies? Do they still get saved even though there's no reason for them?

  5. #5
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,434
    Presumably the cookies are saved per other parts of your command query code (not shown)
    but the removal of the check function, pmc_ads_interrupts_single(), just doesn't look at them.

  6. #6
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,499
    What about breaking the HTML code objects that are attached to the adverts?

    <!-- comment them out !!! -->
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles