¡Bienvenido a PHPost!

Para participar en el foro, descargar complementos y acceder al chat, es necesario tener una cuenta activa.
Por favor, regístrate utilizando un correo electrónico válido para completar la activación.

Descarga Risus Nova 2.0   (Ver notas de la versión) Estable | Actualizado: 16/06/2026

Regístrate Descargar Risus Nova
Calificación:
  • 0 voto(s) - 0 Media
  • 1
  • 2
  • 3
  • 4
  • 5

COMPLEMENTOS Favoritos en el monitor (Act 1.3)
#1

4
Mejor respuesta del mensaje Favoritos en el monitor (Act 1.3)Capturas
[img]Registrate o inicia tu sesión para ver este contenido[/img]
 
[img]Registrate o inicia tu sesión para ver este contenido[/img]




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

Buscar:
/*
        getFavoritos()
    */ 
 
 
Arriba agregar:
/*
     * listFavoritos()
     * Posts favoritos en el monitor
     * Kmario19
     */
    
function listFavoritos(){
        global 
$tsCore$tsUser;
        
//
        
$query db_exec(array(__FILE____LINE__), 'query''SELECT p.post_id, p.post_title, c.c_seo, c.c_img FROM p_favoritos AS f LEFT JOIN p_posts AS p ON p.post_id = f.fav_post_id LEFT JOIN p_categorias AS c ON c.cid = p.post_category WHERE f.fav_user = \''.$tsUser->uid.'\' AND p.post_status = \'0\' ORDER BY f.fav_date DESC LIMIT 7');
        
$data['data'] = result_array($query);
        
//
        
$data['total'] = db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT fav_id FROM p_favoritos WHERE fav_user = \''.$tsUser->uid.'\''));
        
//
        
return $data;
    } 
 
 
En ajax.favoritos.php --> inc --> php --> ajax --> ajax.favoritos.php

Buscar:
'favoritos-borrar' => array('n' => 2'p' => ''), 
 
 
Debajo agregar:
'favoritos-lista' => array('n' => 2'p' => 'lista'), 
 
 
Buscar:
case 'favoritos-borrar':
            
//<--
            
echo $tsPosts->delFavorito();
            
//-->
        
break; 
 
 
Debajo agregar:
case 'favoritos-lista':
            
// <!--
            
$smarty->assign("tsFavoritos",$tsPosts->listFavoritos());
            
// -->
        
break; 
 
 
En acciones.js --> themes --> default --> js --> acciones.js

Buscar:
mensaje.close(); 

 
Debajo agregar:
favorito.close(); 
 
 
Buscar:
notifica.close(); 
 
 
Debajo agregar:
favorito.close(); 
 
 
Buscar:
var timelib = { 
 
 
Arriba agregar:
var favorito = {
    
cache: {},
    
last: function () {
        
notifica.close();
        
mensaje.close();
        
//
        
if ($('#fav_list').css('display') != 'none') {
            $(
'#fav_list').slideUp();
            $(
'a[name=Favoritos]').parent('li').removeClass('monitor-notificaciones');
        } else {
            if (($(
'#fav_list').css('display') == 'none') || typeof favorito.cache.last == 'undefined') {
                $(
'a[name=Favoritos]').children('span').addClass('spinner');
                $(
'a[name=Favoritos]').parent('li').addClass('monitor-notificaciones');
                $(
'#fav_list').slideDown();
                
favorito.ajax(function (r) {
                    
favorito.cache['last'] = r;
                    
favorito.show();
                    
favorito.total();
                    
notifica.close();
                    
mensaje.close();
                });
            } else 
favorito.show();
        }
    },
    
ajax: function(fn){
        $(
'#loading').fadeIn(250);
        $.
ajax({
            
type'POST',
            
urlglobal_data.url '/favoritos-lista.php',
            
success: function(h){
                fn(
h);
                $(
'#loading').fadeOut(350);                
            }
        });
    },
    
show: function () {
        if (
typeof favorito.cache.last != 'undefined') {
            $(
'a[name=Favoritos]').parent('li').addClass('monitor-notificaciones');
            $(
'a[name=Favoritos]').children('span').removeClass('spinner');
            $(
'#fav_list').show().children('ul').html(favorito.cache.last);
            $(
'#fav_list > ul > li > a[title]').tipsy({ gravity's' });
        }
    },
    
total: function () {
        var 
total parseInt($('#FTotal').text());
        if(
total 0) {
            $(
'#FavsTotal').html('Favoritos <span class="floatR">' total '</span>');
        }
    },
    
close: function(){
        $(
'#fav_list').hide();
        $(
'a[name=Favoritos]').parent('li').removeClass('monitor-notificaciones');
    }

 
 
En head_menu.tpl --> themes --> default --> templates --> sections --> head_menu.tpl

Buscar:
<li>
                        <
a title="Mis Favoritos" href="{$tsConfig.url}/favoritos.php">
                            <
span class="systemicons favoritos"></span>
                        </
a>
                    </
li
 
 
Reemplazar por:
<li class="favoritos" style="position:relative">
                        <
a href="{$tsConfig.url}/favoritos.php" onclick="favorito.last(); return false" title="Posts favoritos" name="Favoritos">
                            <
span class="systemicons favoritos"></span>
                        </
a>
                        <
div class="notificaciones-list" id="fav_list" style="width:270px">
                            <
div style="padding: 10px 10px 0 10px;font-size:13px">
                                <
strong style="cursor:pointer" onclick="location.href='{$tsConfig.url}/favoritos.php'" id="FavsTotal">Favoritos</strong>
                            </
div>
                            <
ul>
                            </
ul>
                            <
a href="{$tsConfig.url}/favoritos.php" class="ver-mas">Ver todos los posts favoritos</a>
                        </
div>
                    </
li
 
 
Y subir esta carpeta

Mega
Debes agradecer para ver el contenido...

Google Drive
Debes agradecer para ver el contenido...

Mediafire
Debes agradecer para ver el contenido...




Creditos: Debes agradecer para ver el contenido...
Responder


Compartir en:

Mensajes en este tema
Favoritos en el monitor (Act 1.3) - por Chctrpgo - 11-09-2021, 11:08 AM
RE: Favoritos en el monitor (Act 1.3) - por winori - 04-09-2022, 09:16 AM
RE: Favoritos en el monitor (Act 1.3) - por suxo - 03-25-2024, 10:13 PM

Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)