¡Bienvenido a PHPost!

Para participar en el foro, descargar complementos y acceder al chat, necesitas una cuenta activa. Usa un correo electrónico válido para completar la activación.

Crear cuenta gratis

¿Ya tienes cuenta? Inicia sesión aquí

Calificación:
  • 0 voto(s) - 0 Media
  • 1
  • 2
  • 3
  • 4
  • 5

COMPLEMENTOS Visitas Entrantes en Tiempo Real (Act)
#1

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




Ejecutar esta consulta
ALTER TABLE `w_statsADD `stats_visitasint(11NOT NULL


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

Buscar:
// OBTENEMOS LAS ESTADISTICAS
        
$return db_exec('fetch_assoc'db_exec(array(__FILE____LINE__), 'query''SELECT stats_max_online, stats_max_time, stats_time, stats_time_cache, stats_miembros, stats_posts, stats_fotos, stats_comments, stats_foto_comments FROM w_stats WHERE stats_no = \'1\'')); 


Después de:
stats_foto_comments 


Agregar:
stats_visitas 


Buscar:
$q5 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(cid) AS fc FROM f_comentarios')); 


Debajo agregar:
$q6 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(id) AS pu FROM w_visitas')); 


Buscar:
$return['stats_foto_comments'] = $q5[0]; 


Debajo agregar:
$return['stats_visitas'] = $q6[0]; 


Buscar:
$ndat ', stats_time_cache = \''.time().'\', stats_miembros = \''.$return['stats_miembros'].'\', stats_posts = \''.$return['stats_posts'].'\', stats_fotos = \''.$return['stats_fotos'].'\', stats_comments = \''.$return['stats_comments'].'\', stats_foto_comments = \''.$return['stats_foto_comments'].'\''


Después de:
stats_foto_comments = \''.$return['stats_foto_comments'].'\' 


Agregar:
stats_visitas = \''.$return['stats_visitas'].'\' 


En ajax.posts.php --> inc --> php --> ajax --> ajax.posts.php

Buscar:    
require('../class/c.posts.php');
    
$tsPosts = new tsPosts(); 


Debajo agregar:
require('../class/c.tops.php');
    
$tsTops = new tsTops(); 


Buscar:    
case 'posts-last-comentarios':
            
//<--
                
$smarty->assign("tsComments",$tsPosts->getLastComentarios());
            
//-->
        
break; 

 
Debajo agregar:
case 'posts-update_stats':
            
//<--
                
$stats $tsTops->getStats();
                echo 
json_encode($stats);
            
//-->
        
break; 


En funciones.js --> themes --> default --> js --> funciones.js

Al final agregar:    
$(document).ready(function(){
setInterval(function() {
var 
vis parseInt($('#stat-vis').text());
$.
ajax({
type'GET',
urlglobal_data.url '/posts-update_stats.php',
dataType'json',
success: function(h){
if(
vis != h['stats_visitas']) $('#stat-vis').text(h['stats_visitas']);
}
});
}, 
2000);
}); 


En t.home.tpl --> themes --> default --> templates --> t.home.tpl

Buscar:
{include file='modules/m.home_stats.tpl'


Debajo agregar:
{include file='modules/m.home_visitas.tpl'



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...

Uptobox
Debes agradecer para ver el contenido...

4shared
Debes agradecer para ver el contenido...




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


Compartir en:

Mensajes en este tema
Visitas Entrantes en Tiempo Real (Act) - por Chctrpgo - 09-06-2022, 11:33 AM

Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)