Changeset 382


Ignore:
Timestamp:
02/28/2010 10:37:47 PM (2 years ago)
Author:
ofer
Message:

Support getting global human translations history

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WordPress/plugin/transposh/wp/transposh_db.php

    r365 r382  
    288288        exit; 
    289289    } 
     290     
     291    /** 
     292     * Function to return human translations history 
     293     * @param string $date - either null for all or a date to get terms after 
     294     * @return array List of rows  
     295     */ 
     296    function get_all_human_translation_history($date ="null", $limit = "") { 
     297 
     298        $table_name = $GLOBALS['wpdb']->prefix . TRANSLATIONS_LOG; 
     299        logger ("table is $table_name",4); 
     300 
     301        //add  our own custom header - so we will know that we got here 
     302//        header("Transposh: v-".TRANSPOSH_PLUGIN_VER." db_version-". DB_VERSION); 
     303 
     304        if ($date != "null") $dateterm = "and UNIX_TIMESTAMP(timestamp) > $date"; 
     305        if ($limit) $limitterm = "LIMIT $limit"; 
     306        $query = "SELECT original, lang, translated, translated_by, UNIX_TIMESTAMP(timestamp) as timestamp ". 
     307                "FROM $table_name ". 
     308                "WHERE source= 0 $dateterm ". 
     309                "ORDER BY timestamp ASC $limitterm"; 
     310        logger ("query is $query"); 
     311 
     312        $rows = $GLOBALS['wpdb']->get_results($query); 
     313        return $rows; 
     314    } 
    290315 
    291316    /* 
Note: See TracChangeset for help on using the changeset viewer.