¡Bienvenido! Para acceder al chat y realizar descargas, es necesario tener una cuenta activa. Regístrate aquí y asegúrate de utilizar un correo electrónico válido para completar tu activación.
Calificación:
  • 0 voto(s) - 0 Media
  • 1
  • 2
  • 3
  • 4
  • 5

COMPLEMENTOS Estadísticas Live (Act)
#1

0
Les mostrará en tiempo real los cambios en sus estadísticas, como: usuarios online, miembros registrados, posts creados, comentarios en posts, fotos agregadas, comentarios en fotos, comentarios y respuestas en Muro.

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




Ejecutar esta consulta
 
ALTER TABLE `w_statsADD `stats_shout_commentsint(11NOT NULLADD  `stats_shout_respuestasint(11NOT NULL


En c.top.php --> inc --> class --> c.top.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_shout_commentsstats_shout_respuestas 


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(pub_id) AS pu FROM u_muro'));
        
$q7 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(cid) AS mu FROM u_muro_comentarios')); 


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


Debajo agregar:
 
$return['stats_shout_comments'] = $q6[0];
        
$return['stats_shout_respuestas'] = $q7[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_shout_comments = \''.$return['stats_shout_comments'].'\', stats_shout_respuestas = \''.$return['stats_shout_respuestas'].'\' 


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 
onl parseInt($('#stat-onl').text());
var 
mem parseInt($('#stat-mem').text());
var 
pos parseInt($('#stat-pos').text());
var 
com parseInt($('#stat-com').text());
var 
fot parseInt($('#stat-fot').text());
var 
cfo parseInt($('#stat-cfo').text());
var 
mur parseInt($('#stat-mur').text());
var 
rmu parseInt($('#stat-rmu').text());

$.
ajax({
type'GET',
urlglobal_data.url '/posts-update_stats.php',
dataType'json',
success: function(h){
if(
onl != h['stats_online']) $('#stat-onl').text(h['stats_online']);
if(
mem != h['stats_miembros']) $('#stat-mem').text(h['stats_miembros']);
if(
pos != h['stats_posts']) $('#stat-pos').text(h['stats_posts']);
if(
com != h['stats_comments']) $('#stat-com').text(h['stats_comments']);
if(
fot != h['stats_fotos']) $('#stat-fot').text(h['stats_fotos']);
if(
cfo != h['stats_foto_comments']) $('#stat-cfo').text(h['stats_foto_comments']);
if(
mur != h['stats_shout_comments']) $('#stat-mur').text(h['stats_shout_comments']);
if(
rmu != h['stats_shout_respuestas']) $('#stat-rmu').text(h['stats_shout_respuestas']);
}
});

}, 
2000);
}); 

 
En m.home_stats.tpl --> themes --> default --> templates --> modules --> m.home_stats.tpl

Buscar:  
 
{$tsStats.stats_online


Reemplazar por:
 
<b id="stat-onl">{$tsStats.stats_online}</b
 
 
Buscar:
 
{$tsStats.stats_miembros
 
 
Reemplazar por:
 
<b id="stat-mem">{$tsStats.stats_miembros}</b


Buscar:
 
{$tsStats.stats_posts
 
 
Reemplazar por:
 
<b id="stat-pos">{$tsStats.stats_posts}</b
 
 
Buscar:
 
{$tsStats.stats_comments
 
 
Reemplazar por:
 
<b id="stat-com">{$tsStats.stats_comments}</b
 
 
Buscar:
 
{$tsStats.stats_fotos
 
 
Reemplazar por:
 
<b id="stat-fot">{$tsStats.stats_fotos}</b
 
 
Buscar:
 
{$tsStats.stats_foto_comments
 
 
Reemplazar por:
 
<b id="stat-cfo">{$tsStats.stats_foto_comments}</b
 
 
Debajo de:
 
<tr>
                                    <
td style="background-image:url({$tsConfig.default}/images/icons/foto.png);"><b id="stat-fot">{$tsStats.stats_fotos}</bfotos</td>
                                    <
td style="background-image:url({$tsConfig.default}/images/icons/comment.png);"><b id="stat-cfo">{$tsStats.stats_foto_comments}</bcomentarios en fotos</td>
                                </
tr
 
 
Agregar:
 
<tr>
                                    <
td style="background-image:url({$tsConfig.default}/images/icons/autor.png);"><b id="stat-mur">{$tsStats.stats_shout_comments}</bMuro</td>
                                    <
td style="background-image:url({$tsConfig.default}/images/icons/comentarios.gif);"><b id="stat-rmu">{$tsStats.stats_shout_respuestas}</brespuestas en muro</td>
                                </
tr




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


Compartir en:

Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)