Changeset 186

Show
Ignore:
Timestamp:
01/07/07 21:01:14 (2 years ago)
Author:
syrus
Message:

correction du nbr de nodes sur la homepage, correction des messages

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wifidog/wifidog-auth/wifidog/classes/Network.php

    r183 r186  
    12471247    } 
    12481248 
    1249     /** 
    1250      * Find out how many deployed nodes are online in this networks's database 
    1251      * 
    1252      * @return int Number of deployed nodes which are online 
    1253      * 
    1254      * @access public 
    1255      */ 
    1256     public function getNumOnlineNodes() { 
     1249    public function getNumDeployedNodes2() { 
    12571250        // Define globals 
    12581251        global $db; 
     
    12651258 
    12661259        // Create new cache objects (valid for 5 minutes) 
     1260        $_cache = new Cache('network_'.$this->id.'_num_deployed_nodes', $this->id, 300); 
     1261 
     1262        // Check if caching has been enabled. 
     1263        if ($_cache->isCachingEnabled) { 
     1264            $_cachedData = $_cache->getCachedData(); 
     1265 
     1266            if ($_cachedData) { 
     1267                // Return cached data. 
     1268                $_useCache = true; 
     1269                $_retval = $_cachedData; 
     1270            } 
     1271        } 
     1272 
     1273        if (!$_useCache) { 
     1274            // Get number of deployed nodes 
     1275            $_network_id = $db->escapeString($this->id); 
     1276            if(Network :: isDefaultNetwork()) { 
     1277                $db->execSqlUniqueRes("SELECT COUNT(node_id) FROM nodes WHERE node_deployment_status = 'DEPLOYED' OR node_deployment_status = 'NON_WIFIDOG_NODE'", $_row, false); 
     1278            } 
     1279            else $db->execSqlUniqueRes("SELECT COUNT(node_id) FROM nodes WHERE network_id = '$_network_id' AND (node_deployment_status = 'DEPLOYED' OR node_deployment_status = 'NON_WIFIDOG_NODE')", $_row, false);     
     1280 
     1281            // String has been found 
     1282            $_retval = $_row['count']; 
     1283 
     1284            // Check if caching has been enabled. 
     1285            if ($_cache->isCachingEnabled) { 
     1286                // Save data into cache, because it wasn't saved into cache before. 
     1287                $_cache->saveCachedData($_retval); 
     1288            } 
     1289        } 
     1290 
     1291        return $_retval; 
     1292    } 
     1293 
     1294    /** 
     1295     * Find out how many deployed nodes are online in this networks's database 
     1296     * 
     1297     * @return int Number of deployed nodes which are online 
     1298     * 
     1299     * @access public 
     1300     */ 
     1301    public function getNumOnlineNodes() { 
     1302        // Define globals 
     1303        global $db; 
     1304 
     1305        // Init values 
     1306        $_retval = 0; 
     1307        $_row = null; 
     1308        $_useCache = false; 
     1309        $_cachedData = null; 
     1310 
     1311        // Create new cache objects (valid for 5 minutes) 
    12671312        $_cache = new Cache('network_'.$this->id.'_num_online_nodes', $this->id, 300); 
    12681313 
     
    12831328                        // Passage à 30 minutes 
    12841329            $db->execSqlUniqueRes("SELECT COUNT(node_id) FROM nodes WHERE network_id = '$_network_id' AND (node_deployment_status = 'DEPLOYED' OR node_deployment_status = 'NON_WIFIDOG_NODE') AND ((NOW()-last_heartbeat_timestamp) < interval '30 minutes')", $_row, false); 
     1330 
     1331            // String has been found 
     1332            $_retval = $_row['count']; 
     1333 
     1334            // Check if caching has been enabled. 
     1335            if ($_cache->isCachingEnabled) { 
     1336                // Save data into cache, because it wasn't saved into cache before. 
     1337                $_cache->saveCachedData($_retval); 
     1338            } 
     1339        } 
     1340 
     1341        return $_retval; 
     1342    } 
     1343 
     1344    public function getNumOnlineNodes2() { 
     1345        // Define globals 
     1346        global $db; 
     1347 
     1348        // Init values 
     1349        $_retval = 0; 
     1350        $_row = null; 
     1351        $_useCache = false; 
     1352        $_cachedData = null; 
     1353 
     1354        // Create new cache objects (valid for 5 minutes) 
     1355        $_cache = new Cache('network_'.$this->id.'_num_online_nodes', $this->id, 300); 
     1356 
     1357        // Check if caching has been enabled. 
     1358        if ($_cache->isCachingEnabled) { 
     1359            $_cachedData = $_cache->getCachedData(); 
     1360 
     1361            if ($_cachedData) { 
     1362                // Return cached data. 
     1363                $_useCache = true; 
     1364                $_retval = $_cachedData; 
     1365            } 
     1366        } 
     1367 
     1368        if (!$_useCache) { 
     1369            // Get number of online nodes 
     1370            $_network_id = $db->escapeString($this->id); 
     1371            if (Network :: isDefaultNetwork()) 
     1372            { 
     1373                        // Passage à 30 minutes 
     1374            $db->execSqlUniqueRes("SELECT COUNT(node_id) FROM nodes WHERE (node_deployment_status = 'DEPLOYED' OR node_deployment_status = 'NON_WIFIDOG_NODE') AND ((NOW()-last_heartbeat_timestamp) < interval '30 minutes')", $_row, false); 
     1375            } else $db->execSqlUniqueRes("SELECT COUNT(node_id) FROM nodes WHERE network_id = '$_network_id' AND (node_deployment_status = 'DEPLOYED' OR node_deployment_status = 'NON_WIFIDOG_NODE') AND ((NOW()-last_heartbeat_timestamp) < interval '30 minutes')", $_row, false); 
    12851376 
    12861377            // String has been found 
     
    17561847 
    17571848        // Set networks node information 
    1758         $smarty->assign('networkNumDeployedNodes', $net ? $net->getNumDeployedNodes() : 0); 
    1759         $smarty->assign('networkNumOnlineNodes', $net ? $net->getNumOnlineNodes() : 0); 
     1849        $smarty->assign('networkNumDeployedNodes', $net ? $net->getNumDeployedNodes2() : 0); 
     1850        $smarty->assign('networkNumOnlineNodes', $net ? $net->getNumOnlineNodes2() : 0); 
    17601851    } 
    17611852} 
  • wifidog/wifidog-auth/wifidog/locale/fr/LC_MESSAGES/messages.po

    r144 r186  
    13701370#: ../classes/StatisticReport/UserReport.php:137 smarty.txt:216 smarty.txt:238 
    13711371#: smarty.txt:241 smarty.txt:224 smarty.txt:222 smarty.txt:188 
     1372msgid "network" 
     1373msgstr "réseau" 
     1374 
     1375#: 
    13721376msgid "Network" 
    13731377msgstr "Réseau" 
     
    28552859#: smarty.txt:181 smarty.txt:215 smarty.txt:29 smarty.txt:179 smarty.txt:213 
    28562860#: smarty.txt:12 smarty.txt:192 
    2857 msgid "network" 
    2858 msgstr "réseau" 
    28592861 
    28602862msgid "new users" 
     
    53245326msgstr "réseau possÚde" 
    53255327 
     5328#: 
     5329msgid "currently has" 
     5330msgstr "possÚde actuellement" 
     5331 
    53265332#: smarty.txt:95 smarty.txt:117 smarty.txt:120 smarty.txt:94 smarty.txt:97 
    53275333#: smarty.txt:128 
     
    53365342#: smarty.txt:97 smarty.txt:119 smarty.txt:122 smarty.txt:96 smarty.txt:99 
    53375343#: smarty.txt:130 
    5338 msgid "users," 
    5339 msgstr "usagers," 
     5344msgid "valid users," 
     5345msgstr "usagers valides," 
     5346 
     5347msgid "valid user," 
     5348msgstr "usager valide," 
     5349 
    53405350 
    53415351#: smarty.txt:98 smarty.txt:120 smarty.txt:123 smarty.txt:97 smarty.txt:100 
     
    53575367#: smarty.txt:134 
    53585368msgid "It currently has" 
    5359 msgstr "Il a en ce moment" 
     5369msgstr "Il y a en ce moment" 
    53605370 
    53615371#: smarty.txt:102 smarty.txt:124 smarty.txt:127 smarty.txt:101 smarty.txt:104 
     
    53735383msgid "hotspots," 
    53745384msgstr "points d'accÚs," 
     5385 
     5386msgid "deployed hotspot," 
     5387msgstr "point d'accÚs déployé," 
     5388 
     5389msgid "deployed hotspots," 
     5390msgstr "points d'accÚs déployés," 
    53755391 
    53765392#: smarty.txt:105 smarty.txt:127 smarty.txt:130 smarty.txt:104 smarty.txt:107 
  • wifidog/wifidog-auth/wifidog/templates/sites/index.tpl

    r185 r186  
    7070*} 
    7171    <p> 
    72         {"The"|_} {$networkName} 
    73         {"network currently has"|_} {$networkNumValidUsers} {"valid"|_} 
     72        {"The"|_} {"network"|_} {$networkName} 
     73        {"currently has"|_} {$networkNumValidUsers}  
    7474        {if $networkNumValidUsers == 1} 
    75             {"user,"|_} 
     75            {"valid user,"|_} 
    7676        {else} 
    77             {"users,"|_} 
     77            {"valid users,"|_} 
    7878        {/if} 
    7979        {$networkNumOnlineUsers} 
     
    8585        {"currently online"|_}. 
    8686        <br> 
    87         {"It currently has"|_} {$networkNumDeployedNodes} {"deployed"|_
     87        {"The network currently has"|_} {$networkNumDeployedNodes
    8888        {if $networkNumDeployedNodes == 1} 
    89             {"hotspot,"|_} 
     89            {"deployed hotspot,"|_} 
    9090        {else} 
    91             {"hotspots,"|_} 
     91            {"deployed hotspots,"|_} 
    9292        {/if} 
    9393        {$networkNumOnlineNodes}