Skip to content

Commit df067fa

Browse files
author
mc12345678
committed
v4.0.28 01-03-2015 mc12345678 easypopulate_4
Updated to bring compatibility of ZC 1.5.4 including the backward compatible files recommended by lat9 to support logging of admin changes (in this case made through EP4). Also modified method of version checking to open compatibility checking to ever future versions of ZC. There may need to be different result response in the future, but at the moment there is only a true/false result/evaluation.
1 parent e36c193 commit df067fa

File tree

7 files changed

+272
-47
lines changed

7 files changed

+272
-47
lines changed

README.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Also there is NO streaming upload or download support. Sorry if you liked this f
3434

3535
6) Basic Attribute Import. Please read the notes below carefully for how to use this feature which is still in development. Currently, you can at Import create your products_options_name (your attribute name, ie. color) , products_options_type (checkbox, dropdown, etc) and, products_options_values_name (red, green, blue).
3636

37-
Be sure to backup your data before importing your files. Remember, this is still "beta". I have made every attempt to make this a solid bug free product, but it does require more testing. I have added a lot of error trapping, but I'm sure I've missed things.
37+
LASTLY but definitely not LEAST and applicable to all of EP4: Be sure to backup your data before importing your files. Remember, this is still "beta". I have made every attempt to make this a solid bug free product, but it does require more testing. I have added a lot of error trapping, but I'm sure I've missed things.
3838

3939

4040
IMPORTING ATTRIBUTES

admin/easypopulate_4.php

+25-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
// $Id: easypopulate_4.php, v4.0.28 11-25-2014 mc12345678 $
2+
// $Id: easypopulate_4.php, v4.0.28 01-03-2015 mc12345678 $
33

44
// CSV VARIABLES - need to make this configurable in the ADMIN
55
// $csv_delimiter = "\t"; // "\t" = tab AND "," = COMMA
@@ -26,7 +26,7 @@
2626
$ep_char_92 = (int)EASYPOPULATE_4_CONFIG_CHAR_92;
2727
$ep_metatags = (int)EASYPOPULATE_4_CONFIG_META_DATA; // 0-Disable, 1-Enable
2828
$ep_music = (int)EASYPOPULATE_4_CONFIG_MUSIC_DATA; // 0-Disable, 1-Enable
29-
$ep_uses_mysqli = (PROJECT_VERSION_MAJOR.'.'.PROJECT_VERSION_MINOR == '1.5.3' ? true : false);
29+
$ep_uses_mysqli = (PROJECT_VERSION_MAJOR > '1' || PROJECT_VERSION_MINOR >= '5.3' ? true : false);
3030

3131
@set_time_limit($ep_execution); // executin limit in seconds. 300 = 5 minutes before timeout, 0 means no timelimit
3232

@@ -47,7 +47,7 @@
4747
/* Test area end */
4848

