WordPress.org

Ready to get started?Download WordPress

Forums

Simple Ads Manager
ad.class.php errors in Ad Zone assignment (10 posts)

  1. Martin
    Member
    Posted 1 year ago #

    I'm getting errors when I try to enable a zone in an Ad Block.

    It works just fine with 2x2 125x125px Ad Block with a seperate Ad Place assigned to each 'square'.

    What I wanted to do was have a different Ad Place (one for business and another for personal) assigned to an Ad Zone.
    Once I set this up, and assigned that Ad Zone to the 125x125px Ad Block, I get these errors:

    Warning: Invalid argument supplied for foreach() in /home/xxxx/public_html/xxxx/wp-content/plugins/simple-ads-manager/ad.class.php on line 614
    Warning: Invalid argument supplied for foreach() in /home/xxxx/public_html/xxxx/wp-content/plugins/simple-ads-manager/ad.class.php on line 623

    Any ideas what I've done wrong here?
    Martin

    http://wordpress.org/extend/plugins/simple-ads-manager/

  2. Ankur
    Member
    Posted 1 year ago #

    I'm also experiencing the same error, not sure what is causing it. Anyone have a solution?

  3. mag_pelon
    Member
    Posted 1 year ago #

    Hi guys i got the same problem, and just comment this line for the moment and all works great the file name is \wp-content\plugins\simple-ads-manager/add.class.php

    the line commented was: 614-616

    /*foreach($cats as $key => $value) {
    if($value < 0) $cats[$key] = $zone['z_category'];
    }*/

    And the lines: 623-625
    /*foreach($archiveCT as $key => $value) {
    if($value < 0) $archiveCT[$key] = $zone['z_cts'];
    }*/

  4. Tim Nolan
    Member
    Posted 1 year ago #

    Having the same problem.
    Tim Nolan

  5. davedg629
    Member
    Posted 1 year ago #

    Having the same issue, but I'll note that it's only when my site is being browsed with the mobile version (the theme is switched using the w3 total cache plugin, caching is turned off though).

  6. lop_cz
    Member
    Posted 1 year ago #

    These errors are caused by wrongly saved values in Zone editor.
    It's fine if you create new Zone, but once you update anything in it, values for DB fields "z_cats" and "z_archive_ct" are saved in wrong format.

    The solution is pretty simple:
    In zone.editor.admin.class.php just uncomment the line 156 that starts with //FIXED $formatRow = ... and comment out the next line 157.

    This is probably just an overlooked bug because the correct format for DB fields is actually the first one and not the second.

    And you don't have to modify ad.class.php in any way.

  7. Usarralde
    Member
    Posted 1 year ago #

    Good morning,

    Today I disabled the plugin Wp Spam free, and have seen the error:

    Warning: Invalid argument supplied for foreach() in
    XXXXXXXXXXXXXX/hotelistico.com/wp-content/plugins/simple-ads-manager/ad.class.php on line 614
    and : /plugins/simple-ads-manager/ad.class.php on line 623

    I deleted the cache and WP Super Cache plugin too I disconnected, but still leaving the error. I deleted the line lop_cz (( with //FIXED $formatRow = ... and comment out the next line 157.))) and still gives me the error.

    My solution: do not disconnect the Wp Spam free.

    regards

  8. lop_cz
    Member
    Posted 1 year ago #

    Maybe I haven't said it clearly.

    You have to comment out or delete the line 157 and uncomment the line 156 by deleting just the //FIXED part and not the whole line.
    Then you have to update every Zone in Zone editor so the correct values are saved once again.
    You may have to look at the table wp_sam_zone in DB and check if "z_cats" and "z_archive_ct" fields contain serialized array and not a '0' string.

    I don't know about WP Spam Free plugin, but I don't think it has anything to do with this issue.

    I hope this bug will be corrected soon by the developer.

  9. s10
    Member
    Posted 1 year ago #

    Had the same problem. Made it like lop_cz was describing - and working now!

    Thanks to lp_cz

  10. batusy
    Member
    Posted 1 year ago #

    I have the same problem with the latest version of worpress 3.6

    I've solved with the indications of mag_pelon:

    the line commented was: 614-616

    /*foreach($cats as $key => $value) {
    if($value < 0) $cats[$key] = $zone['z_category'];
    }*/

    And the lines: 623-625
    /*foreach($archiveCT as $key => $value) {
    if($value < 0) $archiveCT[$key] = $zone['z_cts'];
    }*/

    We hope to officially correct author

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.