Changeset 37 for system/generators/traffic_shaping.php
- Timestamp:
- Jan 31, 2008, 8:38:47 PM (17 years ago)
- Location:
- system
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
system
-
Property svn:ignore
set to
nohup.out
-
Property svn:ignore
set to
-
system/generators/traffic_shaping.php
r7 r37 3 3 $Enabled = 1; 4 4 $ClassesEnabled = 1; 5 include('global.php'); 6 include_once('../../html/is/db.php'); 7 DB_Init('localhost', 'root', '', 'is'); 8 DB_Query('SET NAMES latin2'); 9 5 include_once('../../html/global.php'); 10 6 include_once('../../html/finance/include.php'); 11 7 NactiMesicniParametry(0); … … 51 47 { 52 48 fputs($File, "tc qdisc add dev imq0 root handle 1:0 htb default 2\n"); 53 fputs($FileClassInfo, "1:1 Z ákladní tøída\n");49 fputs($FileClassInfo, "1:1 Z�ladn�t�a\n"); 54 50 fputs($File, "tc class add dev imq0 parent 1:0 classid 1:1 htb rate ".$TotalMaxSpeedIn."kbit quantum 1500\n"); 55 51 fputs($FileClassInfo, "1:2 Internet zdarma\n"); … … 102 98 fputs($File, "tc class add dev imq0 parent 1:1 classid 1:".$AllUsersClassId." htb rate ".$UsersMaxSpeedIn."kbit prio 1 quantum 1500\n"); 103 99 fputs($File, "tc class add dev imq1 parent 1:1 classid 1:".$AllUsersClassId." htb rate ".$UsersMaxSpeedOut."kbit prio 1 quantum 1500\n"); 104 fputs($FileClassInfo, '1:'.$AllUsersClassId." V ¹ichni u¾ivatelé\n");100 fputs($FileClassInfo, '1:'.$AllUsersClassId." Vichni uivatel�n"); 105 101 106 102 // Torrent sharing … … 121 117 fputs($FileClassInfo, '1:'.$TorrentClassId." Torrent\n"); 122 118 123 DB_Select('users', '*, CONCAT(second_name, " ", first_name) as fullname', '(inet=1)');124 while($User = DB_Row())119 $DbResult = $Database->select('users', '*, CONCAT(second_name, " ", first_name) as fullname', '(inet=1)'); 120 while($User = $DbResult->fetch_array()) 125 121 { 126 122 $UserClassId = $ClassId; … … 132 128 $Quantum = $Tarify[$User['inet_tarif_now']]['speed_factor'] * 1500; 133 129 134 DB_Save();135 130 fputs($File, "# === ".$User['fullname']." ===\n"); 136 131 fputs($File, "tc class add dev imq0 parent 1:".$AllUsersClassId." classid 1:".$UserClassId." htb rate ".$SpeedIn."bit ceil ".$UserMaxSpeedIn."bit prio 1 quantum ".$Quantum."\n"); … … 144 139 //echo('User class id: '.$UserClassId."\n"); 145 140 146 DB_Select('hosts', 'COUNT(*)', "block=0 AND MAC!='' AND user=".$User['id']);147 $Row = DB_Row();141 $DbResult2 = $Database->select('hosts', 'COUNT(*)', "block=0 AND MAC!='' AND user=".$User['id']); 142 $Row = $DbResult2->fetch_array(); 148 143 $HostCount = $Row[0]; 149 144 $HostSpeedIn = round($SpeedIn / $HostCount); 150 145 $HostSpeedOut = round($SpeedOut / $HostCount); 151 146 152 DB_Select('hosts','*',"block=0 AND MAC!='' AND user=".$User['id']);153 while($Host = DB_Row())147 $DbResult2 = $Database->select('hosts','*',"block=0 AND MAC!='' AND user=".$User['id']); 148 while($Host = $DbResult2->fetch_array()) 154 149 //if($Row['name'] != 'WOW') 155 150 { … … 267 262 268 263 } 269 DB_Load();270 264 } 271 265 //echo($Row['id'].',');
Note:
See TracChangeset
for help on using the changeset viewer.