mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
parent
716d54a217
commit
6b71a07794
4 changed files with 58 additions and 143 deletions
|
@ -1173,142 +1173,53 @@ function bb_date($gmepoch, $format = false, $friendly_date = true)
|
|||
return ($bb_cfg['translate_dates']) ? strtr(strtoupper($date), $lang['DATETIME']) : $date;
|
||||
}
|
||||
|
||||
// Get user's torrent client string
|
||||
function get_user_client($peer_id)
|
||||
/**
|
||||
* Get user's torrent client string
|
||||
*
|
||||
* @param string $peer_id
|
||||
* @return mixed|string
|
||||
*/
|
||||
function get_user_torrent_client(string $peer_id): mixed
|
||||
{
|
||||
static $icons_extension = '.png';
|
||||
static $clients = [
|
||||
///'-AD' => 'Advanced Download Manager',
|
||||
'-AG' => 'Ares',
|
||||
//'-AR' => 'Arctic',
|
||||
//'-AT' => 'Artemis',
|
||||
//'-AV' => 'Avicora',
|
||||
//'-AX' => 'BitPump',
|
||||
'-AZ' => 'Vuze',
|
||||
'-A~' => 'Ares',
|
||||
//'-BB' => 'BitBuddy',
|
||||
'-BC' => 'BitComet',
|
||||
'-BE' => 'BitTorrent SDK',
|
||||
//'-BF' => 'BitFlu',
|
||||
//'-BG' => 'BTGetit',
|
||||
//'-BH' => 'BitZilla',
|
||||
'-BI' => 'BiglyBT',
|
||||
'-BL' => 'BitLord',
|
||||
//'-BM' => 'BitMagnet',
|
||||
//'-BN' => 'Baidu Netdisk',
|
||||
//'-BOW' => 'Bits on Wheels',
|
||||
//'-BP' => 'BitTorrent Pro (Azureus + Spyware)',
|
||||
//'-BR' => 'BitRocket',
|
||||
//'-BS' => 'BTSlave',
|
||||
'-BT' => 'BitTorrent',
|
||||
//'-BW' => 'BitTorrent Web',
|
||||
//'-BX' => 'BittorrentX',
|
||||
//'-CD' => 'Enhanced CTorrent',
|
||||
'-CT' => 'CTorrent',
|
||||
'-DE' => 'Deluge',
|
||||
//'-DP' => 'Propagate Data Client',
|
||||
//'-EB' => 'EBit',
|
||||
//'-ES' => 'Electric Sheep',
|
||||
//'-FC' => 'FileCroc',
|
||||
'-FD' => 'Free Download Manager',
|
||||
'FD6' => 'Free Download Manager',
|
||||
'-FG' => 'FlashGet',
|
||||
'-FL' => 'Folx',
|
||||
//'-FT' => 'FoxTorrent/RedSwoosh',
|
||||
//'-FW' => 'FrostWire',
|
||||
//'-FX' => 'Freebox',
|
||||
//'-G3' => 'G3 Torrent',
|
||||
//'-GR' => 'GetRight',
|
||||
//'-GS' => 'GSTorrent',
|
||||
//'-HK' => 'Hekate',
|
||||
'-HL' => 'Halite',
|
||||
//'-HN' => 'Hydranode',
|
||||
'-KG' => 'KGet',
|
||||
'-KT' => 'KTorrent',
|
||||
//'-LC' => 'LeechCraft',
|
||||
//'-LH' => 'LH-ABC',
|
||||
//'-LP' => 'Lphant',
|
||||
'-LT' => 'libTorrent',
|
||||
//'-LW' => 'LimeWire',
|
||||
'-Lr' => 'LibreTorrent',
|
||||
'-MG' => 'MediaGet',
|
||||
//'-MK' => 'Meerkat',
|
||||
//'-ML' => 'MLDonkey',
|
||||
//'-MO' => 'MonoTorrent',
|
||||
//'-MP' => 'MooPolice',
|
||||
//'-MR' => 'Miro',
|
||||
//'-MT' => 'Moonlight',
|
||||
//'-NE' => 'BT Next Evolution',
|
||||
//'-NX' => 'Net Transport',
|
||||
//'-OS' => 'OneSwarm',
|
||||
//'-OT' => 'OmegaTorrent',
|
||||
//'-PD' => 'Pando',
|
||||
///'-PI' => 'PicoTorrent',
|
||||
//'-QD' => 'QQDownload',
|
||||
//'-QT' => 'QT 4 Torrent example',
|
||||
//'-RS' => 'Rufus',
|
||||
//'-RT' => 'Retriever',
|
||||
//'-RZ' => 'RezTorrent',
|
||||
//'-SB' => 'Swiftbit',
|
||||
///'-SD' => 'Thunder',
|
||||
//'-SM' => 'SoMud',
|
||||
///'-SP' => 'BitSpirit',
|
||||
//'-SS' => 'SwarmScope',
|
||||
//'-ST' => 'SymTorrent',
|
||||
//'-SZ' => 'Shareaza',
|
||||
//'-S~' => 'Shareaza',
|
||||
//'-TB' => 'Torch Browser',
|
||||
//'-TN' => 'Torrent .NET',
|
||||
'-TR' => 'Transmission',
|
||||
//'-TS' => 'Torrentstorm',
|
||||
//'-TT' => 'TuoTu',
|
||||
'-tT' => 'tTorrent',
|
||||
//'-UE' => "uTorrent Embedded",
|
||||
//'-UL' => 'uLeecher!',
|
||||
'-UM' => "uTorrent Mac",
|
||||
'-UT' => "uTorrent",
|
||||
'-UW' => "uTorrent Web",
|
||||
//'-VG' => 'Vagaa',
|
||||
//'-WS' => 'HTTP Seed',
|
||||
//'-WT' => 'BitLet',
|
||||
//'-WT-' => 'BitLet',
|
||||
'-WW' => 'WebTorrent',
|
||||
'-WD' => 'WebTorrent',
|
||||
//'-WY' => 'FireTorrent',
|
||||
//'-XC' => 'Xtorrent',
|
||||
//'-XF' => 'Xfplay',
|
||||
'-XL' => 'Xunlei',
|
||||
//'-XS' => 'XSwifter',
|
||||
//'-XT' => 'XanTorrent',
|
||||
//'-XX' => 'Xtorrent',
|
||||
///'-ZO' => 'Zona',
|
||||
//'-ZT' => 'Zip Torrent',
|
||||
//'-bk' => 'BitKitten (libtorrent)',
|
||||
//'-lt' => 'libTorrent (Rakshasa)',
|
||||
//'-pb' => 'pbTorrent',
|
||||
'-PI' => 'PicoTorrent',
|
||||
'-qB' => 'qBittorrent',
|
||||
//'-st' => 'SharkTorrent',
|
||||
//'346-' => 'TorrentTopia',
|
||||
//'AZ2500BT' => 'BitTyrant (Azureus Mod)',
|
||||
//'BLZ' => 'Blizzard Downloader',
|
||||
//'DNA' => 'BitTorrent DNA',
|
||||
//'FD6' => 'Free Download Manager 6',
|
||||
//'LIME' => 'Limewire',
|
||||
'M' => 'BitTorrent',
|
||||
'MG' => 'MediaGet',
|
||||
//'Mbrst' => 'burst!',
|
||||
'OP' => 'Opera',
|
||||
//'Pando' => 'Pando',
|
||||
//'Plus' => 'Plus!',
|
||||
//'Q' => 'Queen Bee',
|
||||
//'QVOD' => 'QVOD',
|
||||
///'S3' => 'Amazon S3',
|
||||
'TIX' => 'Tixati',
|
||||
'aria2-' => 'Aria2',
|
||||
'A2' => 'Aria2',
|
||||
//'btpd' => 'BT Protocol Daemon',
|
||||
//'eX' => 'eXeem',
|
||||
//'martini' => 'Martini Man',
|
||||
'-AG' => 'Ares', '-AZ' => 'Vuze', '-A~' => 'Ares', '-BC' => 'BitComet',
|
||||
'-BE' => 'BitTorrent SDK', '-BI' => 'BiglyBT', '-BL' => 'BitLord', '-BT' => 'BitTorrent',
|
||||
'-CT' => 'CTorrent', '-DE' => 'Deluge', '-FD' => 'Free Download Manager', 'FD6' => 'Free Download Manager',
|
||||
'-FG' => 'FlashGet', '-FL' => 'Folx', '-HL' => 'Halite', '-KG' => 'KGet',
|
||||
'-KT' => 'KTorrent', '-LT' => 'libTorrent', '-Lr' => 'LibreTorrent', '-MG' => 'MediaGet',
|
||||
'-TR' => 'Transmission', '-tT' => 'tTorrent', '-UM' => "uTorrent Mac", '-UT' => "uTorrent",
|
||||
'-UW' => "uTorrent Web", '-WW' => 'WebTorrent', '-WD' => 'WebTorrent', '-XL' => 'Xunlei',
|
||||
'-PI' => 'PicoTorrent', '-qB' => 'qBittorrent', 'M' => 'BitTorrent', 'MG' => 'MediaGet',
|
||||
'OP' => 'Opera', 'TIX' => 'Tixati', 'aria2-' => 'Aria2', 'A2' => 'Aria2',
|
||||
/**
|
||||
* ================================ Other ================================
|
||||
* '-BB' => 'BitBuddy', '-AR' => 'Arctic', '-AT' => 'Artemis', '-AV' => 'Avicora',
|
||||
* '-AX' => 'BitPump', '-BB' => 'BitBuddy', '-AD' => 'Advanced Download Manager', '-BF' => 'BitFlu',
|
||||
* '-BG' => 'BTGetit', '-BH' => 'BitZilla', '-BM' => 'BitMagnet', '-BN' => 'Baidu Netdisk',
|
||||
* '-BOW' => 'Bits on Wheels', '-BP' => 'BitTorrent Pro (Azureus + Spyware)', '-BR' => 'BitRocket', '-BS' => 'BTSlave',
|
||||
* '-BW' => 'BitTorrent Web', '-BX' => 'BittorrentX', '-CD' => 'Enhanced CTorrent', '-DP' => 'Propagate Data Client',
|
||||
* '-EB' => 'EBit', '-ES' => 'Electric Sheep', '-FC' => 'FileCroc', '-HN' => 'Hydranode',
|
||||
* '-FT' => 'FoxTorrent/RedSwoosh', '-FW' => 'FrostWire', '-FX' => 'Freebox', '-G3' => 'G3 Torrent',
|
||||
* '-GR' => 'GetRight', '-GS' => 'GSTorrent', '-HK' => 'Hekate', '-LW' => 'LimeWire',
|
||||
* '-LC' => 'LeechCraft', '-LH' => 'LH-ABC', '-LP' => 'Lphant', '-UE' => "uTorrent Embedded",
|
||||
* '-UL' => 'uLeecher!', '-TS' => 'Torrentstorm', '-TT' => 'TuoTu', '-MK' => 'Meerkat',
|
||||
* '-ML' => 'MLDonkey', '-MO' => 'MonoTorrent', '-MP' => 'MooPolice', '-MR' => 'Miro',
|
||||
* '-MT' => 'Moonlight', '-NE' => 'BT Next Evolution', '-NX' => 'Net Transport', '-OS' => 'OneSwarm', '-OT' => 'OmegaTorrent',
|
||||
* '-PD' => 'Pando', '-PI' => 'PicoTorrent', '-QD' => 'QQDownload', '-QT' => 'QT 4 Torrent example',
|
||||
* '-RS' => 'Rufus', '-RT' => 'Retriever', '-RZ' => 'RezTorrent', '-SB' => 'Swiftbit',
|
||||
* '-SD' => 'Thunder', '-SM' => 'SoMud', '-SP' => 'BitSpirit', '-SS' => 'SwarmScope',
|
||||
* '-ST' => 'SymTorrent', '-SZ' => 'Shareaza', '-S~' => 'Shareaza', '-TB' => 'Torch Browser',
|
||||
* '-TN' => 'Torrent .NET', '-WY' => 'FireTorrent', '-XC' => 'Xtorrent', '-XF' => 'Xfplay',
|
||||
* '-VG' => 'Vagaa', '-WS' => 'HTTP Seed', '-WT' => 'BitLet', '-WT-' => 'BitLet',
|
||||
* '-XS' => 'XSwifter', '-XT' => 'XanTorrent', '-XX' => 'Xtorrent', '-ZO' => 'Zona',
|
||||
* '-ZT' => 'Zip Torrent', '-bk' => 'BitKitten (libtorrent)', '-lt' => 'libTorrent (Rakshasa)', '-pb' => 'pbTorrent', 'Mbrst' => 'burst!',
|
||||
* '-st' => 'SharkTorrent', '346-' => 'TorrentTopia', 'AZ2500BT' => 'BitTyrant (Azureus Mod)', 'BLZ' => 'Blizzard Downloader',
|
||||
* 'DNA' => 'BitTorrent DNA', 'FD6' => 'Free Download Manager 6', 'LIME' => 'Limewire', 'Pando' => 'Pando',
|
||||
* 'Plus' => 'Plus!', 'Q' => 'Queen Bee', 'QVOD' => 'QVOD', 'S3' => 'Amazon S3',
|
||||
* 'btpd' => 'BT Protocol Daemon', 'eX' => 'eXeem', 'martini' => 'Martini Man',
|
||||
* =======================================================================
|
||||
**/
|
||||
];
|
||||
|
||||
$bestMatchLength = 0;
|
||||
|
@ -1321,9 +1232,13 @@ function get_user_client($peer_id)
|
|||
}
|
||||
|
||||
if (!empty($bestMatch)) {
|
||||
return '<img width="auto" height="auto" style="display:inline!important;vertical-align:middle" src="/styles/images/clients/'. $bestMatch .'.png" alt="' . $bestMatch . '" title="' . $peer_id . '">';
|
||||
}
|
||||
else {
|
||||
$client_icons_dir = IMAGES_DIR . '/clients/' . $bestMatch . $icons_extension;
|
||||
if (file_exists($client_icons_dir)) {
|
||||
return '<img width="auto" height="auto" style="display: inline !important; vertical-align: middle;" src="' . $client_icons_dir . '" alt="' . $peer_id . '" title="' . $bestMatch . '">';
|
||||
} else {
|
||||
return $bestMatch;
|
||||
}
|
||||
} else {
|
||||
return $peer_id;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue