Changeset 2319:abe2702e1585 for inc/dbschema
- Timestamp:
- 10/09/13 08:37:56 (12 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/dbschema/upgrade.php
r2295 r2319 361 361 } 362 362 363 # add new settings for date and time formats 363 # Some settings change, prepare db queries 364 $strReqFormat = 'INSERT INTO '.$core->prefix.'setting'; 365 $strReqFormat .= ' (setting_id,setting_ns,setting_value,setting_type,setting_label)'; 366 $strReqFormat .= ' VALUES(\'%s\',\'system\',\'%s\',\'string\',\'%s\')'; 367 368 $strReqSelect = 'SELECT count(1) FROM '.$core->prefix.'setting'; 369 $strReqSelect .= ' WHERE setting_id = \'%s\''; 370 $strReqSelect .= ' AND setting_ns = \'system\''; 371 $strReqSelect .= ' AND blog_id IS NULL'; 372 373 # Add date and time formats 364 374 $date_formats = array('%Y-%m-%d','%m/%d/%Y','%d/%m/%Y','%Y/%m/%d','%d.%m.%Y','%b %e %Y','%e %b %Y','%Y %b %e', 365 375 '%a, %Y-%m-%d','%a, %m/%d/%Y','%a, %d/%m/%Y','%a, %Y/%m/%d','%B %e, %Y','%e %B, %Y','%Y, %B %e','%e. %B %Y', … … 372 382 } 373 383 374 $strReqFormat = 'INSERT INTO '.$core->prefix.'setting';375 $strReqFormat .= ' (setting_id,setting_ns,setting_value,setting_type,setting_label)';376 $strReqFormat .= ' VALUES(\'%s\',\'system\',\'%s\',\'string\',\'%s\')';377 378 $strReqSelect = 'SELECT count(1) FROM '.$core->prefix.'setting';379 $strReqSelect .= ' WHERE setting_id = \'%s\'';380 $strReqSelect .= ' AND setting_ns = \'system\'';381 $strReqSelect .= ' AND blog_id IS NULL';382 383 384 $rs = $core->con->select(sprintf($strReqSelect,'date_formats')); 384 385 if ($rs->f(0)==0) { … … 390 391 $strReq = sprintf($strReqFormat,'time_formats',serialize($time_formats),'Time formats examples'); 391 392 $core->con->execute($strReq); 393 } 394 395 # Add repository URL for themes and plugins as daInstaller move to core 396 $rs = $core->con->select(sprintf($strReqSelect,'store_plugin_url')); 397 if ($rs->f(0)==0) { 398 $strReq = sprintf($strReqFormat,'store_plugin_url','http://update.dotaddict.org/dc2/plugins.xml','Plugins XML feed location'); 399 $core->con->execute($strReq); 400 } 401 $rs = $core->con->select(sprintf($strReqSelect,'store_theme_url')); 402 if ($rs->f(0)==0) { 403 $strReq = sprintf($strReqFormat,'store_theme_url','http://update.dotaddict.org/dc2/themes.xml','Themes XML feed location'); 404 $core->con->execute($strReq); 392 405 } 393 406 }
Note: See TracChangeset
for help on using the changeset viewer.