Changeset 2023
- Timestamp:
- 11/01/2015 06:33:25 PM (10 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-components.php
r2022 r2023 392 392 } 393 393 394 $history = $this->api->get_component_history( $component );394 $history = $this->api->get_component_history( $component, self::last_x_days ); 395 395 $direction = ''; 396 396 if ( $history['change'] > 0 ) { -
sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications-db.php
r2022 r2023 2 2 /** 3 3 * This class must execute queries valid for both MySQL and SQLite3. 4 * The DB driver must be wpdb or Trac_Notifications_SQLite_Driver. 5 * It must work without any other dependencies, such as WordPress. 4 6 */ 5 class Trac_Notifications_DB {7 class Trac_Notifications_DB implements Trac_Notifications_API { 6 8 function __construct( $db ) { 7 9 $this->db = $db; … … 60 62 } 61 63 62 function get_component_history( $component ) {63 $days_ago = ( time() - ( 86400 * Make_Core_Trac_Components::last_x_days ) ) * 1000000;64 function get_component_history( $component, $last_x_days = 7 ) { 65 $days_ago = ( time() - ( 86400 * $last_x_days ) ) * 1000000; 64 66 $closed_reopened = $this->db->get_results( $this->db->prepare( "SELECT newvalue, COUNT(DISTINCT ticket) as count 65 67 FROM ticket_change tc INNER JOIN ticket t ON tc.ticket = t.id -
sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications.php
r2022 r2023 24 24 } 25 25 26 require __DIR__ . '/trac-notifications-db.php';26 spl_autoload_register( array( $this, 'autoload' ) ); 27 27 28 28 if ( function_exists( 'add_db_table' ) ) { … … 44 44 add_action( 'template_redirect', array( $this, 'action_template_redirect' ) ); 45 45 add_shortcode( 'trac-notifications', array( $this, 'notification_settings_page' ) ); 46 } 47 48 function autoload( $class ) { 49 $class = strtolower( $class ); 50 if ( 0 === strpos( $class, 'trac_notifications_' ) ) { 51 require __DIR__ . '/' . str_replace( '_', '-', $class ) . '.php'; 52 } 46 53 } 47 54
Note: See TracChangeset
for help on using the changeset viewer.