[ Index ] |
|
Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1 |
1 <?php 2 /** 3 * Version Manager Class 4 * 5 * This class is used during the installation and upgrade processes * 6 * @package Installer 7 * @access private 8 * @copyright Copyright 2003-2006 Zen Cart Development Team 9 * @copyright Portions Copyright 2003 osCommerce 10 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 11 * @version $Id: class.installer_version_manager.php 5369 2006-12-23 10:55:52Z drbyte $ 12 */ 13 14 15 16 /*//////////////////////////////////////////////////////////////////////////////////////////////////////////// 17 //// HOW TO UPDATE FOR NEW RELEASES: 18 //// a. in function zen_database() below, set the $this->latest_version appropriately 19 //// b. in function check_check_all_versions(), update: 20 //// i) add a line to call a new check_versionXXXX() function 21 //// ii) add another IF statement to set the displayed version text ($retVal) 22 //// c. add a new check_versionXXXX() function to the end of the class (BEFORE the closing } in the file) 23 ////////////////////////////////////////////////////////////////////////////////////////////////////////////*/ 24 25 class versionManager extends base{ 26 var $latest_version, $found_version, $zdb_configuration_table_found; 27 28 function versionManager() { 29 /** 30 * The version that this edition of the installer is designed to support 31 */ 32 $this->latest_version = '1.3.7'; 33 34 /** 35 * Check to see if the configuration table can be found...thus validating the installation, in part. 36 */ 37 $this->zdb_configuration_table_found = $this->check_configuration_table(); 38 /** 39 * Check to see which versions are successfully detected 40 */ 41 $this->found_version = $this->check_check_all_versions(); 42 } 43 44 function check_configuration_table() { 45 global $db_test; 46 // if (!defined('ZC_UPG_DEBUG')) define('ZC_UPG_DEBUG',false); 47 // Check to see if any Zen Cart tables exist 48 $tables = $db_test->Execute("SHOW TABLES like '".DB_PREFIX."configuration'"); 49 if (ZC_UPG_DEBUG==true) echo 'ZEN-Configuration (should be 1) = '. $tables->RecordCount() .'<br>'; 50 if ($tables->RecordCount() > 0) { 51 return true; 52 } 53 } 54 55 function check_check_all_versions() { 56 if (!$this->zdb_configuration_table_found) return false; 57 // $this->version103 = $this->check_version_103(); 58 // $this->version104 = $this->check_version_104(); 59 $this->version110 = $this->check_version_110(); 60 $this->version111 = $this->check_version_111(); 61 $this->version112 = $this->check_version_112(); 62 // $this->version113 = $this->check_version_113(); // there were no db changes for 1.1.3 63 $this->version114 = $this->check_version_114(); 64 $this->version1141 = $this->check_version_1141(); 65 $this->version120 = $this->check_version_120(); 66 $this->version121 = $this->check_version_121(); 67 $this->version122 = $this->check_version_122(); 68 $this->version123 = $this->check_version_123(); 69 $this->version124 = $this->check_version_124(); 70 $this->delete_bad_1_2_4_index_key(); 71 $this->version125 = $this->check_version_125(); 72 $this->version126 = $this->check_version_126(); 73 $this->version127 = $this->check_version_127(); 74 $this->version130 = $this->check_version_130(); 75 $this->version1301 = $this->check_version_1301(); 76 $this->version1302 = $this->check_version_1302(); 77 $this->version135 = $this->check_version_135(); 78 $this->version136 = $this->check_version_136(); 79 $this->version137 = $this->check_version_137(); 80 81 // if ($this->version103 == true) $retVal = '1.0.3'; 82 // if ($this->version104 == true) $retVal = '1.0.4'; 83 if ($this->version110 == true) $retVal = '1.1.0'; 84 if ($this->version111 == true) $retVal = '1.1.1'; 85 if ($this->version112 == true) $retVal = '1.1.2 or 1.1.3'; 86 if ($this->version114 == true) $retVal = '1.1.4'; 87 if ($this->version1141 == true) $retVal = '1.1.4-patch1'; 88 if ($this->version120 == true) $retVal = '1.2.0'; 89 if ($this->version121 == true) $retVal = '1.2.1'; 90 if ($this->version122 == true) $retVal = '1.2.2'; 91 if ($this->version123 == true) $retVal = '1.2.3'; 92 if ($this->version124 == true) $retVal = '1.2.4'; 93 if ($this->version125 == true) $retVal = '1.2.5'; 94 if ($this->version126 == true) $retVal = '1.2.6'; 95 if ($this->version127 == true) $retVal = '1.2.7'; 96 if ($this->version130 == true) $retVal = '1.3.0'; 97 if ($this->version1301 == true) $retVal = '1.3.0.1'; 98 if ($this->version1302 == true) $retVal = '1.3.0.2'; 99 if ($this->version135 == true) $retVal = '1.3.5'; 100 if ($this->version136 == true) $retVal = '1.3.6'; 101 if ($this->version137 == true) $retVal = '1.3.7'; 102 103 return $retVal; 104 } 105 106 function check_version_110() { 107 global $db_test; 108 // first test to see if they have run the 1.1 upgrade script (v1.0.4 to v.1.1.1) 109 $tables = $db_test->Execute("SHOW TABLES like '" . DB_PREFIX . "files_uploaded'"); 110 if (ZC_UPG_DEBUG==true) echo '104-Table (should be 1) = '. $tables->RecordCount() .'<br>'; 111 if ($tables->RecordCount() > 0) { 112 return true; 113 } 114 } //end of 1.1.0 check 115 116 function check_version_111() { 117 global $db_test; 118 // test to see if they have run the 1.1 -> 1.1.1 bugfix update 119 $got_v1_1_1 = false; 120 $sql = "SELECT count(*) as count FROM " . DB_PREFIX . "configuration WHERE configuration_key = 'CATEGORIES_COUNT_ZERO'"; 121 $result = $db_test->Execute($sql); 122 if (ZC_UPG_DEBUG==true) echo 'v111-count (should be 1) =' . $result->fields['count'] .'<br>'; 123 if ($result->fields['count'] > '0') { 124 $got_v1_1_1 = true; 125 } 126 return $got_v1_1_1; 127 } //end of 1.1.1 check 128 129 function check_version_112() { 130 global $db_test; 131 // test to see if they have run the 1.1.1 -> 1.1.2 update 132 $ccmodule_installed='false'; 133 $got_v1_1_2 = false; 134 $sql = "SELECT configuration_value FROM " . DB_PREFIX . "configuration WHERE configuration_key = 'MODULE_PAYMENT_CC_STATUS'"; 135 $result = $db_test->Execute($sql); 136 if ($result->RecordCount()>0 && $result->fields['configuration_value'] == 'True') { $ccmodule_installed = 'true'; } 137 $sql = "SELECT count(*) as count FROM " . DB_PREFIX . "configuration WHERE configuration_key = 'MODULE_PAYMENT_CC_STORE_NUMBER'"; 138 $result = $db_test->Execute($sql); 139 if (ZC_UPG_DEBUG==true) echo 'v112-count=' . $result->fields['count'] .'(0 or 1 is okay)<br>'; 140 if ($result->fields['count'] < 1 && $ccmodule_installed=='true') { 141 $got_v1_1_2 = false; 142 } else { 143 $got_v1_1_2 = true; 144 $zdb_ver = '1.1.2 or 1.1.3'; 145 } 146 return $got_v1_1_2; 147 } //end of 1.1.2 check 148 149 function check_version_113(){ 150 // there were no critical SQL changes from v1.1.2 to v1.1.3 -- just to change a default, but such change shouldn't 151 // be necessary if the installed shop/store is already functional, unless can't get free-shipping for 0-weight to work 152 if (ZC_UPG_DEBUG==true) echo '113-unknown-no way to determine<br>'; 153 } 154 155 function check_version_114(){ 156 global $db_test; 157 // test to see if they have run the 1.1.2 -> 1.1.4 update 158 $sql = "show fields from " . DB_PREFIX . "customers_basket_attributes"; // could we use "describe" as well ? 159 $result = $db_test->Execute($sql); 160 while (!$result->EOF) { 161 if (ZC_UPG_DEBUG==true) echo "114-fields (need products_options_sort_order) =" . $result->fields['Field'] . '<br>'; 162 if ($result->fields['Field'] == 'products_options_sort_order') { 163 if ($result->fields['Type'] == 'text') { 164 $got_v1_1_4 = true; 165 } 166 } 167 $result->MoveNext(); 168 } 169 return $got_v1_1_4; 170 } //end of 1.1.4 check 171 172 function check_version_1141() { 173 global $db_test; 174 // test to see if they have run the 1.1.4 -> PATCH1 update 175 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key='SHIPPING_BOX_WEIGHT'"; // could use "describe" as well ? 176 $result = $db_test->Execute($sql); 177 while (!$result->EOF) { 178 if (ZC_UPG_DEBUG==true) echo "114patch-fields=" . $result->fields['configuration_title'] . '<br>'; 179 if ($result->fields['configuration_title'] == 'Package Tare Small to Medium - added percentage:weight') { 180 $got_v1_1_4_patch1 = true; 181 } 182 $result->MoveNext(); 183 } 184 return $got_v1_1_4_patch1; 185 } // end 1.1.4-patch1 check 186 187 function check_version_120() { 188 global $db_test; 189 // test to see if the v1.1.4->v1.2.0 upgrade has been completed 190 //1st check for v1.20 191 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key='TUTORIAL_STATUS'"; 192 $result = $db_test->Execute($sql); 193 $got_v1_2_0a = true; // set true -- if value found (but should be deleted), then set to false. 194 while (!$result->EOF) { 195 if (ZC_UPG_DEBUG==true) echo "120a-configtitle=" . $result->fields['configuration_title'] . '<br>'; 196 if ($result->fields['configuration_title'] != '') { 197 $got_v1_2_0a = false; 198 } 199 $result->MoveNext(); 200 } 201 //2nd check for v1.20 202 $tables = $db_test->Execute("SHOW TABLES like '" . DB_PREFIX . "product_type_layout'"); 203 if (ZC_UPG_DEBUG==true) echo '120b-Table= '. $tables->RecordCount() .'<br>'; 204 if ($tables->RecordCount() > 0) { 205 $got_v1_2_0b = true; 206 } 207 //3rd check for v1.20 208 $sql = "select configuration_group_title, configuration_group_description from " . DB_PREFIX . "configuration_group WHERE configuration_group_id = '13'"; 209 $result = $db_test->Execute($sql); 210 while (!$result->EOF) { 211 if (ZC_UPG_DEBUG==true) echo "120c-cfggroup13=attrb ==" . $result->fields['configuration_group_title'] . '<br>'; 212 if ($result->fields['configuration_group_title'] == 'Attribute Settings') { 213 $got_v1_2_0c = true; 214 } 215 $result->MoveNext(); 216 } 217 //4th check for v1.20 218 $sql = "show fields from " . DB_PREFIX . "categories"; 219 $result = $db_test->Execute($sql); 220 while (!$result->EOF) { 221 if (ZC_UPG_DEBUG==true) echo "120d-fields=" . $result->fields['Field'] . '<br>'; 222 if ($result->fields['Field'] == 'categories_status') { 223 if ($result->fields['Type'] == 'tinyint(1)') { 224 $got_v1_2_0d = true; 225 } 226 } 227 $result->MoveNext(); 228 } 229 //5th check for v1.20 230 $sql = "show fields from " . DB_PREFIX . "customers"; 231 $result = $db_test->Execute($sql); 232 while (!$result->EOF) { 233 if (ZC_UPG_DEBUG==true) echo "120e-fields=" . $result->fields['Field'] . '<br>'; 234 if ($result->fields['Field'] == 'customers_nick' || $result->fields['Field'] == 'customers_group_pricing' || $result->fields['Field'] == 'customers_email_format') { 235 $got_v1_2_0e = true; 236 } 237 $result->MoveNext(); 238 } 239 //6th check for v1.20 240 $sql = "show fields from " . DB_PREFIX . "products"; 241 $result = $db_test->Execute($sql); 242 while (!$result->EOF) { 243 if (ZC_UPG_DEBUG==true) echo "120f-fields=" . $result->fields['Field'] . '<br>'; 244 if ($result->fields['Field'] == 'master_categories_id') { 245 $got_v1_2_0f = true; 246 } 247 $result->MoveNext(); 248 } 249 250 //7th check for v1.2.0 251 $tables = $db_test->Execute("SHOW TABLES like '" . DB_PREFIX . "project_version'"); 252 if ($tables->RecordCount() > 0) { 253 $sql = "SELECT project_version_major, project_version_minor from " . DB_PREFIX . "project_version WHERE project_version_key = 'Zen-Cart Main'"; 254 $result = $db_test->Execute($sql); 255 if (ZC_UPG_DEBUG==true) echo "120g-project_version=" . $result->fields['project_version_major'] . '.' . $result->fields['project_version_minor'] . '<br>'; 256 if ($result->fields['project_version_major']=='1' && $result->fields['project_version_minor']>='2') $got_v1_2_0g = true; 257 } //end project_version 258 259 // evaluate all 6 checks 260 if ($got_v1_2_0a && $got_v1_2_0b && $got_v1_2_0c && $got_v1_2_0d && $got_v1_2_0e && $got_v1_2_0f) { 261 $got_v1_2_0 = true; 262 if (ZC_UPG_DEBUG==true) echo 'Got 1.2.0<br>'; 263 } 264 return $got_v1_2_0; 265 } // end 1.2.0 check 266 267 268 function check_version_121() { 269 global $db_test; 270 // test to see if the v1.2.0->v1.2.1 upgrade has been completed 271 $tables = $db_test->Execute("SHOW TABLES like '" . DB_PREFIX . "project_version'"); 272 if ($tables->RecordCount() > 0) { 273 //1st check for v1.2.1 274 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key='DISPLAY_PRICE_WITH_TAX_ADMIN'"; 275 $result = $db_test->Execute($sql); 276 if (ZC_UPG_DEBUG==true) echo "121a-configkey_check=" . $result->fields['configuration_title'] . '<br>'; 277 if ($result->RecordCount()>0) $got_v1_2_1a = true; 278 } 279 280 //2nd check for v1.2.1 281 $sql = "show fields from " . DB_PREFIX . "products_discount_quantity"; 282 $result = $db_test->Execute($sql); 283 while (!$result->EOF) { 284 if (ZC_UPG_DEBUG==true) echo "121b-fields-'discount_qty'->FLOAT=" . $result->fields['Field'] . '->' . $result->fields['Type'] . '<br>'; 285 if ($result->fields['Field'] == 'discount_qty') { 286 if (strtoupper($result->fields['Type']) == 'FLOAT') { 287 $got_v1_2_1b = true; 288 } 289 } 290 $result->MoveNext(); 291 } 292 293 if (ZC_UPG_DEBUG==true) { 294 echo '1.2.1a='.$got_v1_2_1a.'<br>'; 295 echo '1.2.1b='.$got_v1_2_1b.'<br>'; 296 } 297 // evaluate all 3 checks 298 if ($got_v1_2_1a && $got_v1_2_1b) { 299 $got_v1_2_1 = true; 300 if (ZC_UPG_DEBUG==true) echo '<br>Got 1.2.1<br>'; 301 } 302 return $got_v1_2_1; 303 } //end of 1.2.1 check 304 305 306 function check_version_122() { 307 global $db_test; 308 // 1.2.2 checks 309 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key='SEND_EXTRA_ORDER_EMAILS_TO'"; 310 $result = $db_test->Execute($sql); 311 if (ZC_UPG_DEBUG==true) echo "122a-configkey_check=" . $result->fields['configuration_title'] . '<br>'; 312 if ($result->fields['configuration_title'] == 'Send Copy of Order Confirmation Emails To') { 313 $got_v1_2_2a = true; 314 if (ZC_UPG_DEBUG==true) echo '<br>Got 1.2.2<br>'; 315 } 316 return $got_v1_2_2a; 317 } //end of 1.2.2 check 318 319 function check_version_123() { 320 global $db_test; 321 //1st check for v1.2.3 322 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key = 'DEFAULT_ZERO_BALANCE_ORDERS_STATUS_ID'"; 323 $result = $db_test->Execute($sql); 324 if (ZC_UPG_DEBUG==true) echo "123a-configkey_check=" . $result->fields['configuration_title'] . '<br>'; 325 if ($result->fields['configuration_title'] == 'Default Order Status For Zero Balance Orders') { 326 $got_v1_2_3 = true; 327 if (ZC_UPG_DEBUG==true) echo '<br>Got 1.2.3<br>'; 328 } 329 return $got_v1_2_3; 330 } //end of 1.2.3 check 331 332 function check_version_124() { 333 global $db_test; 334 //1st check for v1.2.4 335 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key='PRODUCTS_MANUFACTURERS_STATUS'"; 336 $result = $db_test->Execute($sql); 337 if (ZC_UPG_DEBUG==true) echo "124a-configkey_check=" . $result->fields['configuration_title'] . '<br>'; 338 if ($result->fields['configuration_title'] == 'Manufacturers List - Verify Product Exist') { 339 $got_v1_2_4 = true; 340 if (ZC_UPG_DEBUG==true) echo '<br>Got 1.2.4<br>'; 341 } 342 return $got_v1_2_4; 343 } //end of 1.2.4 check 344 345 function delete_bad_1_2_4_index_key() { 346 global $db_test; 347 // THE FOLLOWING SIMPLY CHECKS FOR THE EXTRA INDEX KEY AND REMOVES IT: 348 $tables = $db_test->Execute("SHOW TABLES like '".DB_PREFIX."project_version_history'"); 349 if ($tables->RecordCount() > 0) { 350 $sql = "show index from " . DB_PREFIX . "project_version_history"; 351 $result = $db_test->Execute($sql); 352 while (!$result->EOF) { 353 if (ZC_UPG_DEBUG==true) echo "INDEX TEST-'project_version_history'=" . $result->fields['Field'] . '->' . $result->fields['Type'] . '<br>'; 354 if ($result->fields['Key_name'] == 'project_version_key') { 355 if (ZC_UPG_DEBUG==true) echo 'Index on project_version_key found. Deleting.<br>'; 356 $db_test->Execute("drop index project_version_key on " . DB_PREFIX . "project_version_history"); 357 return true; 358 } 359 $result->MoveNext(); 360 } 361 } 362 } 363 364 function check_version_125() { 365 global $db_test; 366 //1st check for v1.2.5 367 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key='SESSION_IP_TO_HOST_ADDRESS'"; 368 $result = $db_test->Execute($sql); 369 if (ZC_UPG_DEBUG==true) echo "125a-configkey_check=" . $result->fields['configuration_title'] . '<br>'; 370 if ($result->fields['configuration_title'] == 'IP to Host Conversion Status') { 371 $got_v1_2_5a = true; 372 } 373 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key='MAX_DISPLAY_PRODUCTS_TO_CATEGORIES_COLUMNS'"; 374 $result = $db_test->Execute($sql); 375 if (ZC_UPG_DEBUG==true) echo "125b-configkey_check=" . $result->fields['configuration_title'] . '<br>'; 376 if ($result->fields['configuration_title'] == 'Maximum Display Columns Products to Multiple Categories Manager') { 377 $got_v1_2_5b = true; 378 } 379 //3rd check for v1.2.5 380 $tables = $db_test->Execute("SHOW TABLES like '" . DB_PREFIX . "meta_tags_products_description'"); 381 if (ZC_UPG_DEBUG==true) echo '125c-Table= '. $tables->RecordCount() .'<br>'; 382 if ($tables->RecordCount() > 0) { 383 $got_v1_2_5c = true; 384 } 385 //4th check for v1.2.5 386 $sql = "show fields from " . DB_PREFIX . "whos_online"; 387 $result = $db_test->Execute($sql); 388 while (!$result->EOF) { 389 if (ZC_UPG_DEBUG==true) echo "125d-fields-'user_agent'->VARCHAR=" . $result->fields['Field'] . '->' . $result->fields['Type'] . '<br>'; 390 if ($result->fields['Field'] == 'user_agent') { 391 if (strstr(strtoupper($result->fields['Type']),'VARCHAR')) { 392 $got_v1_2_5d = true; 393 } 394 } 395 $result->MoveNext(); 396 } 397 398 if (ZC_UPG_DEBUG==true) { 399 echo '1.2.5a='.$got_v1_2_5a.'<br>'; 400 echo '1.2.5b='.$got_v1_2_5b.'<br>'; 401 echo '1.2.5c='.$got_v1_2_5c.'<br>'; 402 echo '1.2.5d='.$got_v1_2_5d.'<br>'; 403 } 404 // evaluate all 4 1.2.5 checks 405 if ($got_v1_2_5a && $got_v1_2_5b && $got_v1_2_5c && $got_v1_2_5d) { 406 $got_v1_2_5 = true; 407 if (ZC_UPG_DEBUG==true) echo '<br>Got 1.2.5<br>'; 408 } 409 return $got_v1_2_5; 410 } // end 1.2.5 check 411 412 413 function check_version_126() { 414 global $db_test; 415 //check for v1.2.6 416 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key='CATEGORIES_TABS_STATUS'"; 417 $result = $db_test->Execute($sql); 418 if (ZC_UPG_DEBUG==true) echo "126-configkey_check=" . $result->fields['configuration_title'] . '<br>'; 419 if ($result->fields['configuration_title'] == 'Categories-Tabs Menu ON/OFF') { 420 $got_v1_2_6 = true; 421 if (ZC_UPG_DEBUG==true) echo '<br>Got 1.2.6<br>'; 422 } 423 return $got_v1_2_6; 424 } // end 1.2.6 check 425 426 427 function check_version_127() { 428 global $db_test; 429 //check for v1.2.7 430 $sql = "select configuration_description from " . DB_PREFIX . "configuration where configuration_key='SHOW_VERSION_UPDATE_IN_HEADER'"; 431 $result = $db_test->Execute($sql); 432 if (ZC_UPG_DEBUG==true) echo "127a-configkey_check=" . $result->fields['configuration_description'] . '<br>'; 433 if ($result->fields['configuration_description'] == 'Automatically check to see if a new version of Zen Cart is available. Enabling this can sometimes slow down the loading of Admin pages. (Displayed on main Index page after login, and Server Info page.)') { 434 $got_v1_2_7a = true; 435 } 436 //check #2 437 $sql = "select configuration_description from " . DB_PREFIX . "configuration where configuration_key='SHOW_SHOPPING_CART_BOX_STATUS'"; 438 $result = $db_test->Execute($sql); 439 if (ZC_UPG_DEBUG==true) echo "127b-configkey_check=" . $result->fields['configuration_description'] . '<br>'; 440 if ($result->fields['configuration_description'] == 'Shopping Cart Shows<br />0= Always<br />1= Only when full<br />2= Only when full but not when viewing the Shopping Cart') { 441 $got_v1_2_7b = true; 442 } 443 if (ZC_UPG_DEBUG==true) { 444 echo '1.2.7a='.$got_v1_2_7a.'<br>'; 445 echo '1.2.7b='.$got_v1_2_7b.'<br>'; 446 } 447 // evaluate all 1.2.7 checks 448 if ($got_v1_2_7a && $got_v1_2_7b) { 449 $got_v1_2_7 = true; 450 if (ZC_UPG_DEBUG==true) echo '<br>Got 1.2.7<br>'; 451 } 452 return $got_v1_2_7; 453 } // end 1.2.7 check 454 455 456 function check_version_130() { 457 global $db_test; 458 //1st check for v1.3.0 459 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key='DEFINE_BREADCRUMB_STATUS'"; 460 $result = $db_test->Execute($sql); 461 if (ZC_UPG_DEBUG==true) echo "130a-configkey_check DEFINE_BREADCRUMB_STATUS =" . $result->fields['configuration_title'] . '<br>'; 462 if ($result->fields['configuration_title'] == 'Define Breadcrumb Status') { 463 $got_v1_3_0a = true; 464 } 465 //2nd check for v1.3.0 466 $tables = $db_test->Execute("SHOW TABLES like '".DB_PREFIX."ezpages'"); 467 if ($tables->RecordCount() > 0) { 468 $sql = "show index from " . DB_PREFIX . "ezpages"; 469 $result = $db_test->Execute($sql); 470 while (!$result->EOF) { 471 if (ZC_UPG_DEBUG==true) echo "1.3.0b-Index check on ezpages=" . $result->fields['Key_name'] . '->' . $result->fields['Column_name'] . '<br>'; 472 if ($result->fields['Column_name'] == 'pages_id') { 473 $got_v1_3_0b = true; 474 } 475 $result->MoveNext(); 476 } 477 } 478 //3rd check for v1.3.0 479 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key='EZPAGES_STATUS_HEADER'"; 480 $result = $db_test->Execute($sql); 481 if (ZC_UPG_DEBUG==true) echo "130c-configkey_check=" . $result->fields['configuration_title'] . '<br>'; 482 if ($result->fields['configuration_title'] == 'EZ-Pages Display Status - HeaderBar') { 483 $got_v1_3_0c = true; 484 } 485 //4th check for 1.3.0 486 $tables = $db_test->Execute("SHOW TABLES like '".DB_PREFIX."meta_tags_categories_description'"); 487 if ($tables->RecordCount() > 0) { 488 $sql = "show index from " . DB_PREFIX . "meta_tags_categories_description"; 489 $result = $db_test->Execute($sql); 490 while (!$result->EOF) { 491 if (ZC_UPG_DEBUG==true) echo "1.3.0d-Index check on meta_tags_categories_description=" . $result->fields['Key_name'] . '->' . $result->fields['Column_name'] . '<br>'; 492 if ($result->fields['Column_name'] == 'categories_id') { 493 $got_v1_3_0d = true; 494 } 495 $result->MoveNext(); 496 } 497 } 498 //5th check for v1.3.0 499 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key='EMAIL_SEND_MUST_BE_STORE'"; 500 $result = $db_test->Execute($sql); 501 if (ZC_UPG_DEBUG==true) echo "130e-configkey_check EMAIL_SEND_MUST_BE_STORE =" . $result->fields['configuration_title'] . '<br>'; 502 if ($result->fields['configuration_title'] == 'Emails must send from known domain?') { 503 $got_v1_3_0e = true; 504 } 505 //6th check for v1.3.0 506 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key='IMAGE_USE_CSS_BUTTONS'"; 507 $result = $db_test->Execute($sql); 508 if (ZC_UPG_DEBUG==true) echo "130f-configkey_check IMAGE_USE_CSS_BUTTONS =" . $result->fields['configuration_title'] . '<br>'; 509 if ($result->fields['configuration_title'] == 'CSS Buttons') { 510 $got_v1_3_0f = true; 511 } 512 513 if (ZC_UPG_DEBUG==true) { 514 echo '1.3.0a='.$got_v1_3_0a.'<br>'; 515 echo '1.3.0b='.$got_v1_3_0b.'<br>'; 516 echo '1.3.0c='.$got_v1_3_0c.'<br>'; 517 echo '1.3.0d='.$got_v1_3_0d.'<br>'; 518 echo '1.3.0e='.$got_v1_3_0e.'<br>'; 519 echo '1.3.0f='.$got_v1_3_0f.'<br>'; 520 } 521 // evaluate all 1.3.0 checks 522 if ($got_v1_3_0a && $got_v1_3_0b && $got_v1_3_0c && $got_v1_3_0d && $got_v1_3_0e && $got_v1_3_0f ) { 523 $got_v1_3_0 = true; 524 if (ZC_UPG_DEBUG==true) echo '<br>Got 1.3.0<br>'; 525 } 526 return $got_v1_3_0; 527 } //end of 1.3.0 check 528 529 530 function check_version_1301() { 531 global $db_test; 532 //1st check for v1.3.0.1 533 $sql = "select configuration_group_id from " . DB_PREFIX . "configuration where configuration_key='SHOW_ACCOUNT_LINKS_ON_SITE_MAP'"; 534 $result = $db_test->Execute($sql); 535 if (ZC_UPG_DEBUG==true) echo "1301-configkey_check SHOW_ACCOUNT_LINKS_ON_SITE_MAP =" . $result->fields['configuration_group_id'] . '<br>'; 536 if ($result->fields['configuration_group_id'] == '19') { 537 $got_v1_3_0_1 = true; 538 if (ZC_UPG_DEBUG==true) { 539 echo '<br>Got 1.3.0.1<br>'; 540 } 541 } 542 return $got_v1_3_0_1; 543 } //end of 1.3.0.1 check 544 545 546 function check_version_1302() { 547 global $db_test; 548 //1st check for v1.3.0.2 549 $sql = "select sort_order from " . DB_PREFIX . "configuration where configuration_key='SHOW_ACCOUNT_LINKS_ON_SITE_MAP'"; 550 $result = $db_test->Execute($sql); 551 if (ZC_UPG_DEBUG==true) echo "1302-configkey_check SHOW_ACCOUNT_LINKS_ON_SITE_MAP =" . $result->fields['sort_order'] . '<br>'; 552 if ($result->fields['sort_order'] == 115) { 553 $got_v1_3_0_2 = true; 554 if (ZC_UPG_DEBUG==true) { 555 echo '<br>Got 1.3.0.2<br>'; 556 } 557 } 558 return $got_v1_3_0_2; 559 } //end of 1.3.0.2 check 560 561 function check_version_135() { 562 global $db_test; 563 $got_v1_3_5 = false; 564 $got_v1_3_5a = false; 565 $got_v1_3_5b = false; 566 //1st check for v1.3.5 567 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key='PRODUCT_LIST_PRICE_BUY_NOW'"; 568 $result = $db_test->Execute($sql); 569 if (ZC_UPG_DEBUG==true) echo "135a-configkey_check PRODUCT_LIST_PRICE_BUY_NOW =" . $result->fields['configuration_title'] . '<br>'; 570 if ($result->fields['configuration_title'] == 'Display Product Add to Cart Button (0=off; 1=on; 2=on with Qty Box per Product)') { 571 $got_v1_3_5a = true; 572 } 573 //2nd check for v1.3.5 574 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key='PRODUCT_LIST_ALPHA_SORTER'"; 575 $result = $db_test->Execute($sql); 576 if (ZC_UPG_DEBUG==true) echo "135b-configkey_check PRODUCT_LIST_ALPHA_SORTER =" . $result->fields['configuration_title'] . '<br>'; 577 if ($result->fields['configuration_title'] == 'Include Product Listing Alpha Sorter Dropdown') { 578 $got_v1_3_5b = true; 579 } 580 581 if (ZC_UPG_DEBUG==true) { 582 echo '1.3.5a='.$got_v1_3_5a.'<br>'; 583 echo '1.3.5b='.$got_v1_3_5b.'<br>'; 584 } 585 // evaluate all 1.3.5 checks 586 if ($got_v1_3_5a && $got_v1_3_5b ) { 587 $got_v1_3_5 = true; 588 if (ZC_UPG_DEBUG==true) echo '<br>Got 1.3.5<br>'; 589 } 590 return $got_v1_3_5; 591 } //end of 1.3.5 check 592 593 function check_version_136() { 594 global $db_test; 595 $got_v1_3_6 = false; 596 $got_v1_3_6a = false; 597 $got_v1_3_6b = false; 598 //1st check for v1.3.6 599 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key='META_TAG_INCLUDE_MODEL'"; 600 $result = $db_test->Execute($sql); 601 if (ZC_UPG_DEBUG==true) echo "136a-configkey_check META_TAG_INCLUDE_MODEL =" . $result->fields['configuration_title'] . '<br>'; 602 if ($result->fields['configuration_title'] == 'Meta Tags - Include Product Model in Title') { 603 $got_v1_3_6a = true; 604 } 605 //2nd check for v1.3.6 606 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key='SHOW_SHOPPING_CART_EMPTY_UPCOMING'"; 607 $result = $db_test->Execute($sql); 608 if (ZC_UPG_DEBUG==true) echo "136b-configkey_check SHOW_SHOPPING_CART_EMPTY_UPCOMING =" . $result->fields['configuration_title'] . '<br>'; 609 if ($result->fields['configuration_title'] == 'Show Upcoming Products on empty Shopping Cart Page') { 610 $got_v1_3_6b = true; 611 } 612 613 if (ZC_UPG_DEBUG==true) { 614 echo '1.3.6a='.$got_v1_3_6a.'<br>'; 615 echo '1.3.6b='.$got_v1_3_6b.'<br>'; 616 } 617 // evaluate all 1.3.6 checks 618 if ($got_v1_3_6a && $got_v1_3_6b ) { 619 $got_v1_3_6 = true; 620 if (ZC_UPG_DEBUG==true) echo '<br>Got 1.3.6<br>'; 621 } 622 return $got_v1_3_6; 623 } //end of 1.3.6 check 624 625 626 627 function check_version_137() { 628 global $db_test; 629 $got_v1_3_7 = false; 630 $got_v1_3_7a = false; 631 $got_v1_3_7b = false; 632 //1st check for v1.3.7 633 $sql = "select configuration_description from " . DB_PREFIX . "configuration where configuration_key='DEFINE_BREADCRUMB_STATUS'"; 634 $result = $db_test->Execute($sql); 635 if (ZC_UPG_DEBUG==true) echo "137a-configdesc_check DEFINE_BREADCRUMB_STATUS =" . $result->fields['configuration_description'] . '<br>'; 636 if ($result->fields['configuration_description'] == 'Enable the Breadcrumb Trail Links?<br />0= OFF<br />1= ON<br />2= Off for Home Page Only') { 637 $got_v1_3_7a = true; 638 } 639 //2nd check for v1.3.7 640 $sql = "select configuration_title from " . DB_PREFIX . "configuration where configuration_key='USE_SPLIT_LOGIN_MODE'"; 641 $result = $db_test->Execute($sql); 642 if (ZC_UPG_DEBUG==true) echo "137b-configkey_check USE_SPLIT_LOGIN_MODE =" . $result->fields['configuration_title'] . '<br>'; 643 if ($result->fields['configuration_title'] == 'Use split-login page') { 644 $got_v1_3_7b = true; 645 } 646 647 if (ZC_UPG_DEBUG==true) { 648 echo '1.3.7a='.$got_v1_3_7a.'<br>'; 649 echo '1.3.7b='.$got_v1_3_7b.'<br>'; 650 } 651 // evaluate all 1.3.7 checks 652 if ($got_v1_3_7a && $got_v1_3_7b ) { 653 $got_v1_3_7 = true; 654 if (ZC_UPG_DEBUG==true) echo '<br>Got 1.3.7<br>'; 655 } 656 return $got_v1_3_7; 657 } //end of 1.3.7 check 658 659 660 661 662 663 } // end class 664 665 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 16:45:43 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |