Skip to content
Snippets Groups Projects
Unverified Commit 9abd1d6d authored by David Beniamine's avatar David Beniamine
Browse files

cleaner social links

parent db781d21
No related branches found
No related tags found
No related merge requests found
......@@ -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 &agrave; l'accueil.">Accueil</a></li>
......
......@@ -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() {
......
img/facebook.png

756 B

img/framasphere.png

30.8 KiB

img/github.png

1.67 KiB

img/rss.png

7.34 KiB

img/twitter.png

9.12 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment