Changeset 497
- Timestamp:
- 08/09/2010 03:00:31 AM (18 months ago)
- Location:
- trunk/WordPress/plugin/transposh/wp
- Files:
-
- 2 edited
-
transposh_backup.php (modified) (1 diff)
-
transposh_db.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WordPress/plugin/transposh/wp/transposh_backup.php
r492 r497 109 109 $trans = split(',', $line); 110 110 if ($trans[0]) 111 $this->transposh->database->restore_translation($trans[0], $trans[1], $trans[2], $trans[3], $trans[4]);111 $this->transposh->database->restore_translation($trans[0], $trans[1], $trans[2], $trans[3], $trans[4]); 112 112 } 113 apc_clear_cache('user'); // clean up cache so that results will actually show 113 // clean up cache so that results will actually show 114 if (ENABLE_APC && function_exists('apc_clear_cache')) 115 apc_clear_cache('user'); 114 116 exit; 115 117 } -
trunk/WordPress/plugin/transposh/wp/transposh_db.php
r492 r497 290 290 291 291 // If we have caching - we remove previous entry from cache 292 if (ENABLE_APC && function_exists('apc_ store')) {292 if (ENABLE_APC && function_exists('apc_delete')) { 293 293 apc_delete($original . '___' . $lang); 294 294 } … … 570 570 $cleanup = 'DELETE ' . $GLOBALS['wpdb']->prefix . TRANSLATIONS_TABLE . ' ,' . $GLOBALS['wpdb']->prefix . TRANSLATIONS_LOG . 571 571 ' FROM ' . $GLOBALS['wpdb']->prefix . TRANSLATIONS_TABLE . 572 ' INNER JOIN ' . $GLOBALS['wpdb']->prefix . TRANSLATIONS_LOG.573 ' ON ' .$GLOBALS['wpdb']->prefix . TRANSLATIONS_TABLE .'.original = '.$GLOBALS['wpdb']->prefix . TRANSLATIONS_LOG .'.original'.574 ' AND ' .$GLOBALS['wpdb']->prefix . TRANSLATIONS_TABLE .'.lang = '.$GLOBALS['wpdb']->prefix . TRANSLATIONS_LOG .'.lang'.575 ' WHERE ' . $GLOBALS['wpdb']->prefix . TRANSLATIONS_TABLE.'.source > 0'.572 ' INNER JOIN ' . $GLOBALS['wpdb']->prefix . TRANSLATIONS_LOG . 573 ' ON ' . $GLOBALS['wpdb']->prefix . TRANSLATIONS_TABLE . '.original = ' . $GLOBALS['wpdb']->prefix . TRANSLATIONS_LOG . '.original' . 574 ' AND ' . $GLOBALS['wpdb']->prefix . TRANSLATIONS_TABLE . '.lang = ' . $GLOBALS['wpdb']->prefix . TRANSLATIONS_LOG . '.lang' . 575 ' WHERE ' . $GLOBALS['wpdb']->prefix . TRANSLATIONS_TABLE . '.source > 0' . 576 576 " AND timestamp < SUBDATE(NOW(),$days)"; 577 apc_clear_cache('user'); // clean up cache so that results will actually show 577 // clean up cache so that results will actually show 578 if (ENABLE_APC && function_exists('apc_clear_cache')) 579 apc_clear_cache('user'); 580 578 581 $result = $GLOBALS['wpdb']->query($cleanup); 579 582 exit; 580 583 } 581 584 582 function restore_translation($original, $lang,$translation,$by,$timestamp) {585 function restore_translation($original, $lang, $translation, $by, $timestamp) { 583 586 // TODO in future 584 587 // if there is a newer human translation, just ignore this … … 589 592 $values .= "('" . $original . "','" . $translation . "','" . $lang . "','" . $source . "')"; 590 593 $delvalues .= "(original ='$original' AND lang='$lang')"; 591 // Setting the transaction log records592 $logvalues .= "('" . $original . "','" . $translation . "','" . $lang . "','" . $by . "',FROM_UNIXTIME(" . $timestamp . "),'" . $source . "')" ;594 // Setting the transaction log records 595 $logvalues .= "('" . $original . "','" . $translation . "','" . $lang . "','" . $by . "',FROM_UNIXTIME(" . $timestamp . "),'" . $source . "')"; 593 596 594 597 $update = "DELETE FROM " . $GLOBALS['wpdb']->prefix . TRANSLATIONS_TABLE . " WHERE $delvalues";
Note: See TracChangeset
for help on using the changeset viewer.
