diff --git a/footer.php b/footer.php index e801c4499540e69663797a97edeae96f870a15c4..8004d8bbc4f5ab951f3ceb5bf4979b0d66c1f103 100644 --- a/footer.php +++ b/footer.php @@ -7,11 +7,22 @@ </div> <div class="even"> <ul class="navigation"> - <li><a href="<?php echo rss_url(); ?>">RSS</a></li> - <?php if(twitter_account()): ?> - <li><a href="<?php echo twitter_url(); ?>">@<?php echo twitter_account(); ?></a></li> + <li><a href="<?php echo rss_url(); ?>"><?php echo social_logo('rss'); ?>RSS</a></li> + <?php if(site_meta('github', '')): ?> + <li><a href="<?php echo social_url('github'); ?>"><?php echo social_logo('github').site_meta('github', ''); ?></a></li> <?php endif; ?> - + <?php if(site_meta('diaspora', '')): ?> + <li><a href="<?php echo social_url('framaphere'); ?>"><?php echo social_logo('diaspora').site_meta('diaspora', ''); ?></a></li> + <?php endif; ?> + <?php if(site_meta('facebook', '')): ?> + <li><a href="<?php echo social_url('facebook'); ?>"><?php echo social_logo('facebook').site_meta('facebook', ''); ?></a></li> + <?php endif; ?> + <?php if(site_meta('twitter', '')): ?> + <li><a href="<?php echo social_url('twitter'); ?>"><?php echo social_logo('twitter').'@'.site_meta('twitter', ''); ?></a></li> + <?php endif; ?> + </ul> + <br /> + <ul> <li><a href="<?php echo base_url('admin'); ?>" title="Administration">Administration</a></li> <li><a href="<?php echo base_url(); ?>" title="Retour à l'accueil.">Accueil</a></li> diff --git a/functions.php b/functions.php index a8f21abdd8c0a73a1f3e810d6724d44e0a3da50b..3e100c89c2590275ab909190b11be0b9819071f6 100644 --- a/functions.php +++ b/functions.php @@ -64,12 +64,19 @@ function html_meta($key) { echo $output; } -function twitter_account() { - return site_meta('twitter', 'tetras_libre'); +function social_url($network) { + $NETWORKS_URLS = array ( + 'github' => 'https://github.com/', + 'framasphere' => 'https://framasphere.org/', + 'facebook' => 'https://facebook.com/', + 'twitter' => 'https://twitter.com/', + ); + return $NETWORKS_URLS[$network].site_meta($network, ''); } -function twitter_url() { - return 'https://twitter.com/' . twitter_account(); +function social_logo($network) { + $img=theme_url("img/$network.png"); + return "<img height=\"20\" width=\"20\" src=\"$img\" alt=\"$network/\"/>"; } function total_articles() { diff --git a/img/facebook.png b/img/facebook.png new file mode 100644 index 0000000000000000000000000000000000000000..9f63d73ecaa41f4b73bd163da59d2bc19a6562f7 Binary files /dev/null and b/img/facebook.png differ diff --git a/img/framasphere.png b/img/framasphere.png new file mode 100644 index 0000000000000000000000000000000000000000..81493149f01a746050bcb82f92c5e819c0847a8f Binary files /dev/null and b/img/framasphere.png differ diff --git a/img/github.png b/img/github.png new file mode 100644 index 0000000000000000000000000000000000000000..8b25551a97921681334176ee143b41510a117d86 Binary files /dev/null and b/img/github.png differ diff --git a/img/rss.png b/img/rss.png new file mode 100644 index 0000000000000000000000000000000000000000..2eeaf239aca9a597499032db9759e114fb3e5de6 Binary files /dev/null and b/img/rss.png differ diff --git a/img/twitter.png b/img/twitter.png new file mode 100644 index 0000000000000000000000000000000000000000..7923f1dcf060431724ac3484f5cd8ac340e15609 Binary files /dev/null and b/img/twitter.png differ