Changeset 7858
- Timestamp:
- Apr 22, 2010, 11:06:55 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/INSTALL
r7755 r7858 1 1 Installing Nodemap 2.0 2 2 3 =Introduction= 3 4 Nodemap2.0 is a PHP based script and will work on a webserver with PHP version 5. 4 5 5 6 All the configuration of the application is done in the "config.php" file. 7 8 =How to= 9 $svn checkout http://svn.wirelessleiden.nl/svn/projects/NodeMap2.0/trunk NodeMap2.0 10 $cd NodeMap2.0 11 12 Alter the following config variables: 13 - $config['node_status_file'] = 'http://watch.wirelessleiden.nl/nagios/export/node-status.csv'; 14 - $config['node_location_file'] = 'http://watch.wirelessleiden.nl/nagios/export/genesis-nodes.conf'; 15 - $config['mail'] = 'receipient@example.org'; 16 - $config['googlekey']['example.org'] = 'YOUR_GOOGLE_MAPS_API_KEY'; 17 $nano config.php -
trunk/README
r7790 r7858 31 31 /src/logfile.txt -> Main logging file with errors, warnings, etc. 32 32 33 = Hacking = 34 In src/inc/LogHandler.class.php you can edit the logging values: 35 define('LOG_LEVEL_ECHO', SYSLOG_DEBUG); 36 define('LOG_LEVEL_WRITE', SYSLOG_DEBUG); 37 define('LOG_LEVEL_MAIL', SYSLOG_EMERG); 38 39 Use USB Webserver (www.usbwebserver.com) for testing under Windows systems 40 41 Use Eclipse (www.eclipse.org) for editing the code for easy auto completion 42 33 43 = Credits = 34 44 Application created as a project of Hogeschool Leiden by the students: -
trunk/src/config.php
r7847 r7858 10 10 $config['node_status_file'] = 'http://watch.wirelessleiden.nl/nagios/export/node-status.csv'; 11 11 $config['node_location_file'] = 'http://watch.wirelessleiden.nl/nagios/export/genesis-nodes.conf'; 12 13 // Overall values are using for centering the KML file on a initial location 12 14 $config['overall_longitude'] = 4.490153; 13 15 $config['overall_latitude'] = 52.161087; -
trunk/src/inc/KMLFile.class.php
r7788 r7858 197 197 // Looking for "location" of the node 198 198 if (!$location = $this->findInLocationFile($file, 'location = ', $nodes[0][$i][1])) { 199 trigger_log(SYSLOG_ WARNING, 'Could not find the "location" of node "' . $i . '", skipping to next', __FILE__, __LINE__);199 trigger_log(SYSLOG_ERROR, 'Could not find the "location" of node "' . $i . '", skipping to next', __FILE__, __LINE__); 200 200 continue; 201 201 } 202 202 // Looking for "status" of the node 203 203 if (!$status = $this->findInLocationFile($file, 'status = ', $nodes[0][$i][1])) { 204 trigger_log(SYSLOG_ WARNING, 'Could not find the "status" of node "' . $i . '", skipping to next', __FILE__, __LINE__);204 trigger_log(SYSLOG_ERROR, 'Could not find the "status" of node "' . $i . '", skipping to next', __FILE__, __LINE__); 205 205 continue; 206 206 } 207 207 // Looking for "latitude" of the node 208 208 if (!$latitude = $this->findInLocationFile($file, 'latitude = ', $nodes[0][$i][1])) { 209 trigger_log(SYSLOG_ WARNING, 'Could not find the "latitude" of node "' . $i . '", skipping to next', __FILE__, __LINE__);209 trigger_log(SYSLOG_ERROR, 'Could not find the "latitude" of node "' . $i . '", skipping to next', __FILE__, __LINE__); 210 210 continue; 211 211 } 212 212 // Looking for "longitude" of the node 213 213 if (!$longitude = $this->findInLocationFile($file, 'longitude = ', $nodes[0][$i][1])) { 214 trigger_log(SYSLOG_ WARNING, 'Could not find the "longitude" of node "' . $i . '", skipping to next', __FILE__, __LINE__);214 trigger_log(SYSLOG_ERROR, 'Could not find the "longitude" of node "' . $i . '", skipping to next', __FILE__, __LINE__); 215 215 continue; 216 216 } 217 217 // Looking for "interfaces" of the node 218 218 if (!$interfaces = $this->findInLocationFile($file, 'interfaces = ', $nodes[0][$i][1])) { 219 trigger_log(SYSLOG_ WARNING, 'Could not find the "interfaces" of node "' . $i . '", skipping to next', __FILE__, __LINE__);219 trigger_log(SYSLOG_ERROR, 'Could not find the "interfaces" of node "' . $i . '", skipping to next', __FILE__, __LINE__); 220 220 continue; 221 221 } 222 222 // Looking for "masterip" of the node 223 223 if (!$masterip = $this->findInLocationFile($file, 'masterip = ', $nodes[0][$i][1])) { 224 trigger_log(SYSLOG_ WARNING, 'Could not find the "masterip" of node "' . $i . '", skipping to next', __FILE__, __LINE__);224 trigger_log(SYSLOG_ERROR, 'Could not find the "masterip" of node "' . $i . '", skipping to next', __FILE__, __LINE__); 225 225 continue; 226 226 } 227 227 // Looking for "nodetype" of the node 228 228 if (!$nodetype = $this->findInLocationFile($file, 'nodetype = ', $nodes[0][$i][1])) { 229 trigger_log(SYSLOG_ WARNING, 'Could not find the "nodetype" of node "' . $i . '", skipping to next', __FILE__, __LINE__);229 trigger_log(SYSLOG_ERROR, 'Could not find the "nodetype" of node "' . $i . '", skipping to next', __FILE__, __LINE__); 230 230 continue; 231 231 } 232 232 // Looking for "name" of the node 233 233 if (!$name = $this->findInLocationFile($file, 'name = ', $nodes[0][$i][1])) { 234 trigger_log(SYSLOG_ WARNING, 'Could not find the "name" of node "' . $i . '", skipping to next', __FILE__, __LINE__);234 trigger_log(SYSLOG_ERROR, 'Could not find the "name" of node "' . $i . '", skipping to next', __FILE__, __LINE__); 235 235 continue; 236 236 } -
trunk/src/index.php
r7839 r7858 1 1 <?php 2 require_once('config.php'); 3 require_once($config['root'] . '/map/inc/kmlHandler.php'); 4 require_once($config['root'] . '/map/inc/node_info_start.php'); 5 require_once($config['root'] . '/map/inc/search_node.php'); 6 7 // Getting array from kmlHandler 8 $markers = get_node_array($config['kml_file']); 9 10 // Key is defined to be the domain name if exists 11 $apikey = $config['googlekey']['default']; 12 $servername = $_SERVER['SERVER_NAME']; 13 14 # Little hack, does not work with foo.co.uk domains 15 $servername = implode('.',array_slice(explode('.',$servername),-2)); 16 if (array_key_exists($servername,$config['googlekey'])) { 17 $apikey = $config['googlekey'][$servername]; 18 } 2 // Redirect to map 3 header('Location: map/'); 19 4 ?> 20 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">21 <html lang="dutch">22 <head>23 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">24 <title>Nodemap Wireless Leiden</title>25 <!-- External stylesheet for all browsers -->26 <link href="style/stylesheet.css" rel="stylesheet" type="text/css">27 <!-- Using stylesheet2.css when browser is any version of Microsoft Internet Explorer -->28 <!--[if IE]>29 <link href="style/stylesheet2.css" rel="stylesheet" type="text/css">30 <![endif]-->31 32 <!-- Make our $marker[] array from kmlHandler available to javascript in JSON (No idea on how to this another less ugle way)-->33 <script type="text/javascript">34 var markers = <?php echo json_encode($markers); ?>;35 </script>36 37 <!-- Loading in the google-api -->38 <script39 src="http://maps.google.com/maps?file=api&v=2&key=<?php print $apikey;?>"40 type="text/javascript"></script>41 <!-- Loading in the markerClusterer that will handle the clustering of markers. -->42 <script type="text/javascript" src="inc/markerClusterer.js"></script>43 <!-- Loading in the javascript that will add the map into #mapcanvas -->44 <script type="text/javascript" src="inc/nodemapWL.js"></script>45 <script type="text/javascript" src="inc/overlay.js"></script>46 <script type="text/javascript" src="inc/iconStyles.js"></script>47 48 <!-- Loading in the javascript that handles the switching between gebruiker and beheerder -->49 <script type="text/javascript" src="inc/gebruiker_beheerder_switch.js"></script>50 51 </head>52 <body onload="suggestMarkers('')">53 <!-- Mainwrapper contains all content on the page -->54 <div id="mainwrapper"><!-- Mapcanvas is the container where the map will be put in. Height and width of map is specified by size of the div -->55 <div id="mapcanvas"><!-- Create the map using the intitialize_map() function from nodemapWL.js -->56 <script type="text/javascript">initialize_map();</script> <!--<script type="text/javascript">nodeAdd();</script>-->57 </div>58 <div id="infowrapper"><!-- Top information space -->59 <div id="infotop"><!-- Calling on the node information from an external php file. inc/node_info.php -->60 <?php node_info_start(); ?></div>61 62 <!-- Bottom information space -->63 <div id="infobottom"><?php searchNodes(); ?>64 <div id="searchlist"></div>65 </div>66 <!-- The buttons under the searchframe. In a table for positioning. -->67 <div id="userpick">68 <table>69 <tr>70 <!-- onclick events activate functions from within inc/gebruiker_beheerder_switch.js which load in the selected view with node_info.php -->71 <td><input type="button" value="Gebruiker"72 onclick="switchGebruiker();"></td>73 <td><input type="button" value="Beheerder"74 onclick="switchBeheerder();"></td>75 </tr>76 </table>77 </div>78 </div>79 80 <!-- General functions under the map -->81 <div id="navigation">82 <form action="">83 <table>84 <tr>85 <!-- First colum -->86 <td><input type="checkbox" value="shownodes"87 onclick="toggleAllNodes();" checked="checked">Toon nodes</td>88 <!-- Second colum -->89 <td><input type="checkbox" value="showrange">Toon dekking <br>90 <input type="checkbox" value="showtraffic">Toon dataverkeer</td>91 <td><input type="checkbox" value="gsearchbar"92 onclick="toggleGoogleSearchMap();">Toon locatie zoeken</td>93 </tr>94 </table>95 </form>96 </div>97 </div>98 </body>99 </html> -
trunk/src/kml-echo.php
r7799 r7858 12 12 header('Content-Type: text/xml'); 13 13 echo '<?xml version="1.0" encoding="UTF-8"?>'; 14 // XXX: Doesn't show in Google Chrome 14 15 15 16 // Let's try reading from files and parsing the data in the files. -
trunk/src/map/inc/node_info.php
r7847 r7858 6 6 { 7 7 setcookie("view", $_GET['view']); 8 // Hack to make cookies work under Internet Explorer 7: 8 9 header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"'); 9 10 $view = $_GET['view']; … … 111 112 </div> 112 113 <div id="timestamp"> 113 Laatste update: 15:42<br>114 Do 25 maart114 Laatste update: TO:DO <br> 115 Last update TODO 115 116 </div> 116 117 EOF; 118 // TODO: Last update 117 119 } 118 120 } -
trunk/src/map/inc/node_info_start.php
r7828 r7858 9 9 </div> 10 10 <div id="timestamp"> 11 Laatste update: 15:42<br>12 Do 25 maart11 Laatste update: TO:DO <br> 12 Last update TODO 13 13 </div> 14 14 EOF; 15 // TODO: Last update 15 16 } 16 17 ?>
Note:
See TracChangeset
for help on using the changeset viewer.