Created
February 24, 2013 00:03
-
-
Save miguelpeixe/5021933 to your computer and use it in GitHub Desktop.
BAIXOCENTRO - Frontend para exibir lista de demandas, seus respectivos voluntários ou link para cadastro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if(current_user_can('edit_posts')) : // bloqueado para usuário comum, temporariamente ?> | |
<h2>Este projeto precisa da sua ajuda!</h2> | |
<?php | |
global $cfs; | |
$demandas_producao = $cfs->get('demandas_producao'); | |
if($demandas_producao) { | |
echo '<h3>Demandas de produção</h3>'; | |
foreach($demandas_producao as $demanda) { | |
$url = 'http://festival.baixocentro.org/rede/?'; | |
$url .= 'project_id=' . $post->ID; | |
$url .= '&demanda=' . $demanda['demanda']; | |
$url .= '&project_name=' . get_the_title(); | |
$url .= '&tipo_demanda=producao'; | |
if(!$demanda['voluntario']) | |
echo '<p><strong>' . $demanda['demanda'] . '</strong> (<a href="'. $url . '" target="_blank">quero me voluntariar</a>)</p>'; | |
else | |
echo '<p><strong>' . $demanda['demanda'] . '</strong> - <span style="color:green;">Preenchida por ' . $demanda['voluntario'] . '</p>'; | |
} | |
} | |
$demandas_equipamento = $cfs->get('demandas_equipamento'); | |
if($demandas_equipamento) { | |
echo '<h3>Demandas de equipamento</h3>'; | |
foreach($demandas_equipamento as $demanda) { | |
$url = 'http://festival.baixocentro.org/rede/?'; | |
$url .= 'project_id=' . $post->ID; | |
$url .= '&demanda=' . $demanda['demanda']; | |
$url .= '&project_name=' . get_the_title(); | |
$url .= '&tipo_demanda=equipamento'; | |
if(!$demanda['voluntario']) | |
echo '<p><strong>' . $demanda['demanda'] . '</strong> (<a href="'. $url . '" target="_blank">quero me voluntariar</a>)</p>'; | |
else | |
echo '<p><strong>' . $demanda['demanda'] . '</strong> - <span style="color:green;">Preenchida por ' . $demanda['voluntario'] . '</p>'; | |
} | |
} | |
?> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment