Phpost
COMPLEMENTOS Top posts más recomendado (Act 1.3) - Versión para impresión

+- Phpost (https://phpost.es)
+-- Foro: Risus 1.3 (https://phpost.es/forum-6.html)
+--- Foro: Complementos (https://phpost.es/forum-7.html)
+---- Foro: Complementos Terminados (https://phpost.es/forum-8.html)
+---- Tema: COMPLEMENTOS Top posts más recomendado (Act 1.3) (/thread-85.html)



Top posts más recomendado (Act 1.3) - Chctrpgo - 02-01-2021

En inc --> class --> c.tops.php

Buscar:
Código:
// FAVORITOS
        $data['favoritos'] = $this->getTopPostsVars($fecha, $cat, 'favoritos');


Debajo agregar:
Código:
// RECOMENDADO
        $data['shared'] = $this->getTopPostsVars($fecha, $cat, 'shared');


Buscar:
Código:
/*
        getTopPostsQuery($data)
    */
    function getTopPostsQuery($data){
        
        //
        $query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT p.post_id, p.post_category, '.$data['type'].', p.post_puntos, p.post_title, c.c_seo, c.c_img FROM p_posts AS p LEFT JOIN p_categorias AS c ON c.cid = p.post_category  WHERE p.post_status = \'0\' AND p.post_date BETWEEN '.$data['start'].' AND '.$data['end'].' '.$data['scat'].' ORDER BY '.$data['type'].' DESC LIMIT 10');
        $datos = result_array($query);
        
        //
        return $datos;
    }


Al lado de p.post_puntos

Agregar:
Código:
, p.post_shared

Código:
/*
        getTopPostsQuery($data)
    */
    function getTopPostsQuery($data){
        
        //
        $query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT p.post_id, p.post_category, '.$data['type'].', p.post_puntos, p.post_shared, p.post_title, c.c_seo, c.c_img FROM p_posts AS p LEFT JOIN p_categorias AS c ON c.cid = p.post_category  WHERE p.post_status = \'0\' AND p.post_date BETWEEN '.$data['start'].' AND '.$data['end'].' '.$data['scat'].' ORDER BY '.$data['type'].' DESC LIMIT 10');
        $datos = result_array($query);
        
        //
        return $datos;
    }


KM-TRONOS
[img]Registrate o inicia tu sesión para ver este contenido[/img]

themes --> KM-TRONOS --> templates --> modules --> m.top_posts.tpl

Buscar:
Código:
<!--SEGUIDORES-->
                    <div class="boxy xtralarge">
                        <div class="boxy-title">
                            <h3>Top post con m&aacute;s seguidores</h3>
                            <span class="icon-noti follow-n"></span>
                        </div>
                        <div class="boxy-content">
                            {if !$tsTops.seguidores}<div class="emptyData">Nada por aqui</div>
                            {else}
                                {foreach from=$tsTops.seguidores item=p key=i}
                                <div class="TP_id">{$i+1}</div><li class="categoriaPost clearfix" style="background-image:url({$tsConfig.tema.t_url}/images/icons/cat/{$p.c_img})"><a href="{$tsConfig.url}/posts/{$p.c_seo}/{$p.post_id}/{$p.post_title|seo}.html">{$p.post_title}</a> <div class="TP_puntos">{$p.post_seguidores}</div></li>
                                {/foreach}
                            {/if}
                        </div>
                    </div>


Debajo agregar:
Código:
<!--RECOMENDADOS-->
                    <div class="boxy xtralarge">
                        <div class="boxy-title">
                            <h3>Top post m&aacute;s recomendado</h3>
                            <span class="monac_icons ma_share" style="margin-top:-15px;float:right;"></span>
                        </div>
                        <div class="boxy-content">
                            {if !$tsTops.shared}<div class="emptyData">Nada por aqui</div>
                            {else}
                                {foreach from=$tsTops.shared item=p key=i}
                                <div class="TP_id">{$i+1}</div><li class="categoriaPost clearfix" style="background-image:url({$tsConfig.tema.t_url}/images/icons/cat/{$p.c_img})"><a href="{$tsConfig.url}/posts/{$p.c_seo}/{$p.post_id}/{$p.post_title|seo}.html">{$p.post_title}</a> <div class="TP_puntos">{$p.post_shared}</div></li>
                                {/foreach}
                            {/if}
                        </div>
                    </div>


Default
[img]Registrate o inicia tu sesión para ver este contenido[/img]

themes --> default --> templates --> modules --> m.top_posts.tpl

Buscar:
Código:
<!--SEGUIDORES-->
                    <div class="boxy xtralarge">
                        <div class="boxy-title">
                            <h3>Top post con m&aacute;s seguidores</h3>
                            <span class="icon-noti follow-n"></span>
                        </div>
                        <div class="boxy-content">
                            {if !$tsTops.seguidores}<div class="emptyData">Nada por aqui</div>
                            {else}
                            <ol>
                                {foreach from=$tsTops.seguidores item=p}
                                <li class="categoriaPost clearfix" style="background-image:url({$tsConfig.tema.t_url}/images/icons/cat/{$p.c_img})"><a href="{$tsConfig.url}/posts/{$p.c_seo}/{$p.post_id}/{$p.post_title|seo}.html">{$p.post_title|truncate:45}</a> <span>{$p.post_seguidores}</span></li>
                                {/foreach}
                            </ol>
                            {/if}
                        </div>
                    </div>


Debajo agregar:
Código:
<!--RECOMENDADO-->
                    <div class="boxy xtralarge">
                        <div class="boxy-title">
                            <h3>Top post m&aacute;s recomendado</h3>
                            <span class="icon-noti follow-n"></span>
                        </div>
                        <div class="boxy-content">
                            {if !$tsTops.shared}<div class="emptyData">Nada por aqui</div>
                            {else}
                            <ol>
                                {foreach from=$tsTops.shared item=p}
                                <li class="categoriaPost clearfix" style="background-image:url({$tsConfig.tema.t_url}/images/icons/cat/{$p.c_img})"><a href="{$tsConfig.url}/posts/{$p.c_seo}/{$p.post_id}/{$p.post_title|seo}.html">{$p.post_title|truncate:45}</a> <span>{$p.post_shared}</span></li>
                                {/foreach}
                            </ol>
                            {/if}
                        </div>
                    </div>


V5
[img]Registrate o inicia tu sesión para ver este contenido[/img]

themes --> default --> templates --> modules --> m.top_posts.tpl

Buscar:
Código:
<div class="futopbox">
    <div class="htops">
        <h2>Top post con m&aacute;s seguidores</h2>
        <span class="i issgu"></span>
    </div>
    <div class="boxtops">        
    {if $tsTops.seguidores}
        {foreach from=$tsTops.seguidores item=p key=i}
            <div class="zetops">
                <b>{$i+1}</b>
                <img src="{$tsConfig.tema.t_url}/images/icons/cat/{$p.c_img}"/>
                <a href="{$tsConfig.url}/posts/{$p.c_seo}/{$p.post_id}/{$p.post_title|seo}.html">{$p.post_title|limit:35}</a>
                <span>{$p.post_seguidores}</span>
            </div>
        {/foreach}
    {else}
        <div class="nada-gris">Nada por aqui</div>
    {/if}    
    </div>
</div>


Debajo agregar:
Código:
<div class="futopbox">
    <div class="htops">
        <h2>Top post m&aacute;s recomendado</h2>
        <span class="i issgu"></span>
    </div>
    <div class="boxtops">        
    {if !$tsTops.shared}
        {foreach from=$tsTops.shared item=p}
            <div class="zetops">
                <b>{$i+1}</b>
                <img src="{$tsConfig.tema.t_url}/images/icons/cat/{$p.c_img}"/>
                <a href="{$tsConfig.url}/posts/{$p.c_seo}/{$p.post_id}/{$p.post_title|seo}.html">{$p.post_title|limit:35}</a>
                <span>{$p.post_shared}</span>
            </div>
        {/foreach}
    {else}
        <div class="nada-gris">Nada por aqui</div>
    {/if}    
    </div>
</div>


V6
[img]Registrate o inicia tu sesión para ver este contenido[/img]

themes --> default --> templates --> modules --> m.top_posts.tpl

Buscar:
Código:
<div class="futopbox">
    <div class="htops">
        <h2>Top post con m&aacute;s seguidores</h2>
        <span class="i issgu"></span>
    </div>
    <div class="boxtops">        
    {if $tsTops.seguidores}
        {foreach from=$tsTops.seguidores item=p key=i}
            <div class="zetops">
                <b>{$i+1}</b>
                <span class="toup-{$p.c_seo}" style="margin-right: 5px;margin: 2px 10px 0 0;width: 16px;height: 16px;float: left;text-shadow: none;color: #25c2f5;" title="{$p.c_seo}"></span>
                <a href="{$tsConfig.url}/posts/{$p.c_seo}/{$p.post_id}/{$p.post_title|seo}.html">{$p.post_title|limit:35}</a>
                <span>{$p.post_seguidores}</span>
            </div>
        {/foreach}
    {else}
        <div class="nada-gris">Nada por aqui</div>
    {/if}    
    </div>
</div>


Debajo agregar:
Código:
<div class="futopbox">
    <div class="htops">
        <h2>Top post con m&aacute;s seguidores</h2>
        <span class="i issgu"></span>
    </div>
    <div class="boxtops">        
    {if !$tsTops.shared}
        {foreach from=$tsTops.shared item=p}
            <div class="zetops">
                <b>{$i+1}</b>
                <span class="toup-{$p.c_seo}" style="margin-right: 5px;margin: 2px 10px 0 0;width: 16px;height: 16px;float: left;text-shadow: none;color: #25c2f5;" title="{$p.c_seo}"></span>
                <a href="{$tsConfig.url}/posts/{$p.c_seo}/{$p.post_id}/{$p.post_title|seo}.html">{$p.post_title|limit:35}</a>
                <span>{$p.post_shared}</span>
            </div>
        {/foreach}
    {else}
        <div class="nada-gris">Nada por aqui</div>
    {/if}    
    </div>
</div>



Creditos: userxd