Changeset 7 for measure_scripts/traffic.php
- Timestamp:
- Oct 16, 2007, 10:23:06 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
measure_scripts/traffic.php
r6 r7 97 97 while(1) 98 98 { 99 100 99 // Network load 101 100 $NetworkStat = GetNetworkStat(); … … 115 114 116 115 // GM online 117 DB_Init('localhost', 'root', '','realmd');118 DB_Query('SELECT COUNT(*) FROM account WHERE online=1 AND gmlevel > 0');119 $Row = DB_Row();116 $Database->select_db('realmd'); 117 $DbResult = $Database->query('SELECT COUNT(*) FROM account WHERE online=1 AND gmlevel > 0'); 118 $Row = $DbResult->fetch_array(); 120 119 $Value = $Row[0]; 121 120 file_get_contents($URL.'?MeasureId=10&Value='.$Value); 122 121 123 122 // Players online 124 DB_Query('SELECT COUNT(*) FROM account WHERE online=1');125 $Row = DB_Row();123 $DbResult = $Database->query('SELECT COUNT(*) FROM account WHERE online=1'); 124 $Row = $DbResult->fetch_array(); 126 125 $Value = $Row[0]; 127 126 file_get_contents($URL.'?MeasureId=5&Value='.$Value); … … 132 131 133 132 // Account count 134 DB_Query('SELECT COUNT(*) FROM account');135 $Row = DB_Row();133 $DbResult = $Database->query('SELECT COUNT(*) FROM account'); 134 $Row = $DbResult->fetch_array(); 136 135 $Value = $Row[0]; 137 136 file_get_contents($URL.'?MeasureId=8&Value='.$Value); 138 137 139 138 // Character count 140 DB_Init('localhost', 'root', '','mangos');141 DB_Query('SELECT COUNT(*) FROM `character`');142 $Row = DB_Row();139 $Database->select_db('mangos'); 140 $DbResult = $Database->query('SELECT COUNT(*) FROM `character`'); 141 $Row = $DbResult->fetch_array(); 143 142 $Value = $Row[0]; 144 143 file_get_contents($URL.'?MeasureId=13&Value='.$Value); 145 144 146 145 // Guild count 147 DB_Query('SELECT COUNT(*) FROM guild');148 $Row = DB_Row();146 $DbResult = $Database->query('SELECT COUNT(*) FROM guild'); 147 $Row = $DbResult->fetch_array(); 149 148 $Value = $Row[0]; 150 149 file_get_contents($URL.'?MeasureId=14&Value='.$Value); 151 150 152 151 // MaNGOS restarts count 153 DB_Init('localhost', 'root', '','wow');154 DB_Query('SELECT COUNT(*) FROM mangos_restart');155 $Row = DB_Row();152 $Database->select_db('wow'); 153 $DbResult = $Database->query('SELECT COUNT(*) FROM mangos_restart'); 154 $Row = $DbResult->fetch_array(); 156 155 $Value = $Row[0]; 157 156 file_get_contents($URL.'?MeasureId=6&Value='.$Value); 158 159 160 157 161 158 sleep(60); 162 159 }
Note:
See TracChangeset
for help on using the changeset viewer.