PHP Ad-Group Integration Check

Home Forums AdRotate for WordPress Adverts and Banners PHP Ad-Group Integration Check

This topic contains 7 replies, has 2 voices, and was last updated by  Arnan 1 year, 6 months ago.

  • #37304

    hleichsenring
    Badges:

    How can I check if an Ad-Group is existing and active?

    <?php echo adrotate_group(6); ?>

    If Group does not wxist, there Comes an error “Error, group does not exist! Check your syntax! (ID: 6)”.

    I just want to Show nothing.

    Cheers
    Hansjörg

    #37529

    Arnan
    Badges:

    Such errors only show (visibly) if you enable debug options in Settings > Maintenance.
    unticking all debug options should hide that output.

    #37546

    hleichsenring
    Badges:

    There are no debugg-Options active

    #37927

    Arnan
    Badges:

    I’ve checked on my test site – The error you mention exists, but is not visible to visitors without debug options on.

    But, make sure the group exists or remove the call to the group. There really is no point in publishing a group that doesn’t exist.
    If you try to load/publish links to a post or page that doesn’t exist you get an error, too. That’s just how websites work.

    #37939

    hleichsenring
    Badges:

    Hi. It makes sense! If the code is in the php file, I do not want to Change this every time a Group pauses. So it really would help to check via if/else in php if the Group exists. Is that not possible?

    #38012

    Arnan
    Badges:

    Not with functions from AdRotate (pro) no. As there is no output (or shouldn’t be) if the group is empty. The error you mention should only show if debug stuff is enabled.

    Maybe you’re looking at a cached page. I have no explanation for why the error shows – It shouldn’t be there if you disabled all debug option.

    #38018

    hleichsenring
    Badges:

    That is strange, because I am not aware of any debugg Option.

    Neverthesless it would be fine to have a php-option to clarify if a Group (or ad) is active or not, because if you have code before the af (i.e. “Advertisement”) this should not be shown either but now is.

    #38129

    Arnan
    Badges:

    Maybe in some situations that would be useful. But AdRotate (Pro) currently doesn’t offer that.

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘PHP Ad-Group Integration Check’ is closed to new replies.

You may be interested in