예제 #1
0
            <?php 
    $app = JFactory::getApplication();
    $menu = $app->getMenu();
    $lang = JFactory::getLanguage();
    ?>

            <?php 
    if ($menu->getActive() == $menu->getDefault($lang->getTag()) && !isset($_POST["text-search"])) {
        ?>
                texts.push('<?php 
        echo addslashes(ideary::removeNewLinesFromString(ideary::generateMoreApplaudedTextsBox()));
        ?>
');
				<?php 
        if (JFactory::getUser()->get('id') > 0 && ideary::getUserImpact($user->id) > 10) {
            ?>
				texts.push('<?php 
            echo addslashes(ideary::removeNewLinesFromString(ideary::generateMyStatsBox()));
            ?>
');
				<?php 
        }
        ?>
            <?php 
    }
    ?>

			<?php 
    $followers = ideary::getUsersWhoIAmFollowingId($userId);
    ?>
예제 #2
0
 public function generateMyStatsBox()
 {
     $user = JFactory::getUser();
     $user_picture = ideary::getUserImage($user->id, "200", $user->get('name'));
     $html = '<div id="my-ideary-box">';
     $html .= '<div id="my-ideary-title">' . $user_picture . '<span>' . JText::_('MY_IDEARY') . '</span></div>';
     $html .= '<div id="my-ideary-container">';
     $html .= '<ul>';
     $html .= '<li class="my-ideary-impact" ><span class="key">Impacto</span> <span class="value">' . ideary::getUserImpact($user->id) . '</span></li>';
     $html .= '<li class="my-ideary-applauses" ><span class="key">Aplausos</span> <span class="value">' . ideary::getUserApplausesCount($user->id) . '</span></li>';
     $html .= '<li class="my-ideary-idearis" ><span class="key">Idearis</span> <span class="value">' . ideary::getCountTextsByUserId($user->id) . '</span></li>';
     $html .= '</ul>';
     $html .= '</div>';
     $html .= '</div>';
     return $html;
 }
예제 #3
0
 public function generateMyStatsBox()
 {
     $user = JFactory::getUser();
     $user_picture = ideary::getUserImage($user->id, "200", $user->get('name'));
     $publishedCount = ideary::getCountTextsByUserId($user->id);
     $userImpact = ideary::getUserImpact($user->id);
     $applauses = ideary::getUserApplausesCount($user->id);
     $readWord = $publishedCount > 1 ? 'fueron leídos' : 'fue leído';
     $publishedWord = $publishedCount > 1 ? 'idearis, los cuales' : 'ideari, el cual';
     $html = '<div id="my-ideary-box">';
     $html .= '<div id="my-ideary-title">' . $user_picture . '<span>Impacto</span></div>';
     $html .= '<div id="my-ideary-container">';
     $html .= '<ul>';
     $html .= '<li class="my-ideary-idearis" ><span class="key">Publicaste </span> <span class="value">' . $publishedCount . '</span><span> ' . $publishedWord . ' </span></li>';
     $html .= '<li class="my-ideary-impact" ><span class="key">' . $readWord . '</span> <span class="value">' . $userImpact . '</span> veces </li>';
     if ($applauses > 1) {
         $html .= '<li class="my-ideary-applauses" ><span class="key">y aplaudidos</span> <span class="value">' . $applauses . '</span> veces.</li>';
     }
     $html .= '</ul>';
     $html .= '</div>';
     $html .= '</div>';
     return $html;
 }