Esempio n. 1
0
function fullName($user, $length = false)
{
    $ret = "";
    if ($user && $user->getProfile()->getNombre()) {
        $ret .= $user->getProfile()->getNombre();
        if ($user->getProfile()->getApellidos()) {
            $ret .= " " . $user->getProfile()->getApellidos();
        }
        if ($length) {
            $ret = sfVoUtil::cutToLength($ret, $length);
        }
    }
    // else if ($user && $user->getProfile()->getFacebookUid()){
    //  $ret .= jsWrite('fb:name', array('uid' => $user->getProfile()->getFacebookUid(), 'useyou' => 'false', 'linked' => 'false', 'ifcantsee' => "Facebook_".$user->getProfile()->getFacebookUid()));
    // }
    return $ret;
}
Esempio n. 2
0
</a><?php 
    echo $activity->getEntity()->getType() == Politico::NUM_ENTITY && $activity->getEntity()->getPartido() ? " (" . $activity->getEntity()->getPartido() . ")" : '';
    ?>
.
	    <span class="review-date"><?php 
    echo link_to(ago(strtotime($activity->getDate())), 'sfReviewFront/show?id=' . SfVoUtil::reviewPermalink($activity));
    ?>
.</span>
  	<?php 
}
?>
  	<?php 
if ($activity->getMode() == 2) {
    ?>
	  		<?php 
    echo __('A %1% le han puesto la etiqueta "%2%".', array('%1%' => "<a title='" . sfVoUtil::secureString($activity->getEntity(), "&#39;") . "' href= \"" . url_for($activity->getEntity()->getModule() . '/show?id=' . $activity->getEntity()->getVanity()) . "\">" . trim(sfVoUtil::cutToLength(sfVoUtil::secureString($activity->getEntity(), "&#39;"), 32, '...')) . "</a>" . ($activity->getEntity()->getType() == Politico::NUM_ENTITY && $activity->getEntity()->getPartido() ? " (" . $activity->getEntity()->getPartido() . ")" : ''), '%2%' => review_text($activity)));
    ?>
	<?php 
}
?>
  </div>
  
  <?php 
if ($activity->getMode() == 1) {
    ?>
	  <?php 
    if ($activity->getText() && $activity->getCulture() == $sf_user->getCulture()) {
        ?>
	  	<p class="review-body">
	    	<?php 
        echo review_text($activity);
Esempio n. 3
0
    echo __('voota a favor de');
    ?>
  	<?php 
}
?>
    <?php 
echo $aReview ? __('otro comentario sobre ') . " " : '';
?>
<a title='<?php 
echo sfVoUtil::secureString($entity, "&#39;");
?>
' href="<?php 
echo url_for($entity->getModule() . '/show?id=' . $entity->getVanity());
?>
"><?php 
echo sfVoUtil::cutToLength(sfVoUtil::secureString($entity, "&#39;"), 32, '...');
?>
</a>.
    <?php 
echo link_to(ago(strtotime($review->getModifiedAt() ? $review->getModifiedAt() : $review->getCreatedAt())), 'sfReviewFront/show?id=' . SfVoUtil::reviewPermalink($review));
?>
.
  </div>
  <?php 
if ($review->getText() && $review->getCulture() == $sf_user->getCulture()) {
    ?>
  	<p class="review-body">
    	<?php 
    echo review_text($review);
    ?>
  	</p>
Esempio n. 4
0
<li>
	<div class="avatar">
  	<?php 
echo link_to(image_tag(S3Voota::getImagesUrl() . '/propuestas/cc_s_' . ($p->getImagen() != '' ? $p->getImagen() : 'p_unknown.png'), 'width="36" height="36" alt="' . __('Foto de %1%', array('%1%' => $p)) . '"'), 'propuesta/show?id=' . $p->getVanity());
?>
  </div>
	<h4 class="name">
	  <?php 
echo link_to(sfVoUtil::secureString($p->getTitulo(), "&#39;"), 'propuesta/show?id=' . $p->getVanity());
?>
	</h4>
  <div class="votes">
    <?php 
if ($showSparkline) {
    ?>
		  <?php 
    include_partial('general/sparkline_box', array('reviewable' => $p, 'id' => 'sparkline_tpr_' . $p->getId()));
    ?>
		<?php 
}
?>
		<span class="votes-count">
				<?php 
if (sumu($p) > 0 && sumd($p) > 0) {
    ?>
					<?php 
    echo str_replace(" ", "&nbsp;", format_number_choice('[0]0|[1]1 positivo|(1,+Inf]%1% positivos', array('%1%' => sumu($p)), sumu($p)));
    ?>
					<?php 
    // echo str_replace  (" ", "&nbsp;", format_number_choice('[0]0|[1] y 1 negativo|(1,+Inf] y %1% negativos', array('%1%' => sumd($partido)), sumd($partido)))
    ?>
Esempio n. 5
0
function toShownUrl($str)
{
    $aStr = trim($str);
    $ret = $aStr;
    if (strpos($aStr, 'http://') === 0) {
        $ret = substr($aStr, 7);
    }
    if (strlen($ret) > 30) {
        $ret = sfVoUtil::cutToLength($ret, 30);
    }
    return $ret;
}