WordPress.org

Ready to get started?Download WordPress

Forums

Simple Ads Manager
Cannot Add Ads Places (8 posts)

  1. Interpolat
    Member
    Posted 2 years ago #

    I posted this to the SimpleLibs support forums but have not got support so far.

    I am failing to add new ads places. I have since deleted the plugin, deleting tables etc along the way, and reinstalled it, and still no luck. I have also gone into the wp-options table and deleted all SAM related entries.

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

  2. minimus
    Member
    Plugin Author

    Posted 2 years ago #

    I found not your message on the support forum...

  3. minimus
    Member
    Plugin Author

    Posted 2 years ago #

    Oops! Found...

  4. asmith86
    Member
    Posted 2 years ago #

    I am having the same problem. I try to save a new Place, but the page reloads and nothing happens.

  5. Interpolat
    Member
    Posted 2 years ago #

    What other plugins are you running?

  6. Latibro
    Member
    Posted 2 years ago #

    I had the same problem.

    Found the problem in the PHP log.
    The code was trying to add rows with '' as input for int or tityint fields, which MySQL didn't like.

    Here a couple of the errors from my PHP log (sorry it is in danish, by you properly get it anyway)

    [23-Jun-2012 15:31:12 UTC] WordPress-databasefejl Incorrect integer value: '' for column 'place_custom_width' at row 1 for forespørgslen INSERT INTO wp_sam_places (name,description,code_before,code_after,place_size,place_custom_width,place_custom_height,patch_img,patch_link,patch_code,patch_adserver,patch_dfp,patch_source,trash) VALUES ('','','','','300x250','','','https://www.google.com/help/hc/images/adsense_185665_adformat-text_300x250_da.png','','','','','0','') fra do_action('ads_page_sam-edit'), call_user_func_array, SimpleAdsManagerAdmin->samEditPage, SamPlaceEdit->page
    [23-Jun-2012 15:38:05 UTC] WordPress-databasefejl Incorrect integer value: '' for column 'patch_adserver' at row 1 for forespørgslen INSERT INTO wp_sam_places (name,description,code_before,code_after,place_size,place_custom_width,place_custom_height,patch_img,patch_link,patch_code,patch_adserver,patch_dfp,patch_source,trash) VALUES ('Sidebar','','','','300x250','300','250','https://www.google.com/help/hc/images/adsense_185665_adformat-text_300x250_da.png','Http://google.com','','','','0','') fra do_action('ads_page_sam-edit'), call_user_func_array, SimpleAdsManagerAdmin->samEditPage, SamPlaceEdit->page
    [23-Jun-2012 16:16:31 UTC] WordPress-databasefejl Incorrect integer value: '' for column 'trash' at row 1 for forespørgslen INSERT INTO wp_sam_places (name,description,code_before,code_after,place_size,place_custom_width,place_custom_height,patch_img,patch_link,patch_code,patch_adserver,patch_dfp,patch_source,trash) VALUES ('Sidebar','','','','300x250','0','0','https://www.google.com/help/hc/images/adsense_185665_adformat-text_300x250_da.png','Http://google.com','','0','','0','') fra do_action('ads_page_sam-edit'), call_user_func_array, SimpleAdsManagerAdmin->samEditPage, SamPlaceEdit->page

    I found and fixed the problem by changing some code in editor.admin.class.php at around line 244.

    $updateRow = array(
                  'name' => stripslashes($_POST['place_name']),
                  'description' => stripslashes($_POST['description']),
                  'code_before' => stripslashes($_POST['code_before']),
                  'code_after' => stripslashes($_POST['code_after']),
                  'place_size' => $_POST['place_size'],
                  //'place_custom_width' => $_POST['place_custom_width'],
                  'place_custom_width' => ($_POST['place_custom_width'] != '' ? $_POST['place_custom_width'] : 0),
                  //'place_custom_height' => $_POST['place_custom_height'],
                  'place_custom_height' => ($_POST['place_custom_height'] != '' ? $_POST['place_custom_height'] : 0),
                  'patch_img' => $_POST['patch_img'],
                  'patch_link' => stripslashes($_POST['patch_link']),
                  'patch_code' => stripslashes($_POST['patch_code']),
                  //'patch_adserver' => $_POST['patch_adserver'],
                  'patch_adserver' => ($_POST['patch_adserver'] == "1"? 1 : 0),
                  'patch_dfp' => $_POST['patch_dfp'],
                  'patch_source' => $_POST['patch_source'],
                  //'trash' => ($_POST['trash'] === 'true')
                  'trash' => ($_POST['trash'] === 'true' ? 1 : 0)
                );
                //$formatRow = array( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%s', '%d', '%d');
                $formatRow = array( '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s', '%s', '%d', '%s', '%d', '%d');

    I copied 5 lines, and commented out the original lines, and fixed the copied lines.

    Hope it helped others, and hopefully will be included in next update.

  7. Latibro
    Member
    Posted 2 years ago #

    Found out there where 3 more places in the code that had the same problem. Adding/updating zones, blocks and ads.

    I would have posted the fix here, but it would be easier to attach to files, which I can't do here.
    Then I registered at the forum, but I'm not allowed to create posts.

    So minimus is you want the fixes I did, then please let me know, I be more then happy the contribute to this project.

  8. minimus
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for help! You must confirm registration on support forum. I wait PM from you.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic