diff --git a/admin/easypopulate_4.php b/admin/easypopulate_4.php index bd0a40f..3ddd2cd 100644 --- a/admin/easypopulate_4.php +++ b/admin/easypopulate_4.php @@ -1,5 +1,5 @@ notify('EP4_START'); // Load language file(s) for main screen menu(s). -require(DIR_FS_ADMIN . DIR_WS_LANGUAGES . $_SESSION['language'] . '/easypopulate_4_menus.php'); +if(file_exists(DIR_FS_ADMIN . DIR_WS_LANGUAGES . $_SESSION['language'] . '/easypopulate_4_menus.php')) +{ + require(DIR_FS_ADMIN . DIR_WS_LANGUAGES . $_SESSION['language'] . '/easypopulate_4_menus.php'); +} else { + require(DIR_FS_ADMIN . DIR_WS_LANGUAGES . 'english' . '/easypopulate_4_menus.php'); +} // all mods go in this array as 'name' => 'true' if exist. eg $ep_supported_mods['psd'] => true means it exists. $ep_supported_mods = array(); @@ -344,7 +349,9 @@ function init() - + notify('EP4_ZC155_AFTER_HEADER'); + ?>
diff --git a/admin/easypopulate_4_attrib.php b/admin/easypopulate_4_attrib.php index e845e06..faecc72 100644 --- a/admin/easypopulate_4_attrib.php +++ b/admin/easypopulate_4_attrib.php @@ -1,5 +1,5 @@ bindVars($query, ':v_products_model', $v_products_model, 'string'); $result = ep_4_query($query); if (($ep_uses_mysqli ? mysqli_num_rows($result) : mysql_num_rows($result)) == 0) { // products_model is not in TABLE_PRODUCTS @@ -67,7 +68,9 @@ // HERE ==> language 1 is main key, and assumbed $l_id = 1; // temporary check - should this be the default language id? $query = "SELECT products_options_id, products_options_name FROM ".TABLE_PRODUCTS_OPTIONS." - WHERE products_options_name = '".$v_products_options_name[$l_id]."' AND language_id = '".$l_id."'"; + WHERE products_options_name = :v_products_options_name: AND language_id = :language_id:"; + $query = $db->bindVars($query, ':v_products_options_name:', $v_products_options_name[$l_id], 'string'); + $query = $db->bindVars($query, ':language_id:', $l_id, 'integer'); $result = ep_4_query($query); // insert new products_options_name @@ -88,7 +91,11 @@ $sql = "INSERT INTO ".TABLE_PRODUCTS_OPTIONS." (products_options_id, language_id, products_options_name, products_options_type) VALUES - ('$v_products_options_id', '".$l_id."', '".$v_products_options_name[$l_id]."', '".zen_db_input($v_products_options_type)."')"; + (:v_products_options_id:, :language_id:, :v_products_options_name:, :v_products_options_type:)"; + $sql = $db->bindVars($sql, ':v_products_options_id:', $v_products_options_id, 'integer'); + $sql = $db->bindVars($sql, ':language_id:', $l_id, 'integer'); + $sql = $db->bindVars($sql, ':v_products_options_name', $v_products_options_name[$l_id], 'string'); + $sql = $db->bindVars($sql, ':v_products_options_type', $v_products_options_type, 'integer'); $errorcheck = ep_4_query($sql); } $new_options_name++; @@ -141,9 +148,11 @@ .TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS." as a, " .TABLE_PRODUCTS_OPTIONS_VALUES." as b WHERE - a.products_options_id = '".$v_products_options_id."' AND + a.products_options_id = :v_products_options_id: AND a.products_options_values_id = b.products_options_values_id AND - b.products_options_values_name = '".$values_names_array[$l_id][$values_names_index]."'"; + b.products_options_values_name = :values_name:"; + $sql = $db->bindVars($sql, ':v_products_options_id:', $v_products_options_id, 'integer'); + $sql = $db->bindVars($sql, ':values_name:', $values_names_array[$l_id][$values_names_index], 'string'); $result4 = ep_4_query($sql); // if $result4 == 0, products_options_values_name not found @@ -158,10 +167,14 @@ products_options_values_name, products_options_values_sort_order) VALUES ( - '$products_options_values_id', - '".$l_id."', - '".$values_names_array[$l_id][$values_names_index]."', - '$products_options_values_sort_order')"; + :products_options_values_id:, + :language_id:, + :values_name:, + :products_options_values_sort_order:)"; + $sql = $db->bindVars($sql, ':products_options_values_id:', $products_options_values_id, 'integer'); + $sql = $db->bindVars($sql, ':language_id:', $l_id, 'integer'); + $sql = $db->bindVars($sql, ':values_name:', $values_names_array[$l_id][$values_names_index], 'string'); + $sql = $db->bindVars($sql, ':products_options_values_sort_order:', $products_options_values_sort_order, 'integer'); $errorcheck = ep_4_query($sql); } // foreach $new_options_values_name++; @@ -179,15 +192,16 @@ FROM " .TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS." WHERE - products_options_id = '".$v_products_options_id."' AND + products_options_id = :v_products_options_id: AND products_options_values_id = '0'"; + $sql5 = $db->bindVars($sql5, ':v_products_options_id:', $v_products_options_id, 'integer'); $result5 = ep_4_query($sql5); // if $result5 == 0, combination not found if (($ep_uses_mysqli ? mysqli_num_rows($result5) : mysql_num_rows($result5)) == 0) { // combination is not in TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS // insert new combination $errorcheck = ep_4_query("INSERT INTO ".TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS." (products_options_values_to_products_options_id, products_options_id, products_options_values_id) - VALUES('$products_options_values_to_products_options_id', '$v_products_options_id', '0')"); + VALUES(" . (int)$products_options_values_to_products_options_id . ", " . (int)$v_products_options_id . ", 0)"); } else { // duplicate entry, skip } } else { // add $products_options_values_id @@ -201,16 +215,18 @@ .TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS. " as a, " .TABLE_PRODUCTS_OPTIONS_VALUES. " as b WHERE - a.products_options_id = '".$v_products_options_id."' AND + a.products_options_id = :v_products_options_id: AND a.products_options_values_id = b.products_options_values_id AND - b.products_options_values_name = '".$values_names_array[$l_id][$values_names_index]."'"; + b.products_options_values_name = :values_name:"; + $sql5 = $db->bindVars($sql5, ':v_products_options_id', $v_products_options_id, 'integer'); + $sql5 = $db->bindVars($sql5, ':values_name:', $values_names_array[$l_id][$values_names_index], 'string'); $result5 = ep_4_query($sql5); // if $result5 == 0, combination not found if (($ep_uses_mysqli ? mysqli_fetch_array($result5) : mysql_num_rows($result5)) == 0) { // combination is not in TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS $errorcheck = ep_4_query("INSERT INTO ".TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS." (products_options_values_to_products_options_id, products_options_id, products_options_values_id) - VALUES('$products_options_values_to_products_options_id', '$v_products_options_id', '$products_options_values_id')"); + VALUES(" . (int)$products_options_values_to_products_options_id . ", " . (int)$v_products_options_id . ", " . (int)$products_options_values_id . ")"); } else { // duplicate entry, skip } } @@ -220,7 +236,7 @@ if (in_array($v_products_options_type, $exclude_array)) { // $errorcheck = ep_4_query("INSERT INTO ".TABLE_PRODUCTS_ATTRIBUTES." (products_id, options_id, options_values_id) - VALUES ('".$v_products_id."', '".$v_products_options_id."','0')"); + VALUES (".(int)$v_products_id.", ".(int)$v_products_options_id.",0)"); } else { $l_id = 1; // default first language is main key $sql5 = "SELECT @@ -232,9 +248,11 @@ .TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS. " as a, " .TABLE_PRODUCTS_OPTIONS_VALUES. " as b WHERE - a.products_options_id = '".$v_products_options_id."' AND + a.products_options_id = :v_products_options_id: AND a.products_options_values_id = b.products_options_values_id AND - b.products_options_values_name = '". $values_names_array[$l_id][$values_names_index]."'"; + b.products_options_values_name = :values_name:"; + $sql5 = $db->bindVars($sql5, ':v_products_options_id:', $v_products_options_id, 'integer'); + $sql5 = $db->bindVars($sql5, ':values_name:', $values_names_array[$l_id][$values_names_index], 'string'); $result5 = ep_4_query($sql5); $row5 = ($ep_uses_mysqli ? mysqli_fetch_array($result5) : mysql_fetch_array($result5)); @@ -247,23 +265,30 @@ $sql6 = "SELECT * FROM " .TABLE_PRODUCTS_ATTRIBUTES. " WHERE - products_id = '".$v_products_id."' AND - options_id = '".$v_products_options_id."' AND - options_values_id = '".$a_products_options_values_id."'"; + products_id = :v_products_id: AND + options_id = :v_products_options_id: AND + options_values_id = :a_products_options_values_id:"; + $sql6 = $db->bindVars($sql6, ':v_products_id:', $v_products_id, 'integer'); + $sql6 = $db->bindVars($sql6, ':v_products_options_id:', $v_products_options_id, 'integer'); + $sql6 = $db->bindVars($sql6, ':a_products_options_values_id:', $a_products_options_values_id, 'integer'); $result6 = ep_4_query($sql6); $row6 = ($ep_uses_mysqli ? mysqli_fetch_array($result6) : mysql_fetch_array($result6)); if (($ep_uses_mysqli ? mysqli_num_rows($result6) : mysql_num_rows($result6)) == 0) { $errorcheck = ep_4_query("INSERT INTO ".TABLE_PRODUCTS_ATTRIBUTES." (products_id, options_id, options_values_id) - VALUES ('".$v_products_id."', '".$v_products_options_id."','".$a_products_options_values_id."')"); + VALUES (".(int)$v_products_id.", ".(int)$v_products_options_id.",".(int)$a_products_options_values_id.")"); $table_products_attributes_update = 0; } else { // UPDATE $sql7 ="UPDATE ".TABLE_PRODUCTS_ATTRIBUTES." SET - products_options_sort_order ='".$values_names_index."' + products_options_sort_order = :values_names_index: WHERE - products_id = '".$v_products_id."' AND - options_id = '".$v_products_options_id."' AND - options_values_id = '".$a_products_options_values_id."'"; + products_id = :v_products_id: AND + options_id = :v_products_options_id: AND + options_values_id = :a_products_options_values_id:"; + $sql7 = $db->bindVars($sql7, ':values_names_index:', $values_names_index, 'integer'); + $sql7 = $db->bindVars($sql7, ':v_products_id:', $v_products_id, 'integer'); + $sql7 = $db->bindVars($sql7, ':v_products_options_id:', $v_products_options_id, 'integer'); + $sql7 = $db->bindVars($sql7, ':a_products_options_values_id:', $a_productsion_options_values_id, 'integer'); $errorcheck = ep_4_query($sql7); $table_products_attributes_update = 1; } @@ -300,4 +325,4 @@ } // END: if } // END: while #2 } // END: while #1 -?> \ No newline at end of file +?> diff --git a/admin/easypopulate_4_import.php b/admin/easypopulate_4_import.php index ed29d1f..7603697 100644 --- a/admin/easypopulate_4_import.php +++ b/admin/easypopulate_4_import.php @@ -1,5 +1,5 @@ = strtotime($v_featured_date_available)) && ($v_today < strtotime($v_expires_date))) { + if (isset($filelayout['v_expires_date']) && $items[$filelayout['v_expires_date']] > '0001-01-01') { + $v_expires_date = $items[$filelayout['v_expires_date']]; + } else { + $v_expires_date = '0001-01-01'; + } + if (isset($filelayout['v_featured_date_available']) && $items[$filelayout['v_featured_date_available']] > '0001-01-01') { + $v_featured_date_available = $items[$filelayout['v_featured_date_available']]; + } else { + $v_featured_date_available = '0001-01-01'; + } + if (($v_today >= strtotime($v_featured_date_available)) && ($v_today < strtotime($v_expires_date)) || ($v_today >= strtotime($v_featured_date_available) && $v_featured_date_available != '0001-01-01' && $v_expires_date == '0001-01-01') || ($v_featured_date_available == '0001-01-01' && $v_expires_date == '0001-01-01' && (defined('EP4_ACTIVATE_BLANK_FEATURED') ? EP4_ACTIVATE_BLANK_FEATURED : true))) { $v_status = 1; $v_date_status_change = date("Y-m-d"); } else { @@ -187,9 +195,17 @@ $max_featured_id = 1; } $v_today = strtotime(date("Y-m-d")); - $v_expires_date = $items[$filelayout['v_expires_date']]; - $v_featured_date_available = $items[$filelayout['v_featured_date_available']]; - if (($v_today >= strtotime($v_featured_date_available)) && ($v_today < strtotime($v_expires_date))) { + if (isset($filelayout['v_expires_date']) && $items[$filelayout['v_expires_date']] > '0001-01-01') { + $v_expires_date = $items[$filelayout['v_expires_date']]; + } else { + $v_expires_date = '0001-01-01'; + } + if (isset($filelayout['v_featured_date_available']) && $items[$filelayout['v_featured_date_available']] > '0001-01-01') { + $v_featured_date_available = $items[$filelayout['v_featured_date_available']]; + } else { + $v_featured_date_available = '0001-01-01'; + } + if (($v_today >= strtotime($v_featured_date_available)) && ($v_today < strtotime($v_expires_date)) || ($v_today >= strtotime($v_featured_date_available) && $v_featured_date_available != '0001-01-01' && $v_expires_date == '0001-01-01') || ($v_featured_date_available == '0001-01-01' && $v_expires_date == '0001-01-01' && (defined('EP4_ACTIVATE_BLANK_FEATURED') ? EP4_ACTIVATE_BLANK_FEATURED : true))) { $v_status = 1; $v_date_status_change = date("Y-m-d"); } else { @@ -947,7 +963,7 @@ if (isset($filelayout['v_products_name_' . $l_id])) { // do for each language in our upload file if exist // check products name length and display warning on error, but still process record $v_products_name[$l_id] = ep_4_curly_quotes($items[$filelayout['v_products_name_' . $l_id]]); - if (mb_strlen($v_products_name[$l_id]) > $products_name_max_len) { + if ((function_exists('mb_strlen') && mb_strlen($v_products_name[$l_id]) > $products_name_max_len) || (!function_exists('mb_strlen') && strlen($v_products_name[$l_id]) > $products_name_max_len)) { $display_output .= sprintf(EASYPOPULATE_4_DISPLAY_RESULT_PRODUCTS_NAME_LONG, $v_products_model, $v_products_name[$l_id], $products_name_max_len); $ep_warning_count++; } @@ -976,7 +992,7 @@ if (isset($filelayout['v_products_url_' . $l_id])) { // do for each language in our upload file if exist $v_products_url[$l_id] = $items[$filelayout['v_products_url_' . $l_id]]; // check products url length and display warning on error, but still process record - if (mb_strlen($v_products_url[$l_id]) > $products_url_max_len) { + if ((function_exists('mb_strlen') && mb_strlen($v_products_url[$l_id]) > $products_url_max_len) || (!function_exists('mb_strlen') && strlen($v_products_url[$l_id]) > $products_url_max_len)) { $display_output .= sprintf(EASYPOPULATE_4_DISPLAY_RESULT_PRODUCTS_URL_LONG, $v_products_model, $v_products_url[$l_id], $products_url_max_len); $ep_warning_count++; } @@ -1015,7 +1031,7 @@ $v_date_avail = ($v_date_avail == true && $v_date_avail > "0001-01-01") ? date("Y-m-d H:i:s", strtotime($v_date_avail)) : "NULL"; // if products has been added before, do not change, else use current time stamp - $v_date_added = ($v_date_added == true & $v_date_added > "0001-01-01") ? date("Y-m-d H:i:s", strtotime($v_date_added)) : "CURRENT_TIMESTAMP"; + $v_date_added = ($v_date_added == true && $v_date_added > "0001-01-01") ? date("Y-m-d H:i:s", strtotime($v_date_added)) : "CURRENT_TIMESTAMP"; // default the stock if they spec'd it or if it's blank // $v_db_status = '1'; // default to active @@ -1043,7 +1059,7 @@ } // check size of v_products_model, loop on error - if (mb_strlen($v_products_model) > $products_model_max_len) { + if ((function_exists('mb_strlen') && mb_strlen($v_products_model) > $products_model_max_len) || (!function_exists('mb_strlen') && strlen($v_products_model) > $products_model_max_len)) { $display_output .= sprintf(EASYPOPULATE_4_DISPLAY_RESULT_PRODUCTS_MODEL_LONG, $v_products_model, $products_model_max_len); $ep_error_count++; continue; // short-circuit on error @@ -1051,7 +1067,7 @@ // BEGIN: Manufacturer's Name // convert the manufacturer's name into id's for the database - if (isset($v_manufacturers_name) && ($v_manufacturers_name != '') && (mb_strlen($v_manufacturers_name) <= $manufacturers_name_max_len)) { + if (isset($v_manufacturers_name) && ($v_manufacturers_name != '') && ((function_exists('mb_strlen') && mb_strlen($v_manufacturers_name) <= $manufacturers_name_max_len) || (!function_exists('mb_strlen') && strlen($v_manufacturers_name) <= $manufacturers_name_max_len))) { $sql = "SELECT man.manufacturers_id AS manID FROM " . TABLE_MANUFACTURERS . " AS man WHERE man.manufacturers_name = :manufacturers_name: LIMIT 1"; $sql = $db->bindVars($sql, ':manufacturers_name:', $v_manufacturers_name, 'string'); @@ -1084,7 +1100,7 @@ } } } else { // $v_manufacturers_name == '' or name length violation - if (mb_strlen($v_manufacturers_name) > $manufacturers_name_max_len) { + if ((function_exists('mb_strlen') && mb_strlen($v_manufacturers_name) > $manufacturers_name_max_len) || (!function_exists('mb_strlen') && strlen($v_manufacturers_name) > $manufacturers_name_max_len)) { $display_output .= sprintf(EASYPOPULATE_4_DISPLAY_RESULT_MANUFACTURER_NAME_LONG, $v_manufacturers_name, $manufacturers_name_max_len); $ep_error_count++; continue; @@ -1106,17 +1122,20 @@ $categories_delimiter = $category_delimiter; // add this to configuration variables // get all defined categories foreach ($langcode as $key => $lang) { + if (!function_exists('mb_split')) { // iso-8859-1 - // $categories_names_array[$lang['id']] = explode($categories_delimiter,$items[$filelayout['v_categories_name_'.$lang['id']]]); + $categories_names_array[$lang['id']] = explode($categories_delimiter,$items[$filelayout['v_categories_name_'.$lang['id']]]); + } else { // utf-8 - $categories_names_array[$lang['id']] = mb_split(preg_quote($categories_delimiter), $items[$filelayout['v_categories_name_' . $lang['id']]]); + $categories_names_array[$lang['id']] = mb_split(preg_quote($categories_delimiter), $items[$filelayout['v_categories_name_' . $lang['id']]]); + } // get the number of tokens in $categories_names_array[] $categories_count[$lang['id']] = count($categories_names_array[$lang['id']]); // check category names for length violation. abort on error if ($categories_count[$lang['id']] > 0) { // only check $categories_name_max_len if $categories_count[$lang['id']] > 0 for ($category_index = 0; $category_index < $categories_count[$lang['id']]; $category_index++) { - if (mb_strlen($categories_names_array[$lang['id']][$category_index]) > $categories_name_max_len) { + if ((function_exists('mb_strlen') && mb_strlen($categories_names_array[$lang['id']][$category_index]) > $categories_name_max_len) || (!function_exists('mb_strlen') && strlen($categories_names_array[$lang['id']][$category_index]))) { $display_output .= sprintf(EASYPOPULATE_4_DISPLAY_RESULT_CATEGORY_NAME_LONG, ${$chosen_key}, $categories_names_array[$lang['id']][$category_index], $categories_name_max_len); $ep_error_count++; continue 3; // skip to next record @@ -1256,7 +1275,7 @@ // HERE ==========================> // BEGIN: record_artists if (isset($filelayout['v_artists_name'])) { - if (isset($v_artists_name) && ($v_artists_name != '') && (mb_strlen($v_artists_name) <= $artists_name_max_len)) { + if (isset($v_artists_name) && ($v_artists_name != '') && ((function_exists('mb_strlen') && mb_strlen($v_artists_name) <= $artists_name_max_len) || (!function_exists('mb_strlen') && strlen($v_artists_name) <= $artists_name_max_len))) { $sql = "SELECT artists_id AS artistsID FROM " . TABLE_RECORD_ARTISTS . " WHERE artists_name = :artists_name: LIMIT 1"; $sql = $db->bindVars($sql, ':artists_name:', ep_4_curly_quotes($v_artists_name), 'string'); $result = ep_4_query($sql); @@ -1326,7 +1345,7 @@ } } } else { // $v_artists_name == '' or name length violation - if (mb_strlen($v_artists_name) > $artists_name_max_len) { + if ((function_exists('mb_strlen') && mb_strlen($v_artists_name) > $artists_name_max_len) || (!function_exists('mb_strlen') && strlen($v_artists_name) > $artists_name_max_len)) { $display_output .= sprintf(EASYPOPULATE_4_DISPLAY_RESULT_ARTISTS_NAME_LONG, $v_artists_name, $artists_name_max_len); $ep_error_count++; continue; @@ -1339,7 +1358,7 @@ // HERE ==========================> // BEGIN: record_company if (isset($filelayout['v_record_company_name'])) { - if (isset($v_record_company_name) && ($v_record_company_name != '') && (mb_strlen($v_record_company_name) <= $record_company_name_max_len)) { + if (isset($v_record_company_name) && ($v_record_company_name != '') && ((function_exists('mb_strlen') && mb_strlen($v_record_company_name) <= $record_company_name_max_len) || (!function_exists('mb_strlen') && strlen($v_record_company_name) <= $record_company_name_max_len))) { $sql = "SELECT record_company_id AS record_companyID FROM " . TABLE_RECORD_COMPANY . " WHERE record_company_name = :record_company_name: LIMIT 1"; $sql = $db->bindVars($sql, ':record_company_name:', ep_4_curly_quotes($v_record_company_name), 'string'); $result = ep_4_query($sql); @@ -1395,7 +1414,7 @@ } } } else { // $v_record_company_name == '' or name length violation - if (mb_strlen($v_record_company_name) > $record_company_name_max_len) { + if ((function_exists('mb_strlen') && mb_strlen($v_record_company_name) > $record_company_name_max_len) || (!function_exists('mb_strlen') && strlen($v_record_company_name) > $record_company_name_max_len)) { $display_output .= sprintf(EASYPOPULATE_4_DISPLAY_RESULT_RECORD_COMPANY_NAME_LONG, $v_record_company_name, $record_company_name_max_len); $ep_error_count++; continue; @@ -1408,7 +1427,7 @@ // HERE ==========================> // BEGIN: music_genre if (isset($filelayout['v_music_genre_name'])) { - if (isset($v_music_genre_name) && ($v_music_genre_name != '') && (mb_strlen($v_music_genre_name) <= $music_genre_name_max_len)) { + if (isset($v_music_genre_name) && ($v_music_genre_name != '') && ((function_exists('mb_strlen') && mb_strlen($v_music_genre_name) <= $music_genre_name_max_len) || (!function_exists('mb_strlen') && strlen($v_music_genre_name) <= $music_genre_name_max_len))) { $sql = "SELECT music_genre_id AS music_genreID FROM " . TABLE_MUSIC_GENRE . " WHERE music_genre_name = :music_genre_name: LIMIT 1"; $sql = $db->bindVars($sql, ':music_genre_name:', $v_music_genre_name, 'string'); $result = ep_4_query($sql); @@ -1425,7 +1444,7 @@ $v_music_genre_id = ($ep_uses_mysqli ? mysqli_insert_id($db->link) : mysql_insert_id()); // id is auto_increment } } else { // $v_music_genre_name == '' or name length violation - if (mb_strlen($v_music_genre_name) > $music_genre_name_max_len) { + if ((function_exists('mb_strlen') && mb_strlen($v_music_genre_name) > $music_genre_name_max_len) || (!function_exists('mb_strlen') && strlen($v_music_genre_name) > $music_genre_name_max_len)) { $display_output .= sprintf(EASYPOPULATE_4_DISPLAY_RESULT_MUSIC_GENRE_NAME_LONG, $v_music_genre_name, $music_genre_name_max_len); $ep_error_count++; continue; @@ -1646,6 +1665,10 @@ // CHADD - why is master_categories_id not being set on update??? //mc12345678 Because on update, the category was already set, on the first upload it was set to be the master_category_id, but now the product is merely updated to add the category(ies) to it, not to update the master_category_id which should be done on a separate transaction. $query = "UPDATE " . TABLE_PRODUCTS . " SET products_price = :products_price:, "; + + if ($chosen_key != '' && $chosen_key != 'v_products_model' && isset($filelayout['v_products_model']) && !in_array('products_model', $custom_fields)) { + $query .= "products_model = :products_model:, "; + } if ($ep_supported_mods['uom'] == true) { // price UOM mod $query .= "products_price_uom = :products_price_uom:, "; } @@ -1674,7 +1697,7 @@ if (count($custom_fields) > 0) { foreach ($custom_fields as $field) { $value = 'v_' . $field; - if ($filelayout[$value]) { + if (isset($filelayout[$value])) { $query .= ":field: = :value:, "; $query = $db->bindVars($query, ':field:', $field, 'noquotestring'); $query = $db->bindVars($query, ':value:', ${$value}, 'string'); @@ -1704,6 +1727,7 @@ metatags_price_status = :metatags_price_status:, metatags_title_tagline_status = :metatags_title_tagline_status: WHERE (products_id = :products_id:)"; + $query = $db->bindVars($query, ':products_model:', $v_products_model , 'string'); $query = $db->bindVars($query, ':products_price:', $v_products_price , 'currency'); $query = $db->bindVars($query, ':products_price_uom:', $v_products_price_uom , 'currency'); $query = $db->bindVars($query, ':products_upc:', $v_products_upc, 'string'); diff --git a/admin/includes/functions/extra_functions/easypopulate_4_functions.php b/admin/includes/functions/extra_functions/easypopulate_4_functions.php index e051744..86a8508 100644 --- a/admin/includes/functions/extra_functions/easypopulate_4_functions.php +++ b/admin/includes/functions/extra_functions/easypopulate_4_functions.php @@ -1,5 +1,5 @@ ).

false (Default)
true.', ".$group_id.", '90', NULL, now(), NULL, 'zen_cfg_select_option(array(\'false\', \'true\'),'), + ('Activate Blank Featured', 'EP4_ACTIVATE_BLANK_FEATURED', 'true', 'On import, if the available date and expiry date are both blank, 0, 0001-01-01, or not imported, should the featured product be made automatically active?
(yes=true or no=false)
(Default: yes)', ".$group_id.", '95', NULL, now(), NULL, 'zen_cfg_select_option(array(\'false\', \'true\'),'), ('Make Zero Qty Products Inactive', 'EASYPOPULATE_4_CONFIG_ZERO_QTY_INACTIVE', 'false', 'When uploading, make the status Inactive for products with zero qty (default: false).', ".$group_id.", '100', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'), ('Smart Tags Replacement of Newlines', 'EASYPOPULATE_4_CONFIG_SMART_TAGS', 'true', 'Allows your description fields in your uploads file to have carriage returns and/or new-lines converted to HTML line-breaks on uploading, thus preserving some rudimentary formatting - Note: this legacy code is disabled until further review. (default: true).', ".$group_id.", '110', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'), ('Advanced Smart Tags', 'EASYPOPULATE_4_CONFIG_ADV_SMART_TAGS', 'false', 'Allow the use of complex regular expressions to format descriptions, making headings bold, add bullets, etc. Note: legacy code is disabled until further review. (default: false).', ".$group_id.", '120', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'), @@ -570,6 +571,7 @@ function install_easypopulate_4() { ('Verbose Feedback', 'EASYPOPULATE_4_CONFIG_VERBOSE', 'true', 'When importing, report all messages. Set to false for only warnings and errors. (default: true).', ".$group_id.", '70', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'), ('Show all EP4 Filetypes with Files', 'EP4_SHOW_ALL_FILETYPES', 'true', 'When looking at the EP4 Tools screen, should the filename prefix for all specific file types be displayed for all possible file types (true [default]), should only the method(s) that will be used to process the files present be displayed (false), or should there be no assistance be provided on filenaming on the main page (Hidden) like it was until this feature was added? (true, false, or Hidden)', ".$group_id.", '80', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\", \"Hidden\"),'), ('Replace Blank Image', 'EP4_REPLACE_BLANK_IMAGE', 'false', 'On import, if the image information is blank, then update the image path to the path of the blank image (true)? Otherwise the image path will remain blank (false ).

false (Default)
true.', ".$group_id.", '90', NULL, now(), NULL, 'zen_cfg_select_option(array(\'false\', \'true\'),'), + ('Activate Blank Featured', 'EP4_ACTIVATE_BLANK_FEATURED', 'true', 'On import, if the available date and expiry date are both blank, 0, 0001-01-01, or not imported, should the featured product be made automatically active?
(yes=true or no=false)
(Default: yes)', ".$group_id.", '95', NULL, now(), NULL, 'zen_cfg_select_options(array(\'false\', \'true\'),'), ('Make Zero Qty Products Inactive', 'EASYPOPULATE_4_CONFIG_ZERO_QTY_INACTIVE', 'false', 'When uploading, make the status Inactive for products with zero qty (default: false).', ".$group_id.", '100', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'), ('Smart Tags Replacement of Newlines', 'EASYPOPULATE_4_CONFIG_SMART_TAGS', 'true', 'Allows your description fields in your uploads file to have carriage returns and/or new-lines converted to HTML line-breaks on uploading, thus preserving some rudimentary formatting - Note: this legacy code is disabled until further review. (default: true).', ".$group_id.", '110', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'), ('Advanced Smart Tags', 'EASYPOPULATE_4_CONFIG_ADV_SMART_TAGS', 'false', 'Allow the use of complex regular expressions to format descriptions, making headings bold, add bullets, etc. Note: legacy code is disabled until further review. (default: false).', ".$group_id.", '120', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'), diff --git a/changelog.txt b/changelog.txt index e4cb469..4133b4f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -292,3 +292,21 @@ be properly formatted regex type expression. The UTF-8 version of the character was not properly formatted and no further action was taken on the variable (until now). This restores EP4 to its full functionality before attempting to make that improvement. +4.0.35 04/29/2016 Added an additional notifier to follow the loading of the admin's header.php file. The header.php + file also loads JQuery, such that if JQuery was loaded in an earlier notifier, it would be + overridden within the header.php file when JQuery is loaded without consideration of previous + loadings/presence. + Full upgrade requires remove/install of the configuration settings, otherwise this version added a + default to activate featured product that have an expiration date that is "blank" (0001-01-01) + Added a notifier to follow loading the admin header.php file to support adding jquery related loads in + a logical location rather than forcing the use of an alternative notifier. + Modified the import of featured product to expand the capability and use of featured + product management. + Incorporated data cleaning on import of basic attributes. + Modified import file to fallback to strlen comparison if mb_strlen is not installed/active on a site. + Expanded the use of the code with systems that do not have mb_ + Added language fallback to english capability if the SESSION['language'] folder does not exist for EP4 menus. + Modified one import bitwise operator to a comparison operator (& to &&). +4.0.35.ZC 04/29/2016 Modified version number as github contained 4.0.35 and wanted to be sure that users that downloaded + that version would receive notification of the updated file. This is the version + submitted to ZC. \ No newline at end of file