Skip to content

Instantly share code, notes, and snippets.

View joanhey's full-sized avatar

Joan Miquel joanhey

View GitHub Profile
@joanhey
joanhey / gitcontributors.phtml
Last active January 22, 2016 21:25
Kumbia Partial: show git contributors to KumbiaPHP
<h2>Gracias a todos los colaboradores</h2>
<?php
ini_set("user_agent", 'KumbiaPHP bot');
$url = 'https://api.github.com/repos/KumbiaPHP/KumbiaPHP/contributors';
$team = json_decode(file_get_contents($url));
foreach($team as $user) :?>
<a href="https://github.com/<?= $user->login?>" title="@<?= $user->login?>">
<img src="<?= $user->avatar_url ?>&s=60" width=60 height=60 alt="<?= $user->contributions?> contribuciones"></a>
<?php endforeach ?>
@joanhey
joanhey / feed.phtml
Last active January 28, 2016 16:03
Kumbia Partial: show feed
<?php
/**
* Visualizar feed RSS por Joanhey
*
* @param string $name Nombre
* @param string $url URL completa del feed
* @return html
*/
if ($feed = simplexml_load_file($url)): ?>
@joanhey
joanhey / sociable.phtml
Last active May 29, 2019 01:44
Kumbia Partial: enlaces para compartir en redes sociales
<div id="social">
<p>¡Compártelo!</p>
<?php $url = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"];
$titulo = View::getVar('page_title'); //Necesita el título de página ?>
<a class="social facebook" rel="nofollow noopener noreferrer" href="https://www.facebook.com/share.php?u=<?=$url?>&amp;t=<?= urlencode($titulo)?>" title="Facebook" target="_blank"></a>
<a class="social twitter" rel="nofollow noopener noreferrer" href="https://twitter.com/intent/tweet?text=<?= urlencode($titulo)?>&amp;url=<?=$url?>&amp;via=KumbiaPHP" title="Twitter" target="_blank"></a>
</div>