">RSS</a></li> <li><a href="<?php echo base_url('admin'); ?> ">Admin</a></li> </ul> </div> <!-- Social network accounts --> <div class="anchor-footer__right-section mdl-mini-footer--right-section"> <ul class="mdl-mini-footer--link-list"> <?php foreach (array('facebook', 'twitter', 'github') as $network) { ?> <?php if (social_account($network)) { ?> <li class="mdl-mini-footer--social-btn anchor-social"> <a class="anchor-social__link anchor-social__link--<?php echo $network; ?> " href="<?php echo social_url($network); ?> "> </a> </li> <?php } ?> <?php }
echo relative_time(article_time()); ?> </time> </h2> </header> <!-- Post content --> <section class="anchor-article__content mdl-card__supporting-text mdl-typography--text-justify"> <?php echo article_markdown(); ?> <div id="share" class="mdl-typography--text-right"> <div class="anchor-article__share"> <a href="https://twitter.com/share" class="twitter-share-button" data-via="<?php echo social_account('twitter'); ?> "> Tweet </a> </div> <div class="anchor-article__share"> <div class="fb-share-button" data-href="<?php echo article_url(); ?> " data-layout="button_count"></div> </div> <div class="anchor-article__share"> <div class="g-plus" data-action="share" data-annotation="bubble"></div> </div> </div>
function social_url($network) { // Construct base url switch ($network) { case 'twitter': $url = 'https://twitter.com/'; break; case 'facebook': $url = 'https://www.facebook.com/'; break; case 'github': $url = 'https://github.com/'; break; } // Add social network handle return $url . social_account($network); }