Commit 48245259 authored by David Morley's avatar David Morley

jsonb and icons

parent 920a7c4e
......@@ -25,35 +25,8 @@
}
.smlogo {
width: 16px;
height: 16px;
background: url('/images/smlogo.png') 0 0;
display: inline-block;
margin: 0;
}
.smlogo-twitter {
background-position: 0 -776px;
}
.smlogo-facebook {
background-position: 0 -824px;
}
.smlogo-tumblr {
background-position: 0 -792px;
}
.smlogo-wordpress {
background-position: 0 -656px;
}
.smlogo-xmpp {
background: none;
}
.smlogo-xmpp img {
vertical-align: unset;
display: inline-block;
}
#map {
......
ALTER TABLE pods ADD services text;
ALTER TABLE pods ADD services jsonb;
ALTER TABLE pods DROP COLUMN service_facebook, DROP COLUMN service_wordpress, DROP COLUMN service_tumblr, DROP COLUMN service_twitter;
ALTER TABLE pods ADD podmin_notify_level int DEFAULT 50;
......@@ -31,7 +31,7 @@ CREATE TABLE pods (
status smallint DEFAULT 1,
latency smallint,
service_xmpp boolean,
services text,
services jsonb,
token text,
publickey text,
tokenexpire timestamp,
......
......@@ -56,7 +56,7 @@ try {
$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/icon-xmpp.png" width="16" height="16" title="XMPP chat server" alt="XMPP chat server"></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>';
$pod_name = htmlentities($pod['name'] ?? '', ENT_QUOTES);
$signup = $pod['signup'] ? 'yes' : 'no';
......
......@@ -85,16 +85,36 @@ foreach ($pods as $pod) {
($pod['services'] ? $services = json_decode($pod['services']) : $services = '');
if (is_array($services)) {
$facebook = array_search('facebook', $services, false);
$twitter = array_search('twitter', $services, false);
$tumblr = array_search('tumblr', $services, false);
$wordpress = array_search('wordpress', $services, false);
$facebook = array_search('facebook', $services);
$twitter = array_search('twitter', $services);
$tumblr = array_search('tumblr', $services);
$wordpress = array_search('wordpress', $services);
$appnet = array_search('appnet', $services);
$atom = array_search('atom1.0', $services);
$blogger = array_search('blogger', $services);
$gnusocial = array_search('gnusocial', $services);
$google = array_search('google', $services);
$libertree = array_search('libertree', $services);
$linkedin = array_search('linkedin', $services);
$livejournal = array_search('livejournal', $services);
$pinterest = array_search('pinterest', $services);
$pumpio = array_search('pumpio', $services);
}
$facebook !== false && print '<div class="smlogo smlogo-facebook" data-toggle="tooltip" title="Publish to Facebook"></div>';
$twitter !== false && print '<div class="smlogo smlogo-twitter" data-toggle="tooltip" title="Publish to Twitter"></div>';
$tumblr !== false && print '<div class="smlogo smlogo-tumblr" data-toggle="tooltip" title="Publish to Tumblr"></div>';
$wordpress !== false && print '<div class="smlogo smlogo-wordpress" data-toggle="tooltip" title="Publish to WordPress"></div>';
$pod['service_xmpp'] && print '<div class="smlogo smlogo-xmpp"><img src="/images/icon-xmpp.png" width="16" height="16" data-toggle="tooltip" title="XMPP chat server" alt="XMPP chat server"></div>';
$facebook !== false && print '<div class="smlogo"><img src="/images/facebook.png" data-toggle="tooltip" title="Publish to Facebook" alt="Publish to Facebook"></div>';
$twitter !== false && print '<div class="smlogo"><img src="/images/twitter.png" data-toggle="tooltip" title="Publish to Twitter" alt="Publish to Twitter"></div>';
$tumblr !== false && print '<div class="smlogo"><img src="/images/tumblr.png" data-toggle="tooltip" title="Publish to Tumblr" alt="Publish to Tumblr"></div>';
$wordpress !== false && print '<div class="smlogo"><img src="/images/wordpress.png" data-toggle="tooltip" title="Publish to WordPress" alt="Publish to WordPress"></div>';
$pod['service_xmpp'] && print '<div class="smlogo"><img src="/images/xmpp.png" data-toggle="tooltip" title="XMPP chat server" alt="XMPP chat server"></div>';
$appnet !== false && print '<div class="smlogo"><img src="/images/appnet.png" data-toggle="tooltip" title="Publish to App.net" alt="Publish to App.net"></div>';
$atom !== false && print '<div class="smlogo"><img src="/images/atom.png" data-toggle="tooltip" title="Publish to Atom" alt="Publish to Atom"></div>';
$blogger !== false && print '<div class="smlogo"><img src="/images/blogger.png" data-toggle="tooltip" title="Publish to Blogger" alt="Publish to Blogger"></div>';
$gnusocial !== false && print '<div class="smlogo"><img src="/images/gnusocial.png" data-toggle="tooltip" title="Publish to GNUSocial" alt="Publish to GNUSocial"></div>';
$google !== false && print '<div class="smlogo"><img src="/images/google.png" data-toggle="tooltip" title="Publish to Google+" alt="Publish to Google+"></div>';
$libertree !== false && print '<div class="smlogo"><img src="/images/libertree.png" data-toggle="tooltip" title="Publish to Libertree" alt="Publish to Libertree"></div>';
$linkedin !== false && print '<div class="smlogo"><img src="/images/linkedin.png" data-toggle="tooltip" title="Publish to LinkedIn" alt="Publish to LinkedIn"></div>';
$livejournal !== false && print '<div class="smlogo"><img src="/images/livejournal.png" data-toggle="tooltip" title="Publish to Live Journal" alt="Publish to Live Journal"></div>';
$pinterest !== false && print '<div class="smlogo"><img src="/images/pinterest.png" data-toggle="tooltip" title="Publish to Pinterest" alt="Publish to Pinterest"></div>';
$pumpio !== false && print '<div class="smlogo"><img src="/images/pumpio.png" data-toggle="tooltip" title="Publish to Pump.io" alt="Publish to Pump.io"></div>';
echo '</td>';
echo '<td>' . ($facebook !== false ? 'Yes' : 'No') . '</td>';
echo '<td>' . ($twitter !== false ? 'Yes' : 'No') . '</td>';
......
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