Changeset 1416531
- Timestamp:
- 05/13/2016 06:55:33 PM (10 years ago)
- Location:
- katracker/trunk
- Files:
-
- 5 edited
-
README.txt (modified) (1 diff)
-
functions.php (modified) (3 diffs)
-
katracker.php (modified) (1 diff)
-
tracker/katracker.core.php (modified) (2 diffs)
-
tracker/tracker-announce.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
katracker/trunk/README.txt
r1408047 r1416531 47 47 48 48 == Changelog == 49 = 1.0.3 = 50 * Fixed seed/peer statistics 49 51 50 52 = 1.0 = -
katracker/trunk/functions.php
r1407729 r1416531 124 124 * @return int 125 125 */ 126 function get_ torrent_seeders( $torrent_id=null ) {126 function get_seeder_count( $torrent_id=null ) { 127 127 global $wpdb; 128 128 return $wpdb->get_var( … … 142 142 * @return int 143 143 */ 144 function get_ torrent_leechers( $torrent_id=null ) {144 function get_leecher_count( $torrent_id=null ) { 145 145 global $wpdb; 146 146 return $wpdb->get_var( … … 166 166 'leechers' => get_torrent_meta( $torrent_id, 'leechers' ), 167 167 ) : array( 168 'seeders' => get_ torrent_seeders(),169 'leechers' => get_ torrent_leechers(),168 'seeders' => get_seeder_count(), 169 'leechers' => get_leecher_count(), 170 170 ); 171 171 } -
katracker/trunk/katracker.php
r1407738 r1416531 5 5 * Description: The only full and all powerful, complete bittorrent tracker integration for wordpress. 6 6 * Author: nicoco 7 * Version: 1.0. 27 * Version: 1.0.3 8 8 * Author URI: kateam.org 9 9 * License: GPL2 -
katracker/trunk/tracker/katracker.core.php
r1407729 r1416531 256 256 // fetch peer total 257 257 $total = $wpdb->get_var( 258 // select a count of the number of peers that match the given info_hash 259 "SELECT COUNT( * ) FROM `" . KATRACKER_DB_PREFIX . "peers` WHERE info_hash='{$_GET['info_hash']}'" 258 // select a count of the number of peers 259 "SELECT COUNT( * ) FROM `" . KATRACKER_DB_PREFIX . "peers` " . 260 // that match the given info_hash 261 "WHERE info_hash='{$_GET['info_hash']}'" 260 262 ); 261 263 … … 393 395 public static function flush_statistics() 394 396 { 397 // if the torrent does not exists as file in wordpress db, do nothing. 395 398 if ( !$torrent_id = get_torrent_id_from_hash( $_GET['info_hash'] ) ) return; 396 399 397 global $wpdb; 398 $stats = get_torrent_stats( $torrent_id ); 399 400 update_torrent_meta( $torrent_id, 'seeders', $stats['seeders'] ); 401 update_torrent_meta( $torrent_id, 'leechers', $stats['leechers'] ); 400 update_torrent_meta( $torrent_id, 'seeders', get_seeder_count( $torrent_id ) ); 401 update_torrent_meta( $torrent_id, 'leechers', get_leecher_count( $torrent_id ) ); 402 402 } 403 403 -
katracker/trunk/tracker/tracker-announce.php
r1407729 r1416531 83 83 84 84 // Handle Request ////////////////////////////////////////////////////////////////////////////////// 85 // flush wordpress statistics86 KatrackerCore::flush_statistics();87 85 88 86 // check if the torrent is approved by the tracker … … 95 93 KatrackerCore::event(); 96 94 95 // flush wordpress statistics 96 KatrackerCore::flush_statistics(); 97 97 98 98 exit;
Note: See TracChangeset
for help on using the changeset viewer.