4949
// Current EP Version - Modded by Chadd
50-
$curver = '4.0.28 - Beta 11-25-2014';
50+
$curver = '4.0.28 - Beta 01-03-2015';
5151
$display_output = ''; // results of import displayed after script run
5252
$ep_dltype = NULL;
5353
$ep_stack_sql_error = false; // function returns true on any 1 error, and notifies user of an error
@@ -170,6 +170,13 @@
170170
// default langauage should not be important since all installed languages are used $langcode[]
171171
// and we should iterate through that array (even if only 1 stored value)
172172
// $epdlanguage_id is used only in categories generation code since the products import code doesn't support multi-language categories
173+
/* @var $epdlanguage_query type array */
174+
//$epdlanguage_query = $db->Execute("SELECT languages_id, name FROM ".TABLE_LANGUAGES." WHERE code = '".DEFAULT_LANGUAGE."'");
175+
if (!defined(DEFAULT_LANGUAGE)) {
176+
$epdlanguage_query = ep_4_query("SELECT languages_id, code FROM ".TABLE_LANGUAGES." ORDER BY languages_id LIMIT 1");
177+
$epdlanguage = ($ep_uses_mysqli ? mysqli_fetch_array($epdlanguage_query) : mysql_fetch_array($epdlanguage_query));
178+
define('DEFAULT_LANGUAGE', $epdlanguage['code']);
179+
}
173180
$epdlanguage_query = ep_4_query("SELECT languages_id, name FROM ".TABLE_LANGUAGES." WHERE code = '".DEFAULT_LANGUAGE."'");
174181
if (($ep_uses_mysqli ? mysqli_num_rows($epdlanguage_query) : mysql_num_rows($epdlanguage_query))) {
175182
$epdlanguage = ($ep_uses_mysqli ? mysqli_fetch_array($epdlanguage_query) : mysql_fetch_array($epdlanguage_query));
@@ -186,7 +193,13 @@
186193
if ( isset($_GET['export2']) ) { // working on attributes export
187194
include_once('easypopulate_4_export2.php'); // this file contains all data import code
188195
} */
189-
196+
$ep4CEONURIDoesExist = false;
197+
if (ep_4_CEONURIExists() == true) {
198+
$ep4CEONURIDoesExist = true;
199+
if (!sizeof($languages)) {
200+
$languages = zen_get_languages();
201+
}
202+
}
190203
if ( isset($_POST['export']) OR isset($_GET['export']) ) {
191204
include_once('easypopulate_4_export.php'); // this file contains all data export code
192205
}
@@ -303,6 +316,7 @@ function init()
303316
echo "Group Pricing Per Item: ".(($ep_supported_mods['gppi']) ? '<font color="green">TRUE</font>':"FALSE").'<br/>';
304317
echo "Exclusive Products Mod: ".(($ep_supported_mods['excl']) ? '<font color="green">TRUE</font>':"FALSE").'<br/>';
305318
echo "Stock By Attributes Mod: ".(($ep_4_SBAEnabled != false) ? '<font color="green">TRUE</font>':"FALSE").'<br/>';
319+
echo "CEON URI Rewriter Mod: " . (($ep4CEONURIDoesExist == true) ? '<font color="green">TRUE</font>' : "FALSE") . '<br/>';
306320

307321

308322
echo "<br/><b><u>User Defined Products Fields: </b></u><br/>";
@@ -327,12 +341,12 @@ function init()
327341
echo 'products_name:'.$products_name_max_len.'<br/>';
328342

329343
/* // some error checking
330-
echo '<br><br>Problem Data: '. mysql_num_rows($ajeh_result);
331-
echo '<br>Memory Usage: '.memory_get_usage();
332-
echo '<br>Memory Peak: '.memory_get_peak_usage();
333-
echo '<br><br>';
344+
echo '<br/><br/>Problem Data: '. mysql_num_rows($ajeh_result);
345+
echo '<br/>Memory Usage: '.memory_get_usage();
346+
echo '<br/>Memory Peak: '.memory_get_peak_usage();
347+
echo '<br/><br/>';
334348
print_r($langcode);
335-
echo '<br><br>code: '.$langcode[1]['id'];
349+
echo '<br/><br/>code: '.$langcode[1]['id'];
336350
*/
337351
//register_globals_vars_check_4(); // testing
338352

@@ -494,11 +508,11 @@ function init()
494508
echo "<div>";
495509
$test_string = "Πλαστικά^Εξαρτήματα";
496510
$test_array1 = explode("^", $test_string);
497-
echo "<br>Using explode() with: ".$test_string."<br>";
511+
echo "<br/>Using explode() with: ".$test_string."<br/>";
498512
print_r($test_array1);
499513
500514
$test_array2 = mb_split('\x5e', $test_string);
501-
echo "<br><br>Using mb_split() with: ".$test_string."<br>";
515+
echo "<br/><br/>Using mb_split() with: ".$test_string."<br/>";
502516
print_r($test_array2);
503517
echo "</div>";
504518
*/

0 commit comments

Comments
 (0)