diddipoeler
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Forum: Plugins
In reply to: [WassUp Real Time Analytics] geoipuse this:
https://www.geoplugin.net/php.gp?ip=$ipadresse
the code:$new_arr = array(); $new_arr[]= unserialize(file_get_contents('https://www.geoplugin.net/php.gp?ip='.$ipadresse); $latitude = $new_arr[0]['geoplugin_latitude']; $longitude = $new_arr[0]['geoplugin_longitude'];
- This reply was modified 5 years, 5 months ago by diddipoeler.
hallo,
ich habe die datei: wassupadmin.php ab zeile 1349 ge?ndert.
<!-- diddipoeler anfang --> <!-- <div id="spia_map" style="width:90%;height:370px;"></div> --> <div id="spia_leaflet" style="width:100%;height:500px;"></div> <link href="https://unpkg.com/[email protected]/dist/leaflet.css" rel="stylesheet" type="text/css" /> <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/L.Control.Locate.min.css" rel="stylesheet" type="text/css" /> <link href="https://cdnjs.cloudflare.com/ajax/libs/leaflet-routing-machine/3.2.12/leaflet-routing-machine.css" rel="stylesheet" type="text/css" /> <script src="https://unpkg.com/[email protected]/dist/leaflet.js" type="text/javascript"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/L.Control.Locate.min.js" type="text/javascript"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-routing-machine/3.2.12/leaflet-routing-machine.js" type="text/javascript"></script> <script> var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', osmAttrib = '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}); var map = L.map('spia_leaflet').setView([<?php echo $pos;?>], 10).addLayer(osm); </script> <?php $meta_table=$wassup_options->wassup_table.'_meta'; $sql = "SELECT <code>wassup_key</code>, <code>meta_value</code> FROM <code>$meta_table</code> WHERE <code>meta_key</code>= 'hostname' ORDER BY <code>meta_id</code> DESC LIMIT 10"; $result = $wpdb->get_results($sql); $map_bounds = array(); foreach($result as $key) { $new_arr = array(); $new_arr[]= unserialize(file_get_contents('https://www.geoplugin.net/php.gp?ip='.$key->wassup_key)); ?> <script> marker = new L.marker([<?php echo $new_arr[0]['geoplugin_latitude'];?>,<?php echo $new_arr[0]['geoplugin_longitude'];?>] ) .addTo(map) .bindPopup('<?php echo $key->meta_value;?>'); </script> <?php $map_bounds[] = "[".$new_arr[0]['geoplugin_latitude'].",".$new_arr[0]['geoplugin_longitude']."]"; } $comma_bounds = implode(",", $map_bounds); ?> <script> map.fitBounds([<?php echo $comma_bounds; ?>]); </script> <!-- diddipoeler ende -->
jetzt werden die letzten 10 eintr?ge gelesen und auf einer karte angezeigt ??
Viewing 2 replies - 1 through 2 (of 2 total)