This plugin provides a shortcode to display the well known freifunk community map: [ffcommunitymap]
It is fully configurable to embed your own sources. These options are available:
Another shortcode is for displaying a community table: [ffcommunitytable]
Available options are:
The shortcode [ffapijs] simply loads ffctable.js and dependencies for use API data in pages and posts.
Example code to embed a selction of email addresses of communities:
<p>Adresse<br />
* [text* your-street placeholder "Straße"]
* [text your-location id:zipinput placeholder "Postleitzahl und Ort"]
</p>
<div class="zipsearch"><button type="button" id="zipsubmit" class="btn waves-effect waves-light">Nächste Communities finden</button></div>
<div id="zipresult"></div>
<p>Communities<br />
* [select your-communities id:mycommunities multiple]
</p>
<p>[submit "Senden"]</p>
<script type="text/javascript">
var cTable;
jQuery(document).ready(function() {
cTable = FFCTABLE.init("dummyid", "//api.freifunk.net/map/ffApiJsonp.php?mode=summary&callback=?", "mail@dingsund.so", "3");
cTable.getData(function(e) {});
jQuery("#zipsubmit").click(function(e) {
cTable.getDistanceByZip(cTable, function(data, type) {
console.log(data);
jQuery("#mycommunities").empty();
_.each(data.communityDataDisplay, function(item, key, list) {
if (item.socialprojects && item.socialprojects.contact) {
email = item.socialprojects.contact;
} else if (item.contact && item.contact.email) {
email = item.contact.email;
}
if (email) {
email = email.replace('mailto:', '');
jQuery("#mycommunities").append(new Option(item.name + " (ca. " + item.distance + " km)", email, true, true));
}
})
});
});
});
</script>