Changeset 1455925
- Timestamp:
- 07/17/2016 08:31:57 AM (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/tracker-download.php (modified) (1 diff)
-
tracker/tracker-magnet.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
katracker/trunk/README.txt
r1435432 r1455925 71 71 72 72 == Changelog == 73 = 1.0.9 = 74 * Fixed statistics in admin page 75 * Minor bug fixes 76 73 77 = 1.0.8 = 74 78 * Bug fixes (note to self: do not commit after 2AM) -
katracker/trunk/functions.php
r1434444 r1455925 127 127 global $wpdb; 128 128 return $wpdb->get_var( 129 // select total seeders130 'SELECT SUM( state=1) ' .129 // select total count 130 'SELECT count( * ) ' . 131 131 // from peers 132 132 "FROM `" . KATRACKER_DB_PREFIX . "peers` " . 133 133 // that match info_hash 134 ( isset( $torrent_id ) ? "WHERE info_hash = '" . get_torrent_meta( $torrent_id, 'hash-info' ) . "'" : '' ) 134 ( isset( $torrent_id ) ? "WHERE info_hash = '" . get_torrent_meta( $torrent_id, 'hash-info' ) . "' AND " : "WHERE " ) . 135 // and are currently seeding 136 "state = 1" 135 137 ) + 0; 136 138 } … … 145 147 global $wpdb; 146 148 return $wpdb->get_var( 147 // select total leechers148 'SELECT SUM( state=0) ' .149 // select total count 150 'SELECT count( * ) ' . 149 151 // from peers 150 152 "FROM `" . KATRACKER_DB_PREFIX . "peers` " . 151 153 // that match info_hash 152 ( isset( $torrent_id ) ? "WHERE info_hash = '" . get_torrent_meta( $torrent_id, 'hash-info' ) . "'" : '' ) 153 ) + 0; 154 ( isset( $torrent_id ) ? "WHERE info_hash = '" . get_torrent_meta( $torrent_id, 'hash-info' ) . "' AND " : "WHERE " ) . 155 // and are currently leeching 156 "state = 0" 157 ) + 0; 154 158 } 155 159 … … 191 195 return $wpdb->get_var( 192 196 // select count 193 "SELECT COUNT( DISTINCT `info_hash`) " .197 "SELECT COUNT( * ) " . 194 198 // from wordpress posts table 195 "FROM `" . KATRACKER_DB_PREFIX . "peers`" 199 "FROM `{$wpdb->posts}` " . 200 // only attachment 201 "WHERE post_type = 'attachment' " . 202 // of type torrent 203 "AND post_mime_type = 'torrent/torrent'" 196 204 ) + 0; 197 205 } -
katracker/trunk/katracker.php
r1434444 r1455925 5 5 * Description: The only full and all powerful, complete bittorrent tracker integration for wordpress. 6 6 * Author: nicoco 7 * Version: 1.0. 87 * Version: 1.0.9 8 8 * Author URI: kateam.org 9 9 * License: GPL2 -
katracker/trunk/tracker/tracker-download.php
r1407729 r1455925 39 39 update_torrent_meta( $_GET['torrent'], 'hits', $hits + 1); 40 40 41 exit( $torrent->send( $filename . '.torrent' ) ); 41 $torrent->send( $filename . '.torrent' ); 42 exit; 42 43 } 43 44 -
katracker/trunk/tracker/tracker-magnet.php
r1433917 r1455925 12 12 get_katracker_option( 'tracked-access' ) || 13 13 get_katracker_option( 'open-tracker' ) ) { 14 15 14 if ( $magnet = get_torrent_meta( $_GET['torrent'], 'magnet' ) ) { 16 increment_torrent_hits( $_GET['torrent'] ); 17 exit( wp_redirect( $magnet ) ); 15 update_torrent_meta( $_GET['torrent'], 'completed', get_torrent_meta( $_GET['torrent'], 'completed' ) + 1 ); 16 wp_redirect( $magnet ); ?> 17 <a href="javascript:history.go(-1)" style="position:absolute;right:50%;">Back</a> 18 <?php exit; 18 19 } 19 20 }
Note: See TracChangeset
for help on using the changeset viewer.