├── Plugin └── V2raySocks │ ├── config.php │ ├── templates │ ├── error.tpl │ ├── static │ │ ├── skin │ │ │ └── default │ │ │ │ ├── icon.png │ │ │ │ ├── icon-ext.png │ │ │ │ ├── loading-0.gif │ │ │ │ ├── loading-1.gif │ │ │ │ ├── loading-2.gif │ │ │ │ └── layer.css │ │ ├── js │ │ │ ├── html5-qrcode.js │ │ │ ├── SSRscript.js │ │ │ ├── layui.js │ │ │ └── qrcode.js │ │ ├── css │ │ │ ├── layer.css │ │ │ ├── style.css │ │ │ └── layui.css │ │ ├── mobile │ │ │ ├── layer.js │ │ │ └── need │ │ │ │ └── layer.css │ │ ├── layer.css │ │ └── layer.js │ └── details.tpl │ ├── lib │ └── functions.php │ ├── lang │ ├── chinese.php │ └── english.php │ └── V2raySocks.php ├── Crons ├── ReadMe.md ├── ChartInfo.php └── MysqlBandReset.php ├── README.md ├── Sql └── MyV2Ray.sql └── LICENSE /Plugin/V2raySocks/config.php: -------------------------------------------------------------------------------- 1 | 2 |
{$usefulErrorHelper}
3 | -------------------------------------------------------------------------------- /Plugin/V2raySocks/templates/static/skin/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinrishuofa/V2raySocks/HEAD/Plugin/V2raySocks/templates/static/skin/default/icon.png -------------------------------------------------------------------------------- /Plugin/V2raySocks/templates/static/skin/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinrishuofa/V2raySocks/HEAD/Plugin/V2raySocks/templates/static/skin/default/icon-ext.png -------------------------------------------------------------------------------- /Plugin/V2raySocks/templates/static/skin/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinrishuofa/V2raySocks/HEAD/Plugin/V2raySocks/templates/static/skin/default/loading-0.gif -------------------------------------------------------------------------------- /Plugin/V2raySocks/templates/static/skin/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinrishuofa/V2raySocks/HEAD/Plugin/V2raySocks/templates/static/skin/default/loading-1.gif -------------------------------------------------------------------------------- /Plugin/V2raySocks/templates/static/skin/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinrishuofa/V2raySocks/HEAD/Plugin/V2raySocks/templates/static/skin/default/loading-2.gif -------------------------------------------------------------------------------- /Crons/ReadMe.md: -------------------------------------------------------------------------------- 1 | # 用法 2 | * MysqlBandReset.php是用来根据到期时间的日(day)来重置流量的 3 | * ChartInfo.php是用来记录使用流量的,可不配置。 4 | 5 | ## 建议用法 6 | 0 0 * * * php -q /home/wwwroot/MysqlBandReset.php 7 | 1 */3 * * * php -q /home/wwwroot/ChartInfo.php -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # V2raySocks 2 | ## 一个售卖v2ray的whmcs插件 3 | * 当前版本 0.0.1Beta1 4 | 5 | ## 支持的功能: 6 | * 流量图表 7 | * 流量重置(每月开始,每月底,由结算日计算) 8 | * 公告信息 9 | * VMESS二维码 10 | * 随机UUID 11 | 12 | ## 注意事项 13 | * 如果要使用MysqlBandReset,你必须在MysqlBandReset.php中配置数据库信息 14 | * 需要更多支持,请开issue或者给我发邮件 15 | 16 | ## 如果感觉插件好用,嘘寒问暖不如打笔巨款~ 17 | * Paypal捐赠 zzm317@outlook.com 18 | * 支付宝捐赠 admin@loli.ren -------------------------------------------------------------------------------- /Plugin/V2raySocks/lib/functions.php: -------------------------------------------------------------------------------- 1 | mysql_real_escape_string($_SESSION[$field]))); 30 | if($data = mysql_fetch_row($sqlresult)){ 31 | return reset($data); 32 | } 33 | return false; 34 | }catch(Exception $e){ 35 | logModuleCall('V2raySocks', 'V2raySocks_MultiLanguageSupport', $field, $e->getMessage(), $e->getTraceAsString()); 36 | return false; 37 | } 38 | } 39 | 40 | function V2raySocks_get_lang($var){ 41 | global $_VLANG; 42 | return isset($_VLANG[$var]) ? $_VLANG[$var] : $var . '(Missing Language)' ; 43 | } 44 | -------------------------------------------------------------------------------- /Sql/MyV2Ray.sql: -------------------------------------------------------------------------------- 1 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 2 | SET time_zone = "+00:00"; 3 | 4 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 5 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 6 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 7 | /*!40101 SET NAMES utf8mb4 */; 8 | 9 | CREATE DATABASE IF NOT EXISTS `MyV2Ray` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; 10 | USE `MyV2Ray`; 11 | 12 | DROP TABLE IF EXISTS `user`; 13 | CREATE TABLE IF NOT EXISTS `user` ( 14 | `id` int(11) NOT NULL, 15 | `uuid` varchar(36) NOT NULL, 16 | `t` int(11) NOT NULL DEFAULT '0', 17 | `u` bigint(20) NOT NULL, 18 | `d` bigint(20) NOT NULL, 19 | `transfer_enable` bigint(20) NOT NULL, 20 | `enable` tinyint(4) NOT NULL DEFAULT '1', 21 | `created_at` int(10) NOT NULL, 22 | `updated_at` int(10) NOT NULL, 23 | `need_reset` tinyint(1) NOT NULL DEFAULT '1', 24 | `sid` int(11) NOT NULL 25 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 26 | 27 | DROP TABLE IF EXISTS `user_usage`; 28 | CREATE TABLE IF NOT EXISTS `user_usage` ( 29 | `sid` int(11) NOT NULL, 30 | `date` int(11) NOT NULL, 31 | `upload` text NOT NULL, 32 | `download` text NOT NULL, 33 | `tupload` text NOT NULL, 34 | `tdownload` text NOT NULL 35 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; 36 | 37 | 38 | ALTER TABLE `user` 39 | ADD PRIMARY KEY (`id`); 40 | 41 | 42 | ALTER TABLE `user` 43 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; 44 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 45 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 46 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 47 | -------------------------------------------------------------------------------- /Crons/ChartInfo.php: -------------------------------------------------------------------------------- 1 | query($sql); 13 | $uasql = "Select * FROM `user_usage` ORDER BY `date`"; 14 | $old_user_usage = $mysql->query($uasql); 15 | $ua = array(); 16 | if($old_user_usage){ 17 | foreach($old_user_usage as $oua){ 18 | $add = false; 19 | if($ua[$oua['sid']]){ 20 | if($ua[$oua['sid']]['date'] <= $oua['date']){ 21 | $add = true; 22 | } 23 | }else{ 24 | $add = true; 25 | } 26 | if($add){ 27 | $ua[$oua['sid']] = array( 28 | 'u' => $oua['tupload'], 29 | 'd' => $oua['tdownload'], 30 | 'date' => $oua['date'] 31 | ); 32 | } 33 | } 34 | }else{ 35 | $ua = false; 36 | } 37 | $nua = array(); 38 | if($users){ 39 | foreach($users as $user){ 40 | if($user['enable'] = 1){ 41 | if($ua[$user['sid']]){ 42 | $nua[$user['sid']] = array( 43 | 'u' => $user['u'] - $ua[$user['sid']]['u'], 44 | 'd' => $user['d'] - $ua[$user['sid']]['d'], 45 | 'tu' => $user['u'], 46 | 'td' => $user['d'], 47 | 'date' => time(), 48 | 'sid' => $user['sid'] 49 | ); 50 | }else{ 51 | $nua[$user['sid']] = array( 52 | 'u' => $user['u'], 53 | 'd' => $user['d'], 54 | 'tu' => $user['u'], 55 | 'td' => $user['d'], 56 | 'date' => time(), 57 | 'sid' => $user['sid'] 58 | ); 59 | } 60 | } 61 | } 62 | }else{ 63 | echo("Mysql无数据"); 64 | $nua = false; 65 | } 66 | if($nua){ 67 | foreach($nua as $up){ 68 | $dataa = $up['u'].",".$up['d'].",".$up['tu'].",".$up['td'].",".$up['date'].",".$up['sid']; 69 | $upmysql = "INSERT INTO `user_usage` (`upload`,`download`,`tupload`,`tdownload`,`date`,`sid`) VALUES(".$dataa.")"; 70 | $mysql->query($upmysql); 71 | } 72 | echo("操作完成,时间".date('Y-m-d H:i:s',time()).""); 73 | $datee = time(); 74 | $oldatee = $datee - 3600*24*6; 75 | $dlsql = "delete from `user_usage` where `date` <= ".$oldatee; 76 | $mysql->query($dlsql); 77 | echo(date('Y-m-d H:i:s',$oldatee)."前的数据已删除"); 78 | } 79 | } 80 | 81 | ?> -------------------------------------------------------------------------------- /Plugin/V2raySocks/templates/static/js/html5-qrcode.js: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------- 2 | // JavaScript-HTML5 QRCode Generator 3 | // 4 | // Copyright (c) 2011 Amanuel Tewolde 5 | // 6 | // Licensed under the MIT license: 7 | // http://www.opensource.org/licenses/mit-license.php 8 | // 9 | //--------------------------------------------------------------------- 10 | 11 | // Generates a QRCode of text provided. 12 | // First QRCode is rendered to a canvas. 13 | // The canvas is then turned to an image PNG 14 | // before being returned as an'+(n.content||"")+"
"),n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),s.innerHTML=(n.shade?"':"")+'{$infos}
82 || {V2raySocks_get_lang('subscribe_url')} | 109 | 110 | 111 |
|---|
| {$HTTP_HOST}/modules/servers/UnlimitedSocks/subscribe.php?sid={$serviceid}&token={$subscribe_token} | 116 | 117 | 130 |
| {V2raySocks_get_lang('uuid')} | 145 | 146 | 147 |
|---|
| {$usage.uuid} | 152 | 153 | 154 |
{V2raySocks_get_lang('used')} ({$usage.s_MB_GB})
166 |{V2raySocks_get_lang('upload')} ({$usage.u_MB_GB})
172 |{V2raySocks_get_lang('download')} ({$usage.d_MB_GB})
178 || {V2raySocks_get_lang('name')} | 195 | 196 | 197 | 198 |{V2raySocks_get_lang('action')} | 199 |
|---|---|
| {$node[0]} | 206 | 207 | 208 | 209 |210 | 214 | 218 | {$yy = $yy + 1} 219 | | 220 |
| {V2raySocks_get_lang('bandwidth')} | 237 |{V2raySocks_get_lang('duedate')} | 238 | 239 |
|---|---|
| {$usedcard['traffic']} | 245 |{$usedcard['duedate']} | 246 | 247 |
| {V2raySocks_get_lang('bandwidth')} | 265 |{V2raySocks_get_lang('duedate')} | 266 | 267 |
|---|---|
| {$usedcard['traffic']} | 273 |{$usedcard['duedate']} | 274 | 275 |