Latibro
Forum Replies Created
-
Forum: Plugins
In reply to: [Simple Ads Manager] [Plugin: Simple Ads Manager] Cannot Add Ads PlacesFound 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.
Forum: Plugins
In reply to: [Simple Ads Manager] [Plugin: Simple Ads Manager] Cannot Add Ads PlacesI 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 (”,”,”,”,’300×250′,”,”,’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 INTOwp_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’,”,”,”,’300×250′,’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 INTOwp_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’,”,”,”,’300×250′,’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->pageI 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.