Commit e0d96ff7 authored by David Morley's avatar David Morley

map also

parent 1e414875
......@@ -2,6 +2,7 @@
The format is based on [Keep a Changelog] and this project adheres to [Semantic Versioning].
## [Unreleased]
:exclamation: DB migrations required! (see [SQL migration script][2.4.0-sql-migration])
### Added
- Added bootstrapping to simplify initialisation of config and database
- Config syntax has changed to array style (#155)
......@@ -23,6 +24,7 @@ The format is based on [Keep a Changelog] and this project adheres to [Semantic
- Score now goes to -5000 before a pod is removed so dead pods get checked a while then removed for good
- Move functions to dedicated file to allow reuse
- Backup script rewrite
- Store services as json array
### Deprecated
### Removed
### Fixed
......
......@@ -24,7 +24,7 @@ if ($country_code) {
try {
$pods = R::getAll("
SELECT domain, signup, name, lat, long, softwarename, uptime_alltime, active_users_halfyear, service_facebook, service_twitter, service_tumblr, service_wordpress, service_xmpp
SELECT domain, signup, name, lat, long, softwarename, uptime_alltime, active_users_halfyear, services, service_xmpp
FROM pods
WHERE long != ''
AND lat != ''
......@@ -52,11 +52,41 @@ try {
$i++ > 0 && print ',';
$feat = '';
$pod['service_facebook'] && $feat .= '<div class="smlogo smlogo-facebook" title="Publish to Facebook"></div>';
$pod['service_twitter'] && $feat .= '<div class="smlogo smlogo-twitter" title="Publish to Twitter"></div>';
$pod['service_tumblr'] && $feat .= '<div class="smlogo smlogo-tumblr" title="Publish to Tumblr"></div>';
$pod['service_wordpress'] && $feat .= '<div class="smlogo smlogo-wordpress" title="Publish to WordPress"></div>';
$pod['service_xmpp'] && $feat .= '<div class="smlogo smlogo-xmpp"><img src="/images/xmpp.png" width="16" height="16" title="XMPP chat server" alt="XMPP chat server"></div>';
$services = json_decode($pod['services'] ?? '[]') ?: [];
// Special case for XMPP, which is not an official service, but listed in the same cell.
($pod['service_xmpp'] ?? false) && $services[] = 'xmpp';
$services_list = [
'facebook' => ['img' => '/images/facebook.png', 'title' => 'Publish to Facebook'],
'twitter' => ['img' => '/images/twitter.png', 'title' => 'Publish to Twitter'],
'tumblr' => ['img' => '/images/tumblr.png', 'title' => 'Publish to Tumblr'],
'wordpress' => ['img' => '/images/wordpress.png', 'title' => 'Publish to WordPress'],
'xmpp' => ['img' => '/images/xmpp.png', 'title' => 'XMPP chat server'],
'appnet' => ['img' => '/images/appnet.png', 'title' => 'Publish to App.net'],
'atom1.0' => ['img' => '/images/atom.png', 'title' => 'Publish to Atom'],
'blogger' => ['img' => '/images/blogger.png', 'title' => 'Publish to Blogger'],
'gnusocial' => ['img' => '/images/gnusocial.png', 'title' => 'Publish to GNUSocial'],
'google' => ['img' => '/images/google.png', 'title' => 'Publish to Google+'],
'libertree' => ['img' => '/images/libertree.png', 'title' => 'Publish to Libertree'],
'linkedin' => ['img' => '/images/linkedin.png', 'title' => 'Publish to LinkedIn'],
'livejournal' => ['img' => '/images/livejournal.png', 'title' => 'Publish to Live Journal'],
'pinterest' => ['img' => '/images/pinterest.png', 'title' => 'Publish to Pinterest'],
'pumpio' => ['img' => '/images/pumpio.png', 'title' => 'Publish to Pump.io'],
];
foreach ($services as $service) {
// Make sure we have this service in the list.
if (!isset($services_list[$service])) {
continue;
}
$feat .= sprintf(
'<div class="smlogo"><img src="%1$s" data-toggle="tooltip" title="%2$s" alt="%2$s"></div>',
$services_list[$service]['img'],
$services_list[$service]['title']
);
}
$pod_name = htmlentities($pod['name'] ?? '', ENT_QUOTES);
$signup = $pod['signup'] ? 'yes' : 'no';
......
......@@ -93,8 +93,8 @@ foreach ($pods as $pod) {
'tumblr' => ['img' => '/images/tumblr.png', 'title' => 'Publish to Tumblr'],
'wordpress' => ['img' => '/images/wordpress.png', 'title' => 'Publish to WordPress'],
'xmpp' => ['img' => '/images/xmpp.png', 'title' => 'XMPP chat server'],
'appnet' => ['img' => '/images/appnet.png', 'title' => 'Publish to App.'],
'atom' => ['img' => '/images/atom.png', 'title' => 'Publish to Atom'],
'appnet' => ['img' => '/images/appnet.png', 'title' => 'Publish to App.net'],
'atom1.0' => ['img' => '/images/atom.png', 'title' => 'Publish to Atom'],
'blogger' => ['img' => '/images/blogger.png', 'title' => 'Publish to Blogger'],
'gnusocial' => ['img' => '/images/gnusocial.png', 'title' => 'Publish to GNUSocial'],
'google' => ['img' => '/images/google.png', 'title' => 'Publish to Google+'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment