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

simpler social networks

parent 4718b9dd
No related branches found
No related tags found
No related merge requests found
......@@ -6,23 +6,7 @@
<?php echo html_meta('legal_informations'); ?>
</div>
<div class="half-right">
<ul class="navigation">
<?php if(site_meta('mail', '')): ?>
<li><a href="<?php echo social_url('mail'); ?>"><?php echo social_logo('mail').' '.site_meta('mail', ''); ?></a></li>
<?php endif; ?>
<?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('framasphere', '')): ?>
<li><a href="<?php echo social_url('framasphere'); ?>"><?php echo social_logo('framasphere').' '.site_meta('framasphere', ''); ?></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>
<?php social_list("class=navigation")?>
</div>
<div class="half-right">
<ul class="navigation">
......
......@@ -64,25 +64,35 @@ function html_meta($key) {
echo $output;
}
function social_url($network) {
function social_logo($network) {
$img=theme_url("img/$network.png");
return "<img height=\"20\" width=\"20\" src=\"$img\" alt=\"$network/\"/>";
}
function social_account($network) {
if ($network == "framasphere"){
return site_meta($network.'_id', '');
}
return site_meta($network, '');
}
function social_list($properties) {
$NETWORKS_URLS = array (
'mail' => 'mailto:',
'github' => 'https://github.com/',
'framasphere' => 'https://framasphere.org/people/',
'mastodon' => 'https://framapiaf.org/',
'facebook' => 'https://facebook.com/',
'twitter' => 'https://twitter.com/',
'mail' => 'mailto:',
);
if ($network == "framasphere"){
$account = site_meta($network.'_id', '');
}else{
$account = site_meta($network, '');
echo "<ul ".$properties.">";
foreach ($NETWORKS_URLS as $network => $network_url){
if(site_meta($network, '')){
echo '<li><a href="'.$network_url.social_account($network).'">'.
social_logo($network).' '.site_meta($network, '').'</a></li>';
}
return $NETWORKS_URLS[$network].$account;
}
function social_logo($network) {
$img=theme_url("img/$network.png");
return "<img height=\"20\" width=\"20\" src=\"$img\" alt=\"$network/\"/>";
echo "</ul>";
}
function total_articles() {
......
img/mastodon.png

20.2 KiB

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