PHPost | Soporte, Descargas y Tutoriales de Risus Nova

Versión completa: Mod Videos Completo (Act-Fix 1.3)
Actualmente estas viendo una versión simplificada de nuestro contenido. Ver la versión completa con el formato correcto.
Actualizado el 04/02/2024

Demo
http://Registrate o inicia tu sesión par... contenido


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


Ejecutar estas consultas
 
Código PHP:
CREATE TABLE IF NOT EXISTS `v_videos` (
  `
vid_idint(11NOT NULL AUTO_INCREMENT,
  `
vid_titlevarchar(40NOT NULL,
  `
vid_dateint(10NOT NULL,
  `
vid_descriptiontext NOT NULL,
  `
vid_urlvarchar(200NOT NULL,
  `
vid_userint(11NOT NULL,
  `
vid_closedint(1NOT NULL DEFAULT '0',
  `
vid_visitasint(1NOT NULL DEFAULT '0',
  `
vid_votos_posint(3NOT NULL DEFAULT '0',
  `
vid_votos_negint(3NOT NULL DEFAULT '0',
  `
vid_statusint(1NOT NULL DEFAULT '0',
  `
vid_lastint(1NOT NULL DEFAULT '0',
  `
vid_hitsint(11NOT NULL DEFAULT '0',
  `
vid_ipvarchar(15NOT NULL DEFAULT '0',
  
PRIMARY KEY (`vid_id`)
ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1
 
Código PHP:
CREATE TABLE IF NOT EXISTS `v_comentarios` (
  `
cidint(11NOT NULL AUTO_INCREMENT,
  `
c_vid_idint(11NOT NULL,
  `
c_userint(11NOT NULL,
  `
c_dateint(10NOT NULL,
  `
c_bodytext NOT NULL,
  `
c_ipvarchar(15NOT NULL,
    
PRIMARY KEY (`cid`)
ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=
 
Código PHP:
CREATE TABLE IF NOT EXISTS `v_votos` (
  `
vidint(11NOT NULL AUTO_INCREMENT,
  `
v_vid_idint(11NOT NULL,
  `
v_userint(11NOT NULL,
  `
v_typeint(1NOT NULL,
  `
v_dateint(11NOT NULL,
  
PRIMARY KEY (`vid`)
ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=
 
Código PHP:
ALTER TABLE `w_medallasADD  `m_cond_videoINT11 NOT NULL
Código PHP:
ALTER TABLE `w_statsADD `stats_videosINT NOT NULL
Código PHP:
ALTER TABLE `w_statsADD `stats_video_commentsINT NOT NULL
Código PHP:
ALTER TABLE `u_miembrosADD `user_videosINT(11NOT NULL


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

Buscar:
 
Código PHP:
function GetAdminStats()
    {
        
$num db_exec('fetch_assoc'db_exec(array(__FILE____LINE__), 'query''SELECT 
        (SELECT count(foto_id) FROM f_fotos WHERE f_status = \'2\') as fotos_eliminadas, 
        (SELECT count(foto_id) FROM f_fotos WHERE f_status = \'1\') as fotos_ocultas, 
        (SELECT count(foto_id) FROM f_fotos WHERE f_status = \'0\') as fotos_visibles, 
        (SELECT count(post_id) FROM p_posts WHERE post_status = \'0\') as posts_visibles, 
        (SELECT count(post_id) FROM p_posts WHERE post_status = \'1\') as posts_ocultos, 
        (SELECT count(post_id) FROM p_posts  WHERE post_status = \'2\') as posts_eliminados, 
        (SELECT count(post_id) FROM p_posts  WHERE post_status = \'3\') as posts_revision, 
        (SELECT count(cid) FROM p_comentarios WHERE c_status = \'0\') as comentarios_posts_visibles, 
        (SELECT count(cid) FROM p_comentarios WHERE c_status = \'1\') as comentarios_posts_ocultos, 
        (SELECT count(user_id) FROM u_miembros WHERE user_activo = \'1\') as usuarios_activos, 
        (SELECT count(user_id) FROM u_miembros WHERE user_activo = \'0\' ) as usuarios_inactivos, 
        (SELECT count(user_id) FROM u_miembros WHERE user_baneado = \'1\' ) as usuarios_baneados, 
        (SELECT count(cid) FROM f_comentarios) as comentarios_fotos_total, 
        (SELECT count(follow_id) FROM u_follows WHERE f_type  = \'1\' ) AS usuarios_follows,
        (SELECT count(follow_id) FROM u_follows WHERE f_type  = \'2\' ) AS posts_follows,
        (SELECT count(follow_id) FROM u_follows WHERE f_type  = \'3\' ) AS posts_compartidos,
        (SELECT count(fav_id) FROM p_favoritos) AS posts_favoritos,  
        (SELECT count(mr_id) FROM u_respuestas) AS usuarios_respuestas,
        (SELECT count(mp_id) FROM u_mensajes) AS mensajes_total, 
        (SELECT count(mp_id) FROM u_mensajes WHERE mp_del_to = \'1\') AS mensajes_de_eliminados,
        (SELECT count(mp_id) FROM u_mensajes WHERE mp_del_from = \'1\') AS mensajes_para_eliminados,
        (SELECT count(bid) FROM p_borradores) AS posts_borradores,
        (SELECT count(bid) FROM u_bloqueos) AS usuarios_bloqueados, 
        (SELECT count(bid) FROM u_bloqueos) AS usuarios_bloqueados,
        (SELECT count(medal_id) FROM w_medallas WHERE m_type = \'1\') AS medallas_usuarios,
        (SELECT count(medal_id) FROM w_medallas WHERE m_type = \'2\') AS medallas_posts,
        (SELECT count(medal_id) FROM w_medallas WHERE m_type = \'3\') AS medallas_fotos,
        (SELECT count(id) FROM w_medallas_assign) AS medallas_asignadas, 
        (SELECT count(aid) FROM w_afiliados WHERE a_active = \'1\') AS afiliados_activos, 
        (SELECT count(aid) FROM w_afiliados WHERE a_active = \'0\') AS afiliados_inactivos,
        (SELECT count(pub_id) FROM u_muro) AS muro_estados, 
        (SELECT count(cid) FROM u_muro_comentarios) AS muro_comentarios
        '
));

        
$num['usuarios_total'] = $num['usuarios_activos'] + $num['usuarios_inactivos'] +
            
$num['usuarios_baneados'];
        
$num['seguidos_total'] = $num['posts_follows'] + $num['usuarios_follows'];
        
$num['muro_total'] = $num['muro_estados'] + $num['muro_comentarios'];
        
$num['afiliados_total'] = $num['afiliados_activos'] + $num['afiliados_inactivos'];
        
$num['posts_total'] = $num['posts_visibles'] + $num['posts_ocultos'] + $num['posts_eliminados'];
        
$num['comentarios_posts_total'] = $num['comentarios_posts_visibles'] + $num['comentarios_posts_ocultos'];
        
$num['medallas_total'] = $num['medallas_usuarios'] + $num['medallas_posts'] + $num['medallas_fotos'];
        
$num['fotos_total'] = $num['fotos_visibles'] + $num['fotos_ocultas'] + $num['fotos_eliminadas']; 


Reemplazar por:
 
Código PHP:
function GetAdminStats()
    {
        
$num db_exec('fetch_assoc'db_exec(array(__FILE____LINE__), 'query''SELECT 
        (SELECT count(foto_id) FROM f_fotos WHERE f_status = \'2\') as fotos_eliminadas, 
        (SELECT count(foto_id) FROM f_fotos WHERE f_status = \'1\') as fotos_ocultas, 
        (SELECT count(foto_id) FROM f_fotos WHERE f_status = \'0\') as fotos_visibles,
 (SELECT count(vid_id) FROM v_videos WHERE vid_status = \'2\') as videos_eliminados,
 (SELECT count(vid_id) FROM v_videos WHERE vid_status = \'1\') as videos_ocultos,
 (SELECT count(vid_id) FROM v_videos WHERE vid_status = \'0\') as videos_visibles,
        (SELECT count(post_id) FROM p_posts WHERE post_status = \'0\') as posts_visibles, 
        (SELECT count(post_id) FROM p_posts WHERE post_status = \'1\') as posts_ocultos, 
        (SELECT count(post_id) FROM p_posts  WHERE post_status = \'2\') as posts_eliminados, 
        (SELECT count(post_id) FROM p_posts  WHERE post_status = \'3\') as posts_revision, 
        (SELECT count(cid) FROM p_comentarios WHERE c_status = \'0\') as comentarios_posts_visibles, 
        (SELECT count(cid) FROM p_comentarios WHERE c_status = \'1\') as comentarios_posts_ocultos, 
        (SELECT count(user_id) FROM u_miembros WHERE user_activo = \'1\') as usuarios_activos, 
        (SELECT count(user_id) FROM u_miembros WHERE user_activo = \'0\' ) as usuarios_inactivos, 
        (SELECT count(user_id) FROM u_miembros WHERE user_baneado = \'1\' ) as usuarios_baneados, 
        (SELECT count(cid) FROM f_comentarios) as comentarios_fotos_total,
 (SELECT count(cid) FROM v_comentarios) as comentarios_videos_total,
        (SELECT count(follow_id) FROM u_follows WHERE f_type  = \'1\' ) AS usuarios_follows,
        (SELECT count(follow_id) FROM u_follows WHERE f_type  = \'2\' ) AS posts_follows,
        (SELECT count(follow_id) FROM u_follows WHERE f_type  = \'3\' ) AS posts_compartidos,
        (SELECT count(fav_id) FROM p_favoritos) AS posts_favoritos,  
        (SELECT count(mr_id) FROM u_respuestas) AS usuarios_respuestas,
        (SELECT count(mp_id) FROM u_mensajes) AS mensajes_total, 
        (SELECT count(mp_id) FROM u_mensajes WHERE mp_del_to = \'1\') AS mensajes_de_eliminados,
        (SELECT count(mp_id) FROM u_mensajes WHERE mp_del_from = \'1\') AS mensajes_para_eliminados,
        (SELECT count(bid) FROM p_borradores) AS posts_borradores,
        (SELECT count(bid) FROM u_bloqueos) AS usuarios_bloqueados, 
        (SELECT count(bid) FROM u_bloqueos) AS usuarios_bloqueados,
        (SELECT count(medal_id) FROM w_medallas WHERE m_type = \'1\') AS medallas_usuarios,
 (SELECT count(medal_id) FROM w_medallas WHERE m_type = \'2\') AS medallas_posts,
 (SELECT count(medal_id) FROM w_medallas WHERE m_type = \'3\') AS medallas_fotos,
 (SELECT count(medal_id) FROM w_medallas WHERE m_type = \'4\') AS medallas_videos,
 (SELECT count(id) FROM w_medallas_assign) AS medallas_asignadas,
 (SELECT count(aid) FROM w_afiliados WHERE a_active = \'1\') AS afiliados_activos,
 (SELECT count(aid) FROM w_afiliados WHERE a_active = \'0\') AS afiliados_inactivos,
 (SELECT count(pub_id) FROM u_muro) AS muro_estados,
 (SELECT count(cid) FROM u_muro_comentarios) AS muro_comentarios
        '
));

        
$num['usuarios_total'] = $num['usuarios_activos'] + $num['usuarios_inactivos'] +
            
$num['usuarios_baneados'];
        
$num['seguidos_total'] = $num['posts_follows'] + $num['usuarios_follows'];
        
$num['muro_total'] = $num['muro_estados'] + $num['muro_comentarios'];
        
$num['afiliados_total'] = $num['afiliados_activos'] + $num['afiliados_inactivos'];
        
$num['posts_total'] = $num['posts_visibles'] + $num['posts_ocultos'] + $num['posts_eliminados'];
        
$num['comentarios_posts_total'] = $num['comentarios_posts_visibles'] + $num['comentarios_posts_ocultos'];
 
$num['medallas_total'] = $num['medallas_usuarios'] + $num['medallas_posts'] + $num['medallas_videos'] + $num['medallas_fotos'];
 
$num['fotos_total'] = $num['fotos_visibles'] + $num['fotos_ocultas'] + $num['fotos_eliminadas'];
 
$num['videos_total'] = $num['videos_visibles'] + $num['videos_ocultos'] + $num['videos_eliminados']; 


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

Buscar:
 
Código PHP:
case 'mps':
                
$query db_exec(array(__FILE____LINE__), 'query''SELECT r.*, m.mp_id, m.mp_to, m.mp_from, m.mp_subject, m.mp_preview, m.mp_date FROM w_denuncias AS r LEFT JOIN u_mensajes AS m ON r.obj_id = m.mp_id WHERE d_type = 2 GROUP BY r.obj_id ORDER BY r.d_date DESC');
                
$data result_array($query);
                
                break; 


Debajo agregar:
 
Código PHP:
case 'videos':
               
$query db_exec(array(__FILE____LINE__), 'query''SELECT r.*, SUM(d_total) AS total, v.vid_id, v.vid_title, v.vid_status, u.user_id, u.user_name FROM w_denuncias AS r LEFT JOIN v_videos AS v ON r.obj_id = v.vid_id LEFT JOIN u_miembros AS u ON v.vid_user = u.user_id WHERE d_type = \'5\' &amp;&amp; v.vid_status < 2 GROUP BY r.obj_id ORDER BY total DESC, r.d_date DESC');
               
$data result_array($query);

               break; 


Buscar:
 
Código PHP:
case 'users':
                
$d_type 3;
                
$query db_exec(array(__FILE____LINE__), 'query''SELECT user_id, user_name FROM u_miembros WHERE user_id = ' .
                    
$obj ' LIMIT 1');
                break; 


Debajo agregar:
 
Código PHP:
case 'videos':
               
$d_type 5;
               
$query db_exec(array(__FILE____LINE__), 'query''SELECT v.vid_id, v.vid_title, v.vid_status, u.user_name FROM v_videos AS v LEFT JOIN u_miembros AS u ON v.vid_user = u.user_id WHERE v.vid_id = ' .
                   
$obj ' LIMIT 1');
               break; 


Buscar:
 
Código PHP:
$query db_exec(array(__FILE____LINE__), 'query''SELECT f.foto_id, f.f_title, f.f_user, f.f_date, f.f_ip, u.user_name FROM f_fotos AS f LEFT JOIN u_miembros AS u ON f.f_user = u.user_id WHERE ' .
            (
$tipo == 'f.f_ip ' $met '' 'f.f_title ' $met .
            
' OR f.f_description ' $met));
        
$data['fotos'] = result_array($query);
        
$data['f_total'] = count($data['fotos']);
        
        
// 


Debajo agregar:
 
Código PHP:
$query db_exec(array(__FILE____LINE__), 'query''SELECT v.vid_id, v.vid_title, v.vid_user, v.vid_date, v.vid_ip, u.user_name FROM v_videos AS f LEFT JOIN u_miembros AS u ON v.vid_user = u.user_id WHERE ' .
            (
$tipo == 'v.vid_ip ' $met '' 'v.vid_title ' $met .
            
' OR v.vid_description ' $met));
        
$data['videos'] = result_array($query);
        
$data['v_total'] = count($data['videos']); 


Buscar:
 
Código PHP:
//
        
$query db_exec(array(__FILE____LINE__), 'query''SELECT u.user_id, u.user_name, f.* , c.* FROM f_comentarios AS c LEFT JOIN u_miembros AS u ON u.user_id = c.c_user LEFT JOIN f_fotos AS f ON f.foto_id = c.c_foto_id WHERE ' .
            (
$tipo == 'c.c_ip ' $met '' 'c.c_user ' $met ' OR c.c_body ' $met));
        
$data['f_comentarios'] = result_array($query);
        
        
$data['c_f_total'] = count($data['f_comentarios']);
        
// 


Debajo agregar:
 
Código PHP:
$query db_exec(array(__FILE____LINE__), 'query''SELECT u.user_id, u.user_name, v.* , c.* FROM v_comentarios AS c LEFT JOIN u_miembros AS u ON u.user_id = c.c_user LEFT JOIN v_videos AS f ON v.vid_id = c.c_video_id WHERE ' .
            (
$tipo == 'c.c_ip ' $met '' 'c.c_user ' $met ' OR c.c_body ' $met));
        
$data['v_comentarios'] = result_array($query);
        
$data['c_v_total'] = count($data['v_comentarios']);
        
// 


Buscar:
 
Código PHP:
/**
     * @name deletePost($pid)
     * @access public
     * @param int
     * @return string
     */ 


Arriba agregar:
 
Código PHP:
function rebootVideo($vid)
    {
        global 
$tsUser;
        if (
$tsUser->is_admod)
        {

            
$rows db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT obj_id FROM w_denuncias WHERE obj_id = \'' .
                (int)
$mid '\' AND `d_type` = \'5\''));
            if (
$rows && $tsUser->is_admod)
            {
                
$canview true;
            }
            
//BORRAMOS LA DENUNCIA
            
if (db_exec(array(__FILE____LINE__), 'query''DELETE FROM `w_denuncias` WHERE `obj_id` = \'' . (int)$vid '\' AND `d_type` = \'5\''))
            {
                
db_exec(array(__FILE____LINE__), 'query''UPDATE `v_videos` SET vid_status= \'0\' WHERE `vid_id` = \'' . (int)
                    
$vid '\'');
                return 
'1: Denuncia eliminada';
            } else
                return 
'0: No se pudo eliminar la denuncia';
        } else
            return 
'0: No contin&uacute;e por aqu&iacute;.';
   } 


Buscar:
 
Código PHP:
/**
     * @name setSticky
     * @access public
     * @param $post_id
     * @return string
     * @info Pone sticky un post
     */ 


Arriba agregar:
 
Código PHP:
public function deleteVideo($vid)
    {
        global 
$tsCore$tsMonitor$tsUser;

        if (
$tsUser->is_admod)
        {

           
// RAZON
    
$razon $tsCore->setSecure($_POST['razon']);
    
$razon_desc $tsCore->setSecure($_POST['razon_desc']);
    
$razon_db = ($razon != 8) ? $razon $razon_desc;
           
//
           
if (db_exec(array(__FILE____LINE__), 'query''UPDATE `v_videos` SET `vid_status` = \'2\' WHERE `vid_id` = \'' .
               
$vid '\''))
           {
               
db_exec(array(__FILE____LINE__), 'query''UPDATE `w_stats` SET `stats_videos` = stats_videos - \'1\' WHERE `stats_no` = \'1\'');
               if (
$data['vid_user'] != $tsUser->uid)
               {
                  
// ENVIAR AVISO
                  
$query db_exec(array(__FILE____LINE__), 'query''SELECT v.vid_user, v.vid_title, u.user_name FROM v_videos AS v LEFT JOIN u_miembros AS u ON v.vid_user = u.user_id WHERE v.vid_id = \'' .
                      (int)
$vid '\' LIMIT 1');
                  
$data db_exec('fetch_assoc'$query);

                  
// RAZON
                  
if (is_numeric($razon_db))
                  {
                      include (
TS_EXTRA 'datos.php');
                      
$razon_db $tsDenuncias['videos'][$razon_db];
                  }
                  
// AVISO
                  
$aviso 'Hola <b>' $data['user_name'] . "</b>\n\n Lamento contarte que tu video titulado <b>" .
                      
$data['vid_title'] . "</b> ha sido eliminado.\n\n Causa: <b>" $razon_db "</b>\n\n Te recomendamos leer el <a href=\"" .
                      
$tsCore->settings['url'] . "/pages/protocolo/\">Protocolo</a> para evitar futuras sanciones.\n\n Muchas gracias por entender!";
                  
$status $tsMonitor->setAviso($data['vid_user'], 'Video eliminado'$aviso1);
                  
//
               
}
               
// ELIMINAR DENUNCIAS
               
db_exec(array(__FILE____LINE__), 'query''DELETE FROM `w_denuncias` WHERE `obj_id` = \'' $vid '\' AND `d_type` = \'5\'');
               
$this->setHistory('borrar''video'$vid);
               return 
'1: El video ha sido eliminado.';
            }
            
//
            
return '0: El video NO pudo ser eliminado.';
        } else
            return 
'0: No deberías continuar con esto.';

     } 


Buscar:
 
Código PHP:
}

    public function 
getPospelera()
    { 


Arriba agregar:
 
Código PHP:
elseif ($type == 'video')
       {
          
// DATOS
          
$query db_exec(array(__FILE____LINE__), 'query''SELECT `vid_id`, `vid_description`, `vid_title`, `vid_user` FROM `v_videos` WHERE `vid_id` = \'' .
             (int)
$data '\' LIMIT 1');
          
$video db_exec('fetch_assoc'$query);

          switch (
$action)
          {
              case 
'borrar':
                  
// RAZON
                  
$razon $tsCore->setSecure($_POST['razon']);
                  
$razon_desc $tsCore->setSecure($_POST['razon_desc']);
                  
$razon_db = ($razon != 8) ? $razon $razon_desc;
                  
// INSERTAR
                  
db_exec(array(__FILE____LINE__), 'query''INSERT INTO w_historial (`pofid`, `action`, `type`, `mod`, `reason`, `date`, `mod_ip`) VALUES (\'' .
                      (int)
$video['vid_id'] . '\', \'2\', \'2\', \'' $tsUser->uid '\', \'' .
                      
$tsCore->setSecure($razon_db) . '\', \'' time() . '\', \'' .
                      
$tsCore->setSecure($_SERVER['REMOTE_ADDR']) . '\')');
                  return 
true;
                  break;
            }
        } 


Buscar:
 
Código PHP:
public function getComentariosD()
    { 


Arriba agregar:
 
Código PHP:
public function getVipelera()
    {
        global 
$tsUser$tsCore;
        
//
        
$max 20// MAXIMO A MOSTRAR
        
$limit $tsCore->setPageLimit($maxtrue);

       
// PAGINAS
       
$query db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(*) FROM v_videos AS v LEFT JOIN u_miembros AS u ON u.user_id = v.vid_user LEFT JOIN w_historial AS h ON h.pofid = v.vid_id WHERE h.type = \'2\' AND h.action = \'2\' AND v.vid_status = \'2\'');

       list(
$total) = db_exec('fetch_row'$query);

       
$data['pages'] = $tsCore->pageIndex($tsCore->settings['url'] .
           
"/moderacion/vipelera?"$_GET['s'], $total$max);
       
//

       
$query db_exec(array(__FILE____LINE__), 'query''SELECT u.user_id, u.user_name, h.*, v.vid_id, v.vid_title, v.vid_user FROM v_videos AS v LEFT JOIN u_miembros AS u ON u.user_id = v.vid_user LEFT JOIN w_historial AS h ON h.pofid = v.vid_id WHERE h.type = \'2\' AND h.action = \'2\' AND v.vid_status = \'2\' LIMIT ' .
           
$limit);
       
// DENUNCIAS
       
include ("../ext/datos.php");
       
//
       
while ($row db_exec('fetch_assoc'$query))
       {
           
$row['mod_name'] = $tsUser->getUserName($row['mod']);
           
$row['reason'] = (is_numeric($row['reason'])) ? $tsDenuncias['videos'][$row['reason']] :
           
$tsCore->setSecure($row['reason']);
       
//
       
$data['datos'][] = $row;
       }
      
//
      
return $data;
    } 



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

Buscar:
 
Código PHP:
$query db_exec(array(__FILE____LINE__), 'query''SELECT u.user_id, u.user_name, a.*, p.post_id, p.post_title, c.c_nombre, c.c_seo, f.foto_id, f.f_title, w.* FROM w_medallas_assign AS a LEFT JOIN u_miembros AS u ON u.user_id = a.medal_for LEFT JOIN p_posts AS p ON p.post_id = a.medal_for LEFT JOIN p_categorias AS c ON c.cid = p.post_category LEFT JOIN f_fotos AS f ON f.foto_id = a.medal_for LEFT JOIN w_medallas AS w ON w.medal_id = a.medal_id ORDER BY a.medal_date DESC LIMIT '.$limit);
 
$datos['asignaciones'] = result_array($query); 


Reemplazar por:
 
Código PHP:
$query db_exec(array(__FILE____LINE__), 'query''SELECT u.user_id, u.user_name, a.*, p.post_id, p.post_title, c.c_nombre, c.c_seo, f.foto_id, f.f_title, v.vid_id, v.vid_title, w.* FROM w_medallas_assign AS a LEFT JOIN u_miembros AS u ON u.user_id = a.medal_for LEFT JOIN p_posts AS p ON p.post_id = a.medal_for LEFT JOIN p_categorias AS c ON c.cid = p.post_category LEFT JOIN f_fotos AS f ON f.foto_id = a.medal_for LEFT JOIN v_videos AS v ON v.vid_id = a.medal_for LEFT JOIN w_medallas AS w ON w.medal_id = a.medal_id ORDER BY a.medal_date DESC LIMIT '.$limit);
 
$datos['asignaciones'] = result_array($query); 


Agregado:
 
Código PHP:
v.vid_idv.vid_title
 
Código PHP:
v_videos AS v ON v.vid_id a.medal_for LEFT JOIN 


Buscar:
 
Código PHP:
public function editMedal(){
       global 
$tsCore;
     
// DATOS
 
$medalla = array(
 
'titulo' => $tsCore->parseBadWords($_POST['med_title']),
 
'descripcion' => $tsCore->parseBadWords($_POST['med_desc']),
 
'imagen' => $_POST['med_img'],
 
'tipo' => $_POST['med_type'],
 
'cantidad' => $_POST['med_cant'],
 
'cond_user' => $_POST['med_cond_user'],
 
'cond_user_rango' => $_POST['med_cond_user_rango'],
 
'cond_post' => $_POST['med_cond_post'],
 
'cond_foto' => $_POST['med_cond_foto'],
 );
 
 if(empty(
$medalla['titulo']) || empty($medalla['descripcion'])) return 'Debe introducir t&iacute;tulo y descripci&oacute;n'// No campos vacíos

 
if(is_numeric($medalla['tipo']) && is_numeric($medalla['cond_user']) && is_numeric($medalla['cond_user_rango']) && is_numeric($medalla['cond_post']) && is_numeric($medalla['cond_foto'])){

 
//COMPROBAMOS QUE NO EXISTA
 
if($medalla['tipo'] == 1){
 if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT medal_id FROM `w_medallas` WHERE  `m_type` = \'1\' AND `m_cant` = \''.(int)$medalla['cantidad'].'\' AND  `m_cond_user` = \''.(int)$medalla['cond_user'].'\' AND  `m_cond_user_rango` = \''.(int)$medalla['cond_user_rango'].'\' AND medal_id != \''.(int)$_GET['mid'].'\''))) $continue false; else $continue true;
 }elseif(
$medalla['tipo'] == 2){
 if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT medal_id FROM w_medallas WHERE m_type = \'2\' && m_cant = \''.(int)$medalla['cantidad'].'\' && m_cond_post = \''.(int)$medalla['cond_post'].'\' AND medal_id != \''.(int)$_GET['mid'].'\''))) $continue false; else $continue true;
 }elseif(
$medalla['tipo'] == 3){
 if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT medal_id FROM w_medallas WHERE m_type = \'3\' && m_cant = \''.(int)$medalla['cantidad'].'\' && m_cond_post = \''.(int)$medalla['cond_foto'].'\' AND medal_id != \''.(int)$_GET['mid'].'\''))) $continue false; else $continue true;
 } 
 
// ACTUALIZAR
        
if($continue == true) {
 if(
db_exec(array(__FILE____LINE__), 'query''UPDATE w_medallas SET m_title = \''.$tsCore->setSecure($medalla['titulo'], true).'\', m_description = \''.$tsCore->setSecure($medalla['descripcion'], true).'\', m_image = \''.$tsCore->setSecure($medalla['imagen'], true).'\', m_cant = \''.(int)$medalla['cantidad'].'\', m_type = \''.(int)$medalla['tipo'].'\', m_cond_user = \''.(int)$medalla['cond_user'].'\', m_cond_user_rango = \''.(int)$medalla['cond_user_rango'].'\', m_cond_post = \''.(int)$medalla['cond_post'].'\', m_cond_foto = \''.(int)$medalla['cond_foto'].'\' WHERE medal_id = \''.(int)$_GET['mid'].'\'')) return true;
 }else return 
'Ya existe una medalla con esas caracter&iacute;sticas';
 }else return 
'Introduzca valores num&eacute;ricos';
 } 


Reemplazar por:
 
Código PHP:
public function editMedal(){
       global 
$tsCore;
     
// DATOS
 
$medalla = array(
 
'titulo' => $tsCore->parseBadWords($_POST['med_title']),
 
'descripcion' => $tsCore->parseBadWords($_POST['med_desc']),
 
'imagen' => $_POST['med_img'],
 
'tipo' => $_POST['med_type'],
 
'cantidad' => $_POST['med_cant'],
 
'cond_user' => $_POST['med_cond_user'],
 
'cond_user_rango' => $_POST['med_cond_user_rango'],
 
'cond_post' => $_POST['med_cond_post'],
 
'cond_foto' => $_POST['med_cond_foto'],
 
'cond_video' => $_POST['med_cond_video'],
 );
 
 if(empty(
$medalla['titulo']) || empty($medalla['descripcion'])) return 'Debe introducir t&iacute;tulo y descripci&oacute;n'// No campos vacíos

 
if(is_numeric($medalla['tipo']) && is_numeric($medalla['cond_user']) && is_numeric($medalla['cond_user_rango']) && is_numeric($medalla['cond_post']) && is_numeric($medalla['cond_video']) && is_numeric($medalla['cond_foto'])){

 
//COMPROBAMOS QUE NO EXISTA
 
if($medalla['tipo'] == 1){
 if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT medal_id FROM `w_medallas` WHERE  `m_type` = \'1\' AND `m_cant` = \''.(int)$medalla['cantidad'].'\' AND  `m_cond_user` = \''.(int)$medalla['cond_user'].'\' AND  `m_cond_user_rango` = \''.(int)$medalla['cond_user_rango'].'\' AND medal_id != \''.(int)$_GET['mid'].'\''))) $continue false; else $continue true;
 }elseif(
$medalla['tipo'] == 2){
 if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT medal_id FROM w_medallas WHERE m_type = \'2\' && m_cant = \''.(int)$medalla['cantidad'].'\' && m_cond_post = \''.(int)$medalla['cond_post'].'\' AND medal_id != \''.(int)$_GET['mid'].'\''))) $continue false; else $continue true;
 }elseif(
$medalla['tipo'] == 3){
 if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT medal_id FROM w_medallas WHERE m_type = \'3\' && m_cant = \''.(int)$medalla['cantidad'].'\' && m_cond_post = \''.(int)$medalla['cond_foto'].'\' AND medal_id != \''.(int)$_GET['mid'].'\''))) $continue false; else $continue true;
 }elseif(
$medalla['tipo'] == 4){
 if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT medal_id FROM w_medallas WHERE m_type = \'4\' && m_cant = \''.(int)$medalla['cantidad'].'\' && m_cond_post \''.(int)$medalla['cond_video'].'\' AND medal_id != \''.(int)$_GET['mid'].'\''))) $continue false; else $continue true;
 } 
 
// ACTUALIZAR
        
if($continue == true) {
 if(
db_exec(array(__FILE____LINE__), 'query''UPDATE w_medallas SET m_title = \''.$tsCore->setSecure($medalla['titulo'], true).'\', m_description = \''.$tsCore->setSecure($medalla['descripcion'], true).'\', m_image = \''.$tsCore->setSecure($medalla['imagen'], true).'\', m_cant = \''.(int)$medalla['cantidad'].'\', m_type = \''.(int)$medalla['tipo'].'\', m_cond_user = \''.(int)$medalla['cond_user'].'\', m_cond_user_rango = \''.(int)$medalla['cond_user_rango'].'\', m_cond_post = \''.(int)$medalla['cond_post'].'\', m_cond_video = \''.(int)$medalla['cond_video'].'\', m_cond_foto = \''.(int)$medalla['cond_foto'].'\' WHERE medal_id = \''.(int)$_GET['mid'].'\'')) return true;
 }else return 
'Ya existe una medalla con esas caracter&iacute;sticas';
 }else return 
'Introduzca valores num&eacute;ricos';
 } 


Buscar:


Código PHP:
public function adNewMedal(){
        global 
$tsUser$tsCore;
 
 
// DATOS
 
$medalla = array(
 
'titulo' => $tsCore->parseBadWords($_POST['med_title']),
 
'descripcion' => $tsCore->parseBadWords($_POST['med_desc']),
 
'imagen' => $_POST['med_img'],
 
'tipo' => $_POST['med_type'],
 
'cantidad' => $_POST['med_cant'],
 
'cond_user' => $_POST['med_cond_user'],
 
'cond_user_rango' => $_POST['med_cond_user_rango'],
 
'cond_post' => $_POST['med_cond_post'],
 
'cond_foto' => $_POST['med_cond_foto'],
 );
 
 if(empty(
$medalla['titulo']) || empty($medalla['descripcion'])) return 'Debe introducir t&iacute;tulo y descripci&oacute;n'// No campos vacíos

 
if(is_numeric($medalla['tipo']) && is_numeric($medalla['cond_user']) && is_numeric($medalla['cond_user_rango']) && is_numeric($medalla['cond_post']) && is_numeric($medalla['cond_foto'])){

 
//COMPROBAMOS QUE NO EXISTA
 
if($medalla['tipo'] == 1){
 if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT medal_id FROM  `w_medallas` WHERE  `m_type` = \'1\' AND `m_cant` = \''.(int)$medalla['cantidad'].'\' AND  `m_cond_user` = \''.(int)$medalla['cond_user'].'\' AND  `m_cond_user_rango` = \''.(int)$medalla['cond_user_rango'].'\''))) $continue false; else $continue true;
 }elseif(
$medalla['tipo'] == 2){
 if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT medal_id FROM w_medallas WHERE m_type = \'2\' && m_cant = \''.(int)$medalla['cantidad'].'\' && m_cond_post = \''.(int)$medalla['cond_post'].'\''))) $continue false; else $continue true;
 }elseif(
$medalla['tipo'] == 3){
 if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT medal_id FROM w_medallas WHERE m_type = \'3\' && m_cant = \''.(int)$medalla['cantidad'].'\' && m_cond_post = \''.(int)$medalla['cond_foto'].'\''))) $continue false; else $continue true;
 } 
 
// INSERTAR
        
if($continue == true) {
 if(
db_exec(array(__FILE____LINE__), 'query''INSERT INTO `w_medallas` (`m_autor`, `m_title`, `m_description`, `m_image`, `m_cant`, `m_type`, `m_cond_user`, `m_cond_user_rango`, `m_cond_post`, `m_cond_foto`, `m_date`) VALUES (\''.$tsUser->uid.'\', \''.$tsCore->setSecure($medalla['titulo'], true).'\', \''.$tsCore->setSecure($medalla['descripcion'], true).'\', \''.$tsCore->setSecure($medalla['imagen'], true).'\', \''.(int)$medalla['cantidad'].'\', \''.(int)$medalla['tipo'].'\', \''.(int)$medalla['cond_user'].'\',  \''.(int)$medalla['cond_user_rango'].'\', \''.(int)$medalla['cond_post'].'\', \''.(int)$medalla['cond_foto'].'\', \''.time().'\')')) return true;
        else return 
'No se pudo insertar la medalla';
 }else return 
'Ya existe una medalla con esas caracter&iacute;sticas';
 }else return 
'Introduzca valores num&eacute;ricos';
 } 


Reemplazar por:
 
Código PHP:
public function adNewMedal(){
        global 
$tsUser$tsCore;
 
 
// DATOS
 
$medalla = array(
 
'titulo' => $tsCore->parseBadWords($_POST['med_title']),
 
'descripcion' => $tsCore->parseBadWords($_POST['med_desc']),
 
'imagen' => $_POST['med_img'],
 
'tipo' => $_POST['med_type'],
 
'cantidad' => $_POST['med_cant'],
 
'cond_user' => $_POST['med_cond_user'],
 
'cond_user_rango' => $_POST['med_cond_user_rango'],
 
'cond_post' => $_POST['med_cond_post'],
 
'cond_foto' => $_POST['med_cond_foto'],
 
'cond_video' => $_POST['med_cond_video'],
 );
 
 if(empty(
$medalla['titulo']) || empty($medalla['descripcion'])) return 'Debe introducir t&iacute;tulo y descripci&oacute;n'// No campos vacíos

 
if(is_numeric($medalla['tipo']) && is_numeric($medalla['cond_user']) && is_numeric($medalla['cond_user_rango']) && is_numeric($medalla['cond_post']) && is_numeric($medalla['cond_post']) && is_numeric($medalla['cond_foto']) && is_numeric($medalla['cond_video'])){

 
//COMPROBAMOS QUE NO EXISTA
 
if($medalla['tipo'] == 1){
 if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT medal_id FROM  `w_medallas` WHERE  `m_type` = \'1\' AND `m_cant` = \''.(int)$medalla['cantidad'].'\' AND  `m_cond_user` = \''.(int)$medalla['cond_user'].'\' AND  `m_cond_user_rango` = \''.(int)$medalla['cond_user_rango'].'\''))) $continue false; else $continue true;
 }elseif(
$medalla['tipo'] == 2){
 if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT medal_id FROM w_medallas WHERE m_type = \'2\' && m_cant = \''.(int)$medalla['cantidad'].'\' && m_cond_post = \''.(int)$medalla['cond_post'].'\''))) $continue false; else $continue true;
 }elseif(
$medalla['tipo'] == 3){
 if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT medal_id FROM w_medallas WHERE m_type = \'3\' && m_cant = \''.(int)$medalla['cantidad'].'\' && m_cond_post = \''.(int)$medalla['cond_foto'].'\''))) $continue false; else $continue true;
 }elseif(
$medalla['tipo'] == 4){
        if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT medal_id FROM w_medallas WHERE m_type = \'4\' && m_cant = \''.(int)$medalla['cantidad'].'\' && m_cond_post \''.(int)$medalla['cond_video'].'\''))) $continue false; else $continue true;
 } 
 
// INSERTAR
        
if($continue == true) {
 if(
db_exec(array(__FILE____LINE__), 'query''INSERT INTO `w_medallas` (`m_autor`, `m_title`, `m_description`, `m_image`, `m_cant`, `m_type`, `m_cond_user`, `m_cond_user_rango`, `m_cond_post`, `m_cond_foto`, `m_cond_video`, `m_date`) VALUES (\''.$tsUser->uid.'\', \''.$tsCore->setSecure($medalla['titulo'], true).'\', \''.$tsCore->setSecure($medalla['descripcion'], true).'\', \''.$tsCore->setSecure($medalla['imagen'], true).'\', \''.(int)$medalla['cantidad'].'\', \''.(int)$medalla['tipo'].'\', \''.(int)$medalla['cond_user'].'\',  \''.(int)$medalla['cond_user_rango'].'\', \''.(int)$medalla['cond_post'].'\', \''.(int)$medalla['cond_foto'].'\', \''.(int)$medalla['cond_video'].'\', \''.time().'\')')) return true;
        else return 
'No se pudo insertar la medalla';
 }else return 
'Ya existe una medalla con esas caracter&iacute;sticas';
 }else return 
'Introduzca valores num&eacute;ricos';
 } 


Buscar:
 
Código PHP:
public function AsignarMedalla(){
        global 
$tsUser$tsCore;
 
// DATOS
        
$medalla intval($_POST['mid']);
        
$usuario strtolower($_POST['m_usuario']);
 
$post intval($_POST['pid']);
 
$foto intval($_POST['fid']);
 
$user_id $tsUser->getUserID($usuario);
 
 if(!empty(
$medalla) && !empty($usuario) || !empty($post) || !empty($foto)){
 if(
$usuario){
 
$yeltipo 'AND m_type = \'1\'';
 }elseif(
$post){
 
$yeltipo 'AND m_type = \'2\'';
 }elseif(
$foto){
 
$yeltipo 'AND m_type = \'3\'';
 }
 if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT medal_id FROM w_medallas WHERE medal_id = \''.(int)$medalla.'\' '.$yeltipo.' LIMIT 1'))) {
     
$_SERVER['REMOTE_ADDR'] = $_SERVER['X_FORWARDED_FOR'] ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
        if(
filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP)) {
 
 if(
$usuario){
 if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT user_id FROM u_miembros WHERE LOWER(user_name) = \''.$tsCore->setSecure($usuario).'\' LIMIT 1'))) {
 if(!
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT id FROM w_medallas_assign WHERE medal_id = \''.(int)$medalla.'\' && medal_for = \''.(int)$user_id.'\' LIMIT 1'))) {
 if(
db_exec(array(__FILE____LINE__), 'query''INSERT INTO `w_medallas_assign` (`medal_id`, `medal_for`, `medal_date`, `medal_ip`) VALUES (\''.(int)$medalla.'\', \''.(int)$user_id.'\', \''.time().'\', \''.$_SERVER['REMOTE_ADDR'].'\')') or die (show_error('Error al ejecutar la consulta de la l&iacute;nea '.__LINE__.' de '.__FILE__.'.''db'))){
 if(
db_exec(array(__FILE____LINE__), 'query''INSERT INTO u_monitor (user_id, obj_uno, not_type, not_date) VALUES (\''.(int)$user_id.'\', \''.(int)$medalla.'\', \'15\', \''.time().'\')')){
 
$continuar true;
 }else return 
'Ocurri&oacute; un error al notificar al usuario';
 }else return 
'Ocurri&oacute; un error al asignar la medalla';
 }else return 
'0: El usuario ya tiene esa medalla';
 }else return 
'0: El usuario no existe';
 
        }elseif(
$post){
 if(
db_exec('num_rows'$query db_exec(array(__FILE____LINE__), 'query''SELECT post_id, post_user FROM p_posts WHERE post_id = \''.(int)$post.'\' LIMIT 1'))){
 
$datosdelpost db_exec('fetch_assoc'$query);
        
     if(!
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT id FROM w_medallas_assign WHERE medal_id = \''.(int)$medalla.'\' && medal_for = \''.(int)$post.'\' LIMIT 1'))) {
 if(
db_exec(array(__FILE____LINE__), 'query''INSERT INTO `w_medallas_assign` (`medal_id`, `medal_for`, `medal_date`, `medal_ip`) VALUES (\''.(int)$medalla.'\', \''.(int)$post.'\', \''.time().'\', \''.$_SERVER['REMOTE_ADDR'].'\')') or die (show_error('Error al ejecutar la consulta de la l&iacute;nea '.__LINE__.' de '.__FILE__.'.''db'))){
        if(
db_exec(array(__FILE____LINE__), 'query''INSERT INTO u_monitor (user_id, obj_uno, obj_dos, not_type, not_date) VALUES (\''.(int)$datosdelpost['post_user'].'\', \''.(int)$medalla.'\', \''.(int)$post.'\', \'16\', \''.time().'\')')){
 
$continuar true;
 }else return 
'Ocurri&oacute; un error al notificar al usuario';
 }else return 
'Ocurri&oacute; un error al asignar la medalla';
 }else return 
'0: El post ya tiene esa medalla';
     }else return 
'0: El post no existe';
     
 }elseif(
$foto){
     if(
db_exec('num_rows'$query db_exec(array(__FILE____LINE__), 'query''SELECT foto_id, f_user FROM f_fotos WHERE foto_id = \''.(int)$foto.'\' LIMIT 1'))) {
 
$datosdelafoto db_exec('fetch_assoc'$query);
        
     if(!
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT id FROM w_medallas_assign WHERE medal_id = \''.(int)$medalla.'\' && medal_for = \''.(int)$foto.'\' LIMIT 1'))) {
 if(
db_exec(array(__FILE____LINE__), 'query''INSERT INTO `w_medallas_assign` (`medal_id`, `medal_for`, `medal_date`, `medal_ip`) VALUES (\''.(int)$medalla.'\', \''.(int)$foto.'\', \''.time().'\', \''.$_SERVER['REMOTE_ADDR'].'\')') or die (show_error('Error al ejecutar la consulta de la l&iacute;nea '.__LINE__.' de '.__FILE__.'.''db'))){
        if(
db_exec(array(__FILE____LINE__), 'query''INSERT INTO u_monitor (user_id, obj_uno, obj_dos, not_type, not_date) VALUES (\''.(int)$datosdelafoto['f_user'].'\', \''.(int)$medalla.'\', \''.(int)$foto.'\', \'17\', \''.time().'\')')){
 
$continuar true;
 }else return 
'Ocurri&oacute; un error al notificar al usuario';
 }else return 
'Ocurri&oacute; un error al asignar la medalla';
 }else return 
'0: La foto ya tiene esa medalla';
     }else return 
'0: La foto no existe';
     
 }else{ return 
'0: No queda claro lo que quiere';}
 
 }else return 
'0: Su IP no se pudo validar';
 }else return 
'0: La medalla no puede ser asignada porque no existe o no corresponde a este tipo de asignaci&oacute;n.';
 }else return 
'0: Falta alg&uacute;n dato importante :R';
 
 if(
$continuar) { if(db_exec(array(__FILE____LINE__), 'query''UPDATE w_medallas SET m_total = m_total + 1 WHERE medal_id = \''.(int)$medalla.'\'')) return '1: Medalla asignada'; else return 'La medalla se asign&oacute;, pero hubo un problema y el contador no se alter&oacute;'; }else return 'Hubo problemas, chacho';
 } 


Reemplazar por:


Código PHP:
public function AsignarMedalla(){
        global 
$tsUser$tsCore;
 
// DATOS
        
$medalla intval($_POST['mid']);
        
$usuario strtolower($_POST['m_usuario']);
 
$post intval($_POST['pid']);
 
$foto intval($_POST['fid']);
 
$video intval($_POST['vid']);
        
$user_id $tsUser->getUserID($usuario);
 
 if(!empty(
$medalla) && !empty($usuario) || !empty($post) || !empty($foto)){
 if(
$usuario){
 
$yeltipo 'AND m_type = \'1\'';
 }elseif(
$post){
 
$yeltipo 'AND m_type = \'2\'';
 }elseif(
$foto){
 
$yeltipo 'AND m_type = \'3\'';
        }elseif(
$video){
        
$yeltipo 'AND m_type = \'4\'';
        }
 if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT medal_id FROM w_medallas WHERE medal_id = \''.(int)$medalla.'\' '.$yeltipo.' LIMIT 1'))) {
     
$_SERVER['REMOTE_ADDR'] = $_SERVER['X_FORWARDED_FOR'] ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
        if(
filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP)) {
 
 if(
$usuario){
 if(
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT user_id FROM u_miembros WHERE LOWER(user_name) = \''.$tsCore->setSecure($usuario).'\' LIMIT 1'))) {
 if(!
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT id FROM w_medallas_assign WHERE medal_id = \''.(int)$medalla.'\' && medal_for = \''.(int)$user_id.'\' LIMIT 1'))) {
 if(
db_exec(array(__FILE____LINE__), 'query''INSERT INTO `w_medallas_assign` (`medal_id`, `medal_for`, `medal_date`, `medal_ip`) VALUES (\''.(int)$medalla.'\', \''.(int)$user_id.'\', \''.time().'\', \''.$_SERVER['REMOTE_ADDR'].'\')') or die (show_error('Error al ejecutar la consulta de la l&iacute;nea '.__LINE__.' de '.__FILE__.'.''db'))){
 if(
db_exec(array(__FILE____LINE__), 'query''INSERT INTO u_monitor (user_id, obj_uno, not_type, not_date) VALUES (\''.(int)$user_id.'\', \''.(int)$medalla.'\', \'15\', \''.time().'\')')){
 
$continuar true;
 }else return 
'Ocurri&oacute; un error al notificar al usuario';
 }else return 
'Ocurri&oacute; un error al asignar la medalla';
 }else return 
'0: El usuario ya tiene esa medalla';
 }else return 
'0: El usuario no existe';
 
        }elseif(
$post){
 if(
db_exec('num_rows'$query db_exec(array(__FILE____LINE__), 'query''SELECT post_id, post_user FROM p_posts WHERE post_id = \''.(int)$post.'\' LIMIT 1'))){
 
$datosdelpost db_exec('fetch_assoc'$query);
        
     if(!
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT id FROM w_medallas_assign WHERE medal_id = \''.(int)$medalla.'\' && medal_for = \''.(int)$post.'\' LIMIT 1'))) {
 if(
db_exec(array(__FILE____LINE__), 'query''INSERT INTO `w_medallas_assign` (`medal_id`, `medal_for`, `medal_date`, `medal_ip`) VALUES (\''.(int)$medalla.'\', \''.(int)$post.'\', \''.time().'\', \''.$_SERVER['REMOTE_ADDR'].'\')') or die (show_error('Error al ejecutar la consulta de la l&iacute;nea '.__LINE__.' de '.__FILE__.'.''db'))){
        if(
db_exec(array(__FILE____LINE__), 'query''INSERT INTO u_monitor (user_id, obj_uno, obj_dos, not_type, not_date) VALUES (\''.(int)$datosdelpost['post_user'].'\', \''.(int)$medalla.'\', \''.(int)$post.'\', \'16\', \''.time().'\')')){
 
$continuar true;
 }else return 
'Ocurri&oacute; un error al notificar al usuario';
 }else return 
'Ocurri&oacute; un error al asignar la medalla';
 }else return 
'0: El post ya tiene esa medalla';
     }else return 
'0: El post no existe';
     
 }elseif(
$foto){
     if(
db_exec('num_rows'$query db_exec(array(__FILE____LINE__), 'query''SELECT foto_id, f_user FROM f_fotos WHERE foto_id = \''.(int)$foto.'\' LIMIT 1'))) {
 
$datosdelafoto db_exec('fetch_assoc'$query);
        
     if(!
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT id FROM w_medallas_assign WHERE medal_id = \''.(int)$medalla.'\' && medal_for = \''.(int)$foto.'\' LIMIT 1'))) {
 if(
db_exec(array(__FILE____LINE__), 'query''INSERT INTO `w_medallas_assign` (`medal_id`, `medal_for`, `medal_date`, `medal_ip`) VALUES (\''.(int)$medalla.'\', \''.(int)$foto.'\', \''.time().'\', \''.$_SERVER['REMOTE_ADDR'].'\')') or die (show_error('Error al ejecutar la consulta de la l&iacute;nea '.__LINE__.' de '.__FILE__.'.''db'))){
        if(
db_exec(array(__FILE____LINE__), 'query''INSERT INTO u_monitor (user_id, obj_uno, obj_dos, not_type, not_date) VALUES (\''.(int)$datosdelafoto['f_user'].'\', \''.(int)$medalla.'\', \''.(int)$foto.'\', \'17\', \''.time().'\')')){
 
$continuar true;
 }else return 
'Ocurri&oacute; un error al notificar al usuario';
 }else return 
'Ocurri&oacute; un error al asignar la medalla';
 }else return 
'0: La foto ya tiene esa medalla';
     }else return 
'0: La foto no existe';

     }elseif(
$video){
     if(!
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT vid_id, vid_user FROM v_videos WHERE vid_id = \''.(int)$video.'\' LIMIT 1'))) {
     
$datosdelvideo db_exec('fetch_assoc'$query);
 if(!
db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT id FROM w_medallas_assign WHERE medal_id = \''.(int)$medalla.'\' && medal_for = \''.(int)$video.'\' LIMIT 1'))) {
     if(
db_exec(array(__FILE____LINE__), 'query''INSERT INTO `w_medallas_assign` (`medal_id`, `medal_for`, `medal_date`, `medal_ip`) VALUES (\''.(int)$medalla.'\', \''.(int)$video.'\', \''.time().'\', \''.$_SERVER['REMOTE_ADDR'].'\')') or die (show_error('Error al ejecutar la consulta de la l&iacute;nea '.__LINE__.' de '.__FILE__.'.''db'))){
 if(
db_exec(array(__FILE____LINE__), 'query''INSERT INTO u_monitor (user_id, obj_uno, obj_dos, not_type, not_date) VALUES (\''.(int)$datosdelvideo['vid_user'].'\', \''.(int)$medalla.'\', \''.(int)$video.'\', \'20\', \''.time().'\')')){
     
$continuar true;
     }else return 
'Ocurri&oacute; un error al notificar al usuario';
     }else return 
'Ocurri&oacute; un error al asignar la medalla';
     }else return 
'0: El video ya tiene esa medalla';
 }else return 
'0: El video no existe';
     }else{ return 
'0: No queda claro lo que quiere';}
     }else return 
'0: Su IP no se pudo validar';
 }else return 
'0: La medalla no puede ser asignada porque no existe o no corresponde a este tipo de asignaci&oacute;n.';
 }else return 
'0: Falta alg&uacute;n dato importante :R';
 
 if(
$continuar) { if(db_exec(array(__FILE____LINE__), 'query''UPDATE w_medallas SET m_total = m_total + 1 WHERE medal_id = \''.(int)$medalla.'\'')) return '1: Medalla asignada'; else return 'La medalla se asign&oacute;, pero hubo un problema y el contador no se alter&oacute;'; }else return 'Hubo problemas, chacho';
 } 


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

Buscar:
 
Código PHP:
// REAL STATS
 
$data['stats'] = db_exec('fetch_assoc'db_exec(array(__FILE____LINE__), 'query''SELECT u.user_id, u.user_rango, u.user_puntos, u.user_posts, u.user_comentarios, u.user_seguidores, u.user_cache, r.r_name, r.r_color FROM u_miembros AS u LEFT JOIN u_rangos AS r ON  u.user_rango = r.rango_id WHERE u.user_id = \''.(int)$user_id.'\'')); 


Después de:
 
Código PHP:
u.user_posts


Agregar:
 
Código PHP:
u.user_videos


Buscar:
 
Código PHP:
$q3 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(cid) AS c FROM p_comentarios WHERE c_user = \''.(int)$user_id.'\' && c_status = \'0\'')); 


Debajo agregar:
 
Código PHP:
$q4 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(vid_id) AS v FROM v_videos WHERE vid_user = \''.(int)$user_id.'\' && vid_status = \'0\'')); 


Buscar:
 
Código PHP:
$data['stats']['user_comentarios'] = $q3[0]; 


Debajo agregar:
 
Código PHP:
$data['stats']['user_videos'] = $q4[0]; 


Buscar:
 
Código PHP:
$q4 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(foto_id) AS f FROM f_fotos WHERE f_user = \''.(int)$user_id.'\' && f_status = \'0\''));
        
$data['stats']['user_fotos'] = $q4[0]; 


Debajo agregar:
 
Código PHP:
$q5 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(vid_id) AS v FROM v_videos WHERE vid_user = \''.(int)$user_id.'\' && vid_status = \'0\''));
     
$data['stats']['user_videos'] = $q5[0]; 


Buscar:
 
Código PHP:
// SIGUIENDO
        
$query db_exec(array(__FILE____LINE__), 'query''SELECT f.follow_id, u.user_id, u.user_name FROM u_follows AS f LEFT JOIN u_miembros AS u ON f.f_id = u.user_id WHERE f.f_user = \''.(int)$user_id.'\' AND f.f_type = \'1\' && u.user_activo = \'1\' && u.user_baneado = \'0\' ORDER BY f.f_date DESC LIMIT 21');
        
$data['sigd']['data'] = result_array($query);
        
$data['sigd']['total'] = count($data['sigd']['data']); 


Debajo agregar:
 
Código PHP:
// ULTIMOS VIDEOS
     
if(empty($_GET['pid'])){
         
$query db_exec(array(__FILE____LINE__), 'query''SELECT vid_id, vid_title, vid_date, vid_url FROM v_videos WHERE vid_user = \''.(int)$user_id.'\' ORDER BY vid_date DESC LIMIT 10');
     
$data['videos'] = result_array($query);
     
$total count($data['videos']);
     
$data['videos_total'] = $total;
     if(
$total 6){
     for(
$i $total$i <= 5$i++){
     
$data['videos'][$i] = NULL;
     }
     }
     } 


Buscar:
 
Código PHP:
/*
        loadPosts($user_id)
    */
    
function loadPosts($user_id){
        global 
$tsUser;
        
//
        
$query db_exec(array(__FILE____LINE__), 'query''SELECT p.post_id, p.post_title, p.post_puntos, 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_user = \''.(int)$user_id.'\' ORDER BY p.post_date DESC LIMIT 18');
        
$data['posts'] = result_array($query);
        
$data['total'] = count($data['posts']);
        
        
// USUARIO
        
$data['username'] = $tsUser->getUserName($user_id);
        
//
        
return $data;
    } 


Debajo agregar:
 
Código PHP:
/*
 loadVideos($user_id)
    */
    
function loadVideos($user_id){
     global 
$tsUser;
     
//
     
$query db_exec(array(__FILE____LINE__), 'query''SELECT v.vid_id, v.vid_title, v.vid_description, v.vid_url, v.vid_user FROM v_videos AS v WHERE v.vid_status = \'0\' AND v.vid_user = \''.(int)$user_id.'\' ORDER BY RAND() DESC LIMIT 10');
     
$data['videos'] = result_array($query);
     
$data['total'] = count($data['videos']);

     
// USUARIO
     
$data['username'] = $tsUser->getUserName($user_id);
     
//
     
return $data;
    } 


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

Buscar:
 
Código PHP:
private function makeMonitor(){
        
$this->monitor = array(
            
=> array('text' => 'agreg&oacute; a favoritos tu''ln_text' => 'post''css' => 'star'),
            
=> array('text' => array('coment&oacute; tu','_REP_ nuevos comentarios en tu'), 'ln_text' => 'post''css' => 'comment_post'),
            
=> array('text' => 'dej&oacute; _REP_ puntos en tu''ln_text' => 'post''css' => 'points'),
            
=> array('text' => 'te est&aacute; siguiendo''ln_text' => 'Seguir a este usuario''css' => 'follow'),
            
=> array('text' => 'cre&oacute; un nuevo''ln_text' => 'post''css' => 'post'),
            
=> array('text' => array('te recomienda un''_REP_ usuarios te recomiendan un'), 'ln_text' => 'post''css' => 'share'),
            
=> array('text' => array('coment&oacute; en un''_REP_ nuevos comentarios en el'), 'ln_text' => 'post''extra' => 'que sigues''css' => 'blue_ball'),
            
=> array('text' => array('vot&oacute; _REP_ tu''_REP_ nuevos votos a tu'), 'ln_text' => 'comentario''css' => 'voto_'),
            
=> array('text' => array('respondi&oacute; tu''_REP_ nuevas respuestas a tu'), 'ln_text' => 'comentario''css' => 'comment_resp'),
            
10 => array('text' => 'subi&oacute; una nueva''ln_text' => 'foto''css' => 'photo'),
            
11 => array('text' => array('coment&oacute; tu','_REP_ nuevos comentarios en tu'), 'ln_text' => 'foto''css' => 'photo'),
            
12 => array('text' => 'public&oacute; en tu''ln_text' => 'muro''css' => 'wall_post'),
            
13 => array('text' => array('coment&oacute; ''_REP_ nuevos comentarios en'), 'ln_text' => 'publicaci&oacute;n''extra' => 'coment&oacute;''css' => 'w_comment'),
            
14 => array('text' => array('le gusta tu''A _REP_ personas les gusta tu'), 'ln_text' => array('publicaci&oacute;n','comentario'), 'css' => 'w_like'),
 
15 => array('text' => 'Recibiste una medalla''css' => 'medal'),
 
16 => array('text' => 'Tu post recibi&oacute; una medalla''css' => 'medal'),
 
17 => array('text' => 'Tu foto recibi&oacute; una medalla''css' => 'medal'),
        );
    } 


Reemplazar por:
 
Código PHP:
private function makeMonitor(){
        
$this->monitor = array(
            
=> array('text' => 'agreg&oacute; a favoritos tu''ln_text' => 'post''css' => 'star'),
            
=> array('text' => array('coment&oacute; tu','_REP_ nuevos comentarios en tu'), 'ln_text' => 'post''css' => 'comment_post'),
            
=> array('text' => 'dej&oacute; _REP_ puntos en tu''ln_text' => 'post''css' => 'points'),
            
=> array('text' => 'te est&aacute; siguiendo''ln_text' => 'Seguir a este usuario''css' => 'follow'),
            
=> array('text' => 'cre&oacute; un nuevo''ln_text' => 'post''css' => 'post'),
            
=> array('text' => array('te recomienda un''_REP_ usuarios te recomiendan un'), 'ln_text' => 'post''css' => 'share'),
            
=> array('text' => array('coment&oacute; en un''_REP_ nuevos comentarios en el'), 'ln_text' => 'post''extra' => 'que sigues''css' => 'blue_ball'),
            
=> array('text' => array('vot&oacute; _REP_ tu''_REP_ nuevos votos a tu'), 'ln_text' => 'comentario''css' => 'voto_'),
            
=> array('text' => array('respondi&oacute; tu''_REP_ nuevas respuestas a tu'), 'ln_text' => 'comentario''css' => 'comment_resp'),
            
10 => array('text' => 'subi&oacute; una nueva''ln_text' => 'foto''css' => 'photo'),
            
11 => array('text' => array('coment&oacute; tu','_REP_ nuevos comentarios en tu'), 'ln_text' => 'foto''css' => 'photo'),
            
12 => array('text' => 'public&oacute; en tu''ln_text' => 'muro''css' => 'wall_post'),
            
13 => array('text' => array('coment&oacute; ''_REP_ nuevos comentarios en'), 'ln_text' => 'publicaci&oacute;n''extra' => 'coment&oacute;''css' => 'w_comment'),
            
14 => array('text' => array('le gusta tu''A _REP_ personas les gusta tu'), 'ln_text' => array('publicaci&oacute;n','comentario'), 'css' => 'w_like'),
 
15 => array('text' => 'Recibiste una medalla''css' => 'medal'),
 
16 => array('text' => 'Tu post recibi&oacute; una medalla''css' => 'medal'),
 
17 => array('text' => 'Tu foto recibi&oacute; una medalla''css' => 'medal'),
 
18 => array('text' => 'subi&oacute; el video''ln_text' => 'video''css' => 'video'),
 
20 => array('text' => 'Tu video recibi&oacute; una medalla''css' => 'medal'),
         
21 => array('text' => 'te recomienda el video''_REP_ usuarios te recomiendan un''ln_text' => 'video''css' => 'share'),
        );
    } 


Buscar:
 
Código PHP:
function makeConsulta($data){
 
# CON UN SWITCH ESCOGEMOS LA CONSULTA APROPIADA
 
switch($data['not_type']){
 
// EN ESTOS CASOS SE NECESITA LO MISMO
 // $nombredeusuario ********** tu $titulodelpost;
 
case 1
 case 
2
 case 
3
 case 
5
 case 
6:
 case 
7:
            case 
8:
            case 
9:
                return 
'SELECT p.post_id, p.post_user, p.post_title, c.c_seo FROM p_posts AS p LEFT JOIN p_categorias AS c ON p.post_category = c.cid WHERE p.post_id = \''.(int)$data['obj_uno'].'\' LIMIT 1';
 break;
 
// FOLLOW
 
case 4:
                global 
$tsUser;
 
// CHECAR SI YA LO SEGUIMOS
                
$i_follow $tsUser->iFollow($data['obj_user']);
                return array(
'follow' => $i_follow);
 break;
            
// PUBLICO EN TU MURO
            
case 12:
                return 
'SELECT p.pub_id, u.user_name FROM u_muro AS p LEFT JOIN u_miembros AS u ON p.p_user_pub = u.user_id WHERE p.pub_id = \''.(int)$data['obj_uno'].'\' LIMIT 1';
            break;
            case 
13:
                global 
$tsUser;
                
// HAY MAS DE UNA NOTIFICACION DEL MISMO TIPO
                
$query db_exec(array(__FILE____LINE__), 'query''SELECT p.pub_id, p.p_user, p.p_user_pub, u.user_name FROM u_muro AS p LEFT JOIN u_miembros AS u ON p.p_user = u.user_id WHERE p.pub_id = \''.(int)$data['obj_uno'].'\' LIMIT 1');
 
$dato db_exec('fetch_assoc'$query);
 
                
//
                
$dato['p_user_resp'] = $data['obj_user'];
                
$dato['p_user_name'] = $dato['user_name']; // // DUEÑO DEL MURO
                
$dato['user_name'] = $tsUser->getUserName($data['obj_user']); // QUIEN PUBLICO
                //
                
return $dato;
            break;
            case 
14:
                if(
$data['obj_dos'] == 2)
                    return 
'SELECT pub_id AS obj_uno, c_body FROM u_muro_comentarios WHERE cid = \''.(int)$data['obj_uno'].'\'';
                else return array(
'value' => 'hack');
            break;
 case 
15:
      return 
'SELECT medal_id, m_title, m_image FROM w_medallas WHERE medal_id = \''.(int)$data['obj_uno'].'\' LIMIT 1';
 break;
 case 
16:
                 return 
'SELECT p.post_id, p.post_title, c.c_seo, m.medal_id, m.m_title, m.m_image, a.medal_for FROM w_medallas_assign AS a LEFT JOIN p_posts AS p ON p.post_id = a.medal_for LEFT JOIN p_categorias AS c ON c.cid = p.post_category LEFT JOIN w_medallas AS m ON m.medal_id = a.medal_id WHERE m.medal_id = \''.(int)$data['obj_uno'].'\' AND p.post_id = \''.(int)$data['obj_dos'].'\' LIMIT 1';
 break;
 case 
17:
                 return 
'SELECT f.foto_id, f.f_title, f.f_user, m.medal_id, m.m_title, m.m_image, a.medal_for, u.user_id, u.user_name FROM w_medallas_assign AS a LEFT JOIN f_fotos AS f ON f.foto_id = a.medal_for LEFT JOIN u_miembros AS u ON u.user_id = f.f_user LEFT JOIN w_medallas AS m ON m.medal_id = a.medal_id WHERE m.medal_id = \''.(int)$data['obj_uno'].'\' AND f.foto_id = \''.(int)$data['obj_dos'].'\' LIMIT 1';
            break;
 }
 } 


Reemplazar por:
 
Código PHP:
function makeConsulta($data){
 
# CON UN SWITCH ESCOGEMOS LA CONSULTA APROPIADA
 
switch($data['not_type']){
 
// EN ESTOS CASOS SE NECESITA LO MISMO
 // $nombredeusuario ********** tu $titulodelpost;
 
case 1
 case 
2
 case 
3
 case 
5
 case 
6:
 case 
7:
            case 
8:
            case 
9:
                return 
'SELECT p.post_id, p.post_user, p.post_title, c.c_seo FROM p_posts AS p LEFT JOIN p_categorias AS c ON p.post_category = c.cid WHERE p.post_id = \''.(int)$data['obj_uno'].'\' LIMIT 1';
 break;
            
// COMIENZO NOTI VIDEOS
 
case 21:
 case 
18:
 return 
'SELECT vid_title, vid_url, vid_id, vid_user, u.user_name, u.user_id FROM v_videos AS v LEFT JOIN u_miembros AS u ON v.vid_user = u.user_id WHERE vid_id = \''.(int)$data['obj_uno'].'\' LIMIT 1';
 break;
 case 
19:
 return 
'SELECT vid_title, vid_url, vid_id, vid_user, u.user_name, u.user_id FROM v_videos LEFT JOIN v_comentarios AS c ON c.cid LEFT JOIN u_miembros AS u ON vid_user = u.user_id WHERE vid_id = \''.(int)$data['obj_uno'].'\' LIMIT 1';
 break;
 case 
22:
 return 
'SELECT vid_title, vid_url, vid_id, vid_user, u.user_name, u.user_id FROM v_videos LEFT JOIN u_miembros AS u ON vid_user = u.user_id WHERE vid_id = \''.(int)$data['obj_uno'].'\' LIMIT 1';
 break;
           
// FIN NOTI VIDEOS
           // FOLLOW
 
case 4:
                global 
$tsUser;
 
// CHECAR SI YA LO SEGUIMOS
                
$i_follow $tsUser->iFollow($data['obj_user']);
                return array(
'follow' => $i_follow);
 break;
            
// PUBLICO EN TU MURO
            
case 12:
                return 
'SELECT p.pub_id, u.user_name FROM u_muro AS p LEFT JOIN u_miembros AS u ON p.p_user_pub = u.user_id WHERE p.pub_id = \''.(int)$data['obj_uno'].'\' LIMIT 1';
            break;
            case 
13:
                global 
$tsUser;
                
// HAY MAS DE UNA NOTIFICACION DEL MISMO TIPO
                
$query db_exec(array(__FILE____LINE__), 'query''SELECT p.pub_id, p.p_user, p.p_user_pub, u.user_name FROM u_muro AS p LEFT JOIN u_miembros AS u ON p.p_user = u.user_id WHERE p.pub_id = \''.(int)$data['obj_uno'].'\' LIMIT 1');
 
$dato db_exec('fetch_assoc'$query);
 
                
//
                
$dato['p_user_resp'] = $data['obj_user'];
                
$dato['p_user_name'] = $dato['user_name']; // // DUEÑO DEL MURO
                
$dato['user_name'] = $tsUser->getUserName($data['obj_user']); // QUIEN PUBLICO
                //
                
return $dato;
            break;
            case 
14:
                if(
$data['obj_dos'] == 2)
                    return 
'SELECT pub_id AS obj_uno, c_body FROM u_muro_comentarios WHERE cid = \''.(int)$data['obj_uno'].'\'';
                else return array(
'value' => 'hack');
            break;
 case 
15:
      return 
'SELECT medal_id, m_title, m_image FROM w_medallas WHERE medal_id = \''.(int)$data['obj_uno'].'\' LIMIT 1';
 break;
 case 
16:
                 return 
'SELECT p.post_id, p.post_title, c.c_seo, m.medal_id, m.m_title, m.m_image, a.medal_for FROM w_medallas_assign AS a LEFT JOIN p_posts AS p ON p.post_id = a.medal_for LEFT JOIN p_categorias AS c ON c.cid = p.post_category LEFT JOIN w_medallas AS m ON m.medal_id = a.medal_id WHERE m.medal_id = \''.(int)$data['obj_uno'].'\' AND p.post_id = \''.(int)$data['obj_dos'].'\' LIMIT 1';
 break;
 case 
17:
                 return 
'SELECT f.foto_id, f.f_title, f.f_user, m.medal_id, m.m_title, m.m_image, a.medal_for, u.user_id, u.user_name FROM w_medallas_assign AS a LEFT JOIN f_fotos AS f ON f.foto_id = a.medal_for LEFT JOIN u_miembros AS u ON u.user_id = f.f_user LEFT JOIN w_medallas AS m ON m.medal_id = a.medal_id WHERE m.medal_id = \''.(int)$data['obj_uno'].'\' AND f.foto_id = \''.(int)$data['obj_dos'].'\' LIMIT 1';
            break;
 case 
20:
 return 
'SELECT v.vid_id, v.vid_title, v.vid_user, m.medal_id, m.m_title, m.m_image, a.medal_for, u.user_id, u.user_name FROM w_medallas_assign AS a LEFT JOIN v_videos AS v ON v.vid_id = a.medal_for LEFT JOIN u_miembros AS u ON u.user_id = v.vid_user LEFT JOIN w_medallas AS m ON m.medal_id = a.medal_id WHERE m.medal_id = \''.(int)$data['obj_uno'].'\' AND v.vid_id = \''.(int)$data['obj_dos'].'\' LIMIT 1';
     break;
 }
 } 


Buscar:


Código PHP:
private function makeOracion($data){
        
# GOBALES
        
global $tsCore$tsUser;
        
# LOCALES
        
$site_url $tsCore->settings['url'];
        
$no_type $data['not_type'];
        
$txt_extra = ($this->show_type == 1) ? '' ' '.$this->monitor[$no_type]['ln_text'];
        
$ln_text $this->monitor[$no_type]['ln_text'];
        
$ln_text is_array($ln_text) ? $ln_text[$data['obj_dos']-1] : $ln_text;
        
//
        
$oracion['unread'] = ($this->show_type == 1) ? $data['not_menubar'] : $data['not_monitor'];
        
$oracion['style'] = $this->monitor[$no_type]['css'];
        
$oracion['date'] = $data['not_date'];
        
$oracion['user'] = $data['usuario'];
        
$oracion['avatar'] = $data['obj_user'].'_50.jpg';
        
$oracion['total'] = $data['not_total'];
        
# CON UN SWITCH ESCOGEMOS QUE ORACION CONSTRUIR
        
switch($no_type){
            case 
1:
            case 
3:
            case 
5:
                
// 
                
$oracion['text'] = $this->monitor[$no_type]['text'].$txt_extra;
                if(
$no_type == 3$oracion['text'] = str_replace('_REP_''<b>'.$data['obj_dos'].'</b>'$oracion['text']);
                
$oracion['link'] = $site_url.'/posts/'.$data['c_seo'].'/'.$data['post_id'].'/'.$tsCore->setSEO($data['post_title']).'.html';
                
$oracion['ltext'] = ($this->show_type == 1) ? $ln_text $data['post_title'];
                
$oracion['ltit'] = ($this->show_type == 1) ? $data['post_title'] : '';
            break;
            
// FOLLOW
            
case 4:
                
$oracion['text'] = $this->monitor[$no_type]['text'];
                if(
$data['follow'] != true && $this->show_type == 2) {
                    
$oracion['link'] = '#" onclick="notifica.follow(\'user\', '.$data['obj_user'].', notifica.userInMonitorHandle, this)';
                    
$oracion['ltext'] = $this->monitor[$no_type]['ln_text'];    
                }
            break;
            
// PUEDEN SER MAS DE UNO
            
case 2:
            case 
6:
            case 
7:
            case 
8:
            case 
9:
                
// CUANTOS
                
$no_total $data['not_total'];
                
// MAS DE UNA ACCION
                
if($no_total 1) {
                    
$text $this->monitor[$no_type]['text'][1].$txt_extra;
                    
$oracion['text'] = str_replace('_REP_'"<b>{$no_total}</b>"$text);
                }
                else 
$oracion['text'] = $this->monitor[$no_type]['text'][0].$txt_extra;
                
// ¿ES MI POST?
                
if($data['post_user'] == $tsUser->uid) {
                    
$oracion['text'] = str_replace('te recomienda un''ha recomendado tu'$oracion['text']);
                }
                
// ID COMMENT
                
if($no_type == || $no_type == 9){
                    
$id_comment '#div_cmnt_'.$data['obj_dos'];
                    
// EXTRAS
                    
if($no_type == 8){
                        
$voto_type = ($data['obj_tres'] == 0) ? 'negativo' 'positivo';
                        
$oracion['text'] = str_replace('_REP_''<b>'.$voto_type.'</b>'$oracion['text']);
                        
$oracion['style'] = 'voto_'.$voto_type;
                    }
                }
                
//
                
$oracion['link'] = $site_url.'/posts/'.$data['c_seo'].'/'.$data['post_id'].'/'.$tsCore->setSEO($data['post_title']).'.html'.$id_comment;
                
$oracion['ltext'] = ($this->show_type == 1) ? $ln_text $data['post_title'];
                
$oracion['ltit'] = ($this->show_type == 1) ? $data['post_title'] : '';
            break;
            
// PUBLICACION EN MURO
            
case 12:
                
$oracion['text'] = $this->monitor[$no_type]['text'].$txt_extra;
                
$oracion['link'] = $site_url.'/perfil/'.$tsUser->nick.'/'.$data['obj_uno'];
                
$oracion['ltext'] = ($this->show_type == 1) ? $ln_text $tsUser->nick;
                
$oracion['ltit'] = ($this->show_type == 1) ? $tsUser->nick '';
            break;
            case 
13:
                
// DE QUIEN?
                
if($tsUser->uid == $data['p_user']) {
                    
$de ' tu';
                }
                elseif(
$data['p_user'] == $data['p_user_resp']) {
                    
$de ' su'
                }
                else {
                    
$de ' la publicaci&oacute;n de';
                    
//$data['link'][1] = ($typeDos == 1) ?  array($array['p_user_name'], $array['p_user_name']) : $array['p_user_name'];   
                
}
                
// CUANTOS
                
$no_total $data['not_total'];
                if(
$no_total 1) {
                    
$text $this->monitor[$no_type]['text'][1].$de.$txt_extra;
                    
$oracion['text'] = str_replace('_REP_''<b>'.$no_total.'</b>'$text);
                }
                else 
$oracion['text'] = $this->monitor[$no_type]['text'][0].$de.$txt_extra;
                
//
                //$oracion['text'] = $this->monitor[$no_type]['text'].$de.$txt_extra;
                
$oracion['link'] = $site_url.'/perfil/'.$data['p_user_name'].'/'.$data['pub_id'];
                
$oracion['ltext'] = ($this->show_type == 1) ? $ln_text $tsUser->nick;
                
$oracion['ltit'] = ($this->show_type == 1) ? $tsUser->nick '';
            break;
            case 
14:
                
// CUANTOS
                
$no_total $data['not_total'];
                
// MAS DE UNA ACCION
                
if($no_total 1) {
                    
$text $this->monitor[$no_type]['text'][1].' '.$ln_text;
                    
$oracion['text'] = str_replace('_REP_''<b>'.$no_total.'</b>'$text);
                }
                else 
$oracion['text'] = $this->monitor[$no_type]['text'][0];
                
//
                
$oracion['text'] = ($this->show_type == 1) ? $oracion['text'] : $oracion['text'].' '.$ln_text;
                
$oracion['link'] = $site_url.'/perfil/'.$tsUser->nick.'/'.$data['obj_uno'];
                
$oracion['ltext'] = ($this->show_type == 1) ? $ln_text substr($data['c_body'],0,20).'...';
                
$oracion['ltit'] = ($this->show_type == 1) ? substr($data['c_body'],0,20).'...' '';
            break;
 case 
15:
                
$oracion['text'] = 'Recibiste una nueva <span class="qtip" title="'.$data['m_title'].'"><b>medalla</b> <img src="'.$site_url.'/themes/default/images/icons/med/'.$data['m_image'].'_16.png"/></span>';
 break;
 case 
16:
                
$oracion['text'] = 'Tu <a href="'.$site_url.'/posts/'.$data['c_seo'].'/'.$data['post_id'].'/'.$tsCore->setSEO($data['post_title']).'.html" title="'.$data['post_title'].'"><b>post</b></a> tiene una nueva <span class="qtip" title="'.$data['m_title'].'"><b>medalla</b> <img src="'.$site_url.'/themes/default/images/icons/med/'.$data['m_image'].'_16.png"/></span>';
 break;
 case 
17:
                
$oracion['text'] = 'Tu <a href="'.$site_url.'/fotos/'.$data['user_name'].'/'.$data['foto_id'].'/'.$tsCore->setSEO($data['f_title']).'.html" title="'.$data['f_title'].'"><b>foto</b></a> tiene una nueva <span class="qtip" title="'.$data['m_title'].'"><b>medalla</b> <img src="'.$site_url.'/themes/default/images/icons/med/'.$data['m_image'].'_16.png"/></span>';
 break;
        }
        
# RETORNAMOS
        
return $oracion;
    } 


Reemplazar por:


Código PHP:
private function makeOracion($data){
        
# GOBALES
        
global $tsCore$tsUser;
        
# LOCALES
        
$site_url $tsCore->settings['url'];
        
$no_type $data['not_type'];
        
$txt_extra = ($this->show_type == 1) ? '' ' '.$this->monitor[$no_type]['ln_text'];
        
$ln_text $this->monitor[$no_type]['ln_text'];
        
$ln_text is_array($ln_text) ? $ln_text[$data['obj_dos']-1] : $ln_text;
        
//
        
$oracion['unread'] = ($this->show_type == 1) ? $data['not_menubar'] : $data['not_monitor'];
        
$oracion['style'] = $this->monitor[$no_type]['css'];
        
$oracion['date'] = $data['not_date'];
        
$oracion['user'] = $data['usuario'];
        
$oracion['avatar'] = $data['obj_user'].'_50.jpg';
        
$oracion['total'] = $data['not_total'];
        
# CON UN SWITCH ESCOGEMOS QUE ORACION CONSTRUIR
        
switch($no_type){
            case 
1:
            case 
3:
            case 
5:
                
// 
                
$oracion['text'] = $this->monitor[$no_type]['text'].$txt_extra;
                if(
$no_type == 3$oracion['text'] = str_replace('_REP_''<b>'.$data['obj_dos'].'</b>'$oracion['text']);
                
$oracion['link'] = $site_url.'/posts/'.$data['c_seo'].'/'.$data['post_id'].'/'.$tsCore->setSEO($data['post_title']).'.html';
                
$oracion['ltext'] = ($this->show_type == 1) ? $ln_text $data['post_title'];
                
$oracion['ltit'] = ($this->show_type == 1) ? $data['post_title'] : '';
            break;
            
// FOLLOW
            
case 4:
                
$oracion['text'] = $this->monitor[$no_type]['text'];
                if(
$data['follow'] != true && $this->show_type == 2) {
                    
$oracion['link'] = '#" onclick="notifica.follow(\'user\', '.$data['obj_user'].', notifica.userInMonitorHandle, this)';
                    
$oracion['ltext'] = $this->monitor[$no_type]['ln_text'];    
                }
            break;
            
// PUEDEN SER MAS DE UNO
            
case 2:
            case 
6:
            case 
7:
            case 
8:
            case 
9:
                
// CUANTOS
                
$no_total $data['not_total'];
                
// MAS DE UNA ACCION
                
if($no_total 1) {
                    
$text $this->monitor[$no_type]['text'][1].$txt_extra;
                    
$oracion['text'] = str_replace('_REP_'"<b>{$no_total}</b>"$text);
                }
                else 
$oracion['text'] = $this->monitor[$no_type]['text'][0].$txt_extra;
                
// ¿ES MI POST?
                
if($data['post_user'] == $tsUser->uid) {
                    
$oracion['text'] = str_replace('te recomienda un''ha recomendado tu'$oracion['text']);
                }
                
// ID COMMENT
                
if($no_type == || $no_type == 9){
                    
$id_comment '#div_cmnt_'.$data['obj_dos'];
                    
// EXTRAS
                    
if($no_type == 8){
                        
$voto_type = ($data['obj_tres'] == 0) ? 'negativo' 'positivo';
                        
$oracion['text'] = str_replace('_REP_''<b>'.$voto_type.'</b>'$oracion['text']);
                        
$oracion['style'] = 'voto_'.$voto_type;
                    }
                }
                
//
                
$oracion['link'] = $site_url.'/posts/'.$data['c_seo'].'/'.$data['post_id'].'/'.$tsCore->setSEO($data['post_title']).'.html'.$id_comment;
                
$oracion['ltext'] = ($this->show_type == 1) ? $ln_text $data['post_title'];
                
$oracion['ltit'] = ($this->show_type == 1) ? $data['post_title'] : '';
            break;
 
// NOTI VIDEOS
 
case 21:
 case 
18:
    
$oracion['text'] = $this->monitor[$no_type]['text'];
    
$oracion['link'] = $site_url.'/videos/'.$data['user_name'].'/'.$data['vid_id'].'/'.$tsCore->setSEO($data['vid_title']).'.html';
    
$oracion['ltext'] = $data['vid_title'];
    break;
    case 
19:
 
// CUANTOS
 
$no_total $data['not_total'];
 
// MAS DE UNA ACCION
 
if($no_total 1) {
 
$text $this->monitor[$no_type]['text'][1].$txt_extra;
 
$oracion['text'] = str_replace('_REP_'"<b>{$no_total}</b>"$text);
 }
 else 
$oracion['text'] = $this->monitor[$no_type]['text'][0].$txt_extra;
 
//
 
$oracion['link'] = $site_url.'/videos/'.$data['user_name'].'/'.$data['vid_id'].'/'.$tsCore->setSEO($data['vid_title']).'.html';
 
$oracion['ltext'] = $data['vid_title'];
 break;
 case 
22:
 
$no_total $data['not_total'];
 if(
$no_total 1) {
 
$text $this->monitor[$no_type]['text'][1].$de.$txt_extra;
 
$oracion['text'] = str_replace('_REP_'"<b>{$no_total}</b>"$text);
 }else 
$oracion['text'] = $this->monitor[$no_type]['text'][0].$txt_extra;
 
$voto_type = ($data['obj_dos'] == 0) ? 'negativo' 'positivo';
 
$oracion['text'] = str_replace('_REP_''<b>'.$voto_type.'</b>'$oracion['text']);
 
$oracion['style'] = 'voto_'.$voto_type;
 
$oracion['link'] = $site_url.'/videos/'.$data['user_name'].'/'.$data['vid_id'].'/'.$tsCore->setSEO($data['vid_title']).'.html';
 
$oracion['ltext'] = ($this->show_type == 1) ? $ln_text $data['vid_title'];
 
$oracion['ltit'] = ($this->show_type == 1) ? $data['vid_title'] : '';
   break;
 
// NOTI VIDEOS

            // PUBLICACION EN MURO
            
case 12:
                
$oracion['text'] = $this->monitor[$no_type]['text'].$txt_extra;
                
$oracion['link'] = $site_url.'/perfil/'.$tsUser->nick.'/'.$data['obj_uno'];
                
$oracion['ltext'] = ($this->show_type == 1) ? $ln_text $tsUser->nick;
                
$oracion['ltit'] = ($this->show_type == 1) ? $tsUser->nick '';
            break;
            case 
13:
                
// DE QUIEN?
                
if($tsUser->uid == $data['p_user']) {
                    
$de ' tu';
                }
                elseif(
$data['p_user'] == $data['p_user_resp']) {
                    
$de ' su'
                }
                else {
                    
$de ' la publicaci&oacute;n de';
                    
//$data['link'][1] = ($typeDos == 1) ?  array($array['p_user_name'], $array['p_user_name']) : $array['p_user_name'];   
                
}
                
// CUANTOS
                
$no_total $data['not_total'];
                if(
$no_total 1) {
                    
$text $this->monitor[$no_type]['text'][1].$de.$txt_extra;
                    
$oracion['text'] = str_replace('_REP_''<b>'.$no_total.'</b>'$text);
                }
                else 
$oracion['text'] = $this->monitor[$no_type]['text'][0].$de.$txt_extra;
                
//
                //$oracion['text'] = $this->monitor[$no_type]['text'].$de.$txt_extra;
                
$oracion['link'] = $site_url.'/perfil/'.$data['p_user_name'].'/'.$data['pub_id'];
                
$oracion['ltext'] = ($this->show_type == 1) ? $ln_text $tsUser->nick;
                
$oracion['ltit'] = ($this->show_type == 1) ? $tsUser->nick '';
            break;
            case 
14:
                
// CUANTOS
                
$no_total $data['not_total'];
                
// MAS DE UNA ACCION
                
if($no_total 1) {
                    
$text $this->monitor[$no_type]['text'][1].' '.$ln_text;
                    
$oracion['text'] = str_replace('_REP_''<b>'.$no_total.'</b>'$text);
                }
                else 
$oracion['text'] = $this->monitor[$no_type]['text'][0];
                
//
                
$oracion['text'] = ($this->show_type == 1) ? $oracion['text'] : $oracion['text'].' '.$ln_text;
                
$oracion['link'] = $site_url.'/perfil/'.$tsUser->nick.'/'.$data['obj_uno'];
                
$oracion['ltext'] = ($this->show_type == 1) ? $ln_text substr($data['c_body'],0,20).'...';
                
$oracion['ltit'] = ($this->show_type == 1) ? substr($data['c_body'],0,20).'...' '';
            break;
 case 
15:
                
$oracion['text'] = 'Recibiste una nueva <span class="qtip" title="'.$data['m_title'].'"><b>medalla</b> <img src="'.$site_url.'/themes/default/images/icons/med/'.$data['m_image'].'_16.png"/></span>';
 break;
 case 
16:
                
$oracion['text'] = 'Tu <a href="'.$site_url.'/posts/'.$data['c_seo'].'/'.$data['post_id'].'/'.$tsCore->setSEO($data['post_title']).'.html" title="'.$data['post_title'].'"><b>post</b></a> tiene una nueva <span class="qtip" title="'.$data['m_title'].'"><b>medalla</b> <img src="'.$site_url.'/themes/default/images/icons/med/'.$data['m_image'].'_16.png"/></span>';
 break;
 case 
17:
                
$oracion['text'] = 'Tu <a href="'.$site_url.'/fotos/'.$data['user_name'].'/'.$data['foto_id'].'/'.$tsCore->setSEO($data['f_title']).'.html" title="'.$data['f_title'].'"><b>foto</b></a> tiene una nueva <span class="qtip" title="'.$data['m_title'].'"><b>medalla</b> <img src="'.$site_url.'/themes/default/images/icons/med/'.$data['m_image'].'_16.png"/></span>';
 break;
 case 
20:
     
$oracion['text'] = 'Tu <a href="'.$site_url.'/videos/'.$data['user_name'].'/'.$data['vid_id'].'/'.$tsCore->setSEO($data['vid_title']).'.html" title="'.$data['vid_title'].'"><b>video</b></a> tiene una nueva <span class="qtip" title="'.$data['m_title'].'"><b>medalla</b> <img src="'.$site_url.'/themes/default/images/icons/med/'.$data['m_image'].'_16.png"/></span>';
            break;
        }
        
# RETORNAMOS
        
return $oracion;
    } 


Buscar:
 
Código PHP:
public function setSpam(){
 global 
$tsCore$tsUser$tsActividad;
 
//
 
$postid $_POST['postid'];
        
// TIENE SEGUIDORES?
 
$query db_exec(array(__FILE____LINE__), 'query''SELECT follow_id FROM u_follows WHERE f_id = \''.$tsUser->uid.'\'  AND f_type = \'1\' LIMIT 1');
        
$seguidores db_exec('num_rows'$query);
        
// YA LO HA RECOMENDADO?
 
$query db_exec(array(__FILE____LINE__), 'query''SELECT follow_id FROM u_follows WHERE f_id = \''.(int)$postid.'\' AND f_user = \''.$tsUser->uid.'\' AND f_type = \'3\' LIMIT 1');
        
$recomendado db_exec('num_rows'$query);
        
        if(
$seguidores 1) return '0-Debes tener al menos un seguidor';
        if(
$recomendado 0) return '0-No puedes recomendar el mismo post m&aacute;s de una vez.'
 
//
 
$query db_exec(array(__FILE____LINE__), 'query''SELECT post_user FROM p_posts WHERE post_id = \''.(int)$postid.'\' LIMIT 1');
 
$data db_exec('fetch_assoc'$query);
 
 
//
 
if($tsUser->uid != $data['post_user']){
            
// GUARDAMOS EN FOLLOWS PUES ES LA RECOMENDACION PARA SU SEGUIDORES! xD
 
db_exec(array(__FILE____LINE__), 'query''INSERT INTO u_follows (f_id, f_user, f_type, f_date) VALUES (\''.(int)$postid.'\', \''.$tsUser->uid.'\', \'3\', \''.time().'\') ');
 
// NOTIFICAR
 
if($this->setFollowNotificacion(61$tsUser->uid$postid)) {
                
$tsActividad->setActividad(4$postid);
                return 
'1-La recomendaci&oacute;n fue enviada.';
 }
 } else return 
'0-No puedes recomendar tus posts.';
 } 


Debajo agregar:
 
Código PHP:
/**
 * @name recomVid
 * @access public
 * @param none
 * @return string
 * @info ESTA FUNCION ES PARA REALIZAR RECOMENDACIONES EN VIDEOS OKSI
    */
    
public function recomVid(){
        global 
$tsCore$tsUser$tsActividad;
        
//
        
$videoid $_POST['videoid'];
     
// YA LO HA RECOMENDADO?
        
$query db_exec(array(__FILE____LINE__), 'query''SELECT follow_id FROM u_follows WHERE f_id = \''.(int)$videoid.'\' AND f_user = \''.$tsUser->uid.'\' AND f_type = \'3\' LIMIT 1');
     
$recomendado db_exec('num_rows'$query);

     if(
$recomendado 0) return '0-Ya haz recomendado este video.';
        
//
        
$query db_exec(array(__FILE____LINE__), 'query''SELECT vid_user FROM v_videos WHERE vid_id = \''.(int)$videoid.'\' LIMIT 1');
        
$data db_exec('fetch_assoc'$query);
 
        
//
        
if($tsUser->uid != $data['vid_user']){
    
// GUARDAMOS EN FOLLOWS PUES ES LA RECOMENDACION PARA SU SEGUIDORES! xD
           
db_exec(array(__FILE____LINE__), 'query''INSERT INTO u_follows (f_id, f_user, f_type, f_date) VALUES (\''.(int)$videoid.'\', \''.$tsUser->uid.'\', \'3\', \''.time().'\') ');
           
// NOTIFICAR
           
if($this->setFollowNotificacion(211$tsUser->uid$videoid)) {
    
$tsActividad->setActividad(4$postid);
    return 
'1-La recomendaci&oacute;n fue enviada.';
           }
       } else return 
'0-No puedes recomendar tus videos.';
    } 


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

Buscar:
 
Código PHP:
/*
        getTopUsers()
    */
    
function getTopUsers($fecha$cat){
        
//
        
$data $this->setTime($fecha);
        
$category = empty($cat) ? '' 'AND post_category = '.$cat;
 
// PUNTOS
        
$query db_exec(array(__FILE____LINE__), 'query''SELECT SUM(p.post_puntos) AS total, u.user_id, u.user_name FROM p_posts AS p LEFT JOIN u_miembros AS u ON p.post_user = u.user_id WHERE p.post_status = 0  AND p.post_date BETWEEN '.$data['start'].' AND '.$data['end'].' '.$category.' GROUP BY p.post_user ORDER BY total DESC LIMIT 10');
        
$array['puntos'] = result_array($query);
        
        
// SEGUIDORES
        
$query db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(f.follow_id) AS total, u.user_id, u.user_name FROM u_follows AS f LEFT JOIN u_miembros AS u ON f.f_id = u.user_id WHERE f.f_type = 1 AND f.f_date BETWEEN '.$data['start'].' AND '.$data['end'].' GROUP BY f.f_id ORDER BY total DESC LIMIT 10');
        
$array['seguidores'] = result_array($query);
        
 
// MEDALLAS
        
$query db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(m.medal_for) AS total, u.user_id, u.user_name, wm.medal_id FROM w_medallas_assign AS m LEFT JOIN u_miembros AS u ON m.medal_for = u.user_id LEFT JOIN w_medallas AS wm ON wm.medal_id = m.medal_id WHERE wm.m_type = \'1\' AND m.medal_date BETWEEN '.$data['start'].' AND '.$data['end'].' GROUP BY m.medal_for ORDER BY total DESC LIMIT 10');
        
$array['medallas'] = result_array($query);
        
        
//
        
return $array;
    } 


Debajo agregar:
 
Código PHP:
/*
 getTopVideos()
    */
    
function getTopVideos($fecha$desc){
 
//
 
$data $this->setTime($fecha);
 
$desc = empty($desc) ? '' 'AND vid_description = '.$desc;
     
// VOTOS POSITIVOS
 
$query db_exec(array(__FILE____LINE__), 'query''SELECT SUM(v.vid_votos_pos) AS total, u.user_id, u.user_name, vid_url, vid_user, vid_votos_pos, vid_title, vid_id FROM v_videos AS v LEFT JOIN u_miembros AS u ON v.vid_user = u.user_id WHERE v.vid_status = 0 AND v.vid_date BETWEEN '.$data['start'].' AND '.$data['end'].' '.$desc.' GROUP BY v.vid_user ORDER BY total DESC LIMIT 10');
 
$array['votos_pos'] = result_array($query);

     
// VOTOS NEGATIVOS
 
$query db_exec(array(__FILE____LINE__), 'query''SELECT SUM(v.vid_votos_neg) AS total, u.user_id, u.user_name, vid_url, vid_user, vid_votos_neg, vid_title, vid_id FROM v_videos AS v LEFT JOIN u_miembros AS u ON v.vid_user = u.user_id WHERE v.vid_status = 0 AND v.vid_date BETWEEN '.$data['start'].' AND '.$data['end'].' '.$desc.' GROUP BY v.vid_user ORDER BY total DESC LIMIT 10');
 
$array['votos_neg'] = result_array($query);

 
// VISITAS
 
$query db_exec(array(__FILE____LINE__), 'query''SELECT SUM(vid_visitas) AS total, u.user_id, u.user_name, vid_url, vid_user, vid_visitas, vid_title, vid_id FROM v_videos AS v LEFT JOIN u_miembros AS u ON v.vid_user = u.user_id WHERE v.vid_status = 0 AND v.vid_date BETWEEN '.$data['start'].' AND '.$data['end'].' '.$desc.' GROUP BY v.vid_user ORDER BY total DESC LIMIT 10');
 
$array['visitas'] = result_array($query);

     
// MEDALLAS
 
$query db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(m.medal_for) AS total, u.user_id, u.user_name, vid_url, vid_user, vid_title, vid_id, wm.medal_id FROM w_medallas_assign AS m LEFT JOIN v_videos AS v ON m.medal_for = v.vid_id LEFT JOIN u_miembros AS u ON v.vid_user = u.user_id LEFT JOIN w_medallas AS wm ON wm.medal_id = m.medal_id WHERE wm.m_type = \'4\' AND m.medal_date BETWEEN '.$data['start'].' AND '.$data['end'].' GROUP BY m.medal_for ORDER BY total DESC LIMIT 10');
 
$array['medallas'] = result_array($query);

 
//
 
return $array;
    } 


Buscar:
 
Código PHP:
/*
 getStats() : NADA QUE VER CON LA CLASE PERO BUENO PARA AHORRAR ESPACIO...
 : ESTADISTICAS DE LA WEB
 */
 
function getStats(){
 global 
$tsCore;
 
// 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\''));
        
        if(
$return['stats_time_cache'] < time()-($tsCore->settings['c_stats_cache']*60)){
        
$q1 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(user_id) AS u FROM u_miembros WHERE user_activo = \'1\' && user_baneado = \'0\''));
 
$q2 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(post_id) AS p FROM p_posts WHERE post_status = \'0\''));
        
$q3 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(foto_id) AS f FROM f_fotos WHERE f_status = \'0\''));
        
$q4 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(cid) AS c FROM p_comentarios WHERE c_status = \'0\''));
        
$q5 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(cid) AS fc FROM f_comentarios'));
        
        
$return['stats_miembros'] = $q1[0];
        
$return['stats_posts'] = $q2[0];
        
$return['stats_fotos'] = $q3[0];
        
$return['stats_comments'] = $q4[0];
        
$return['stats_foto_comments'] = $q5[0];
        
$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'].'\'';
        }
        
// PARA SABER SI ESTA ONLINE
 
$is_online = (time() - ($tsCore->settings['c_last_active'] * 60));
 
// USUARIOS ONLINE - COMPROBAMOS SI CONTAMOS A TODOS LOS USUARIOS O SOLO A REGISTRADOS
 
if(empty($tsCore->settings['c_count_guests'])){
 
$cueri db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(user_id) AS u FROM `u_miembros` WHERE `user_lastactive` > \''.$is_online.'\''));
 }else{
        
$cueri db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(DISTINCT `session_ip`) AS s FROM `u_sessions` WHERE `session_time` > \''.$is_online.'\''));
 }
        
 
$return['stats_online'] = $cueri[0];
        
        if(
$return['stats_online'] > $return['stats_max_online']) {
            
$timen ', stats_max_online = \''.$return['stats_online'].'\', stats_max_time = \''.time().'\'';
        }
            
        
db_exec(array(__FILE____LINE__), 'query''UPDATE w_stats SET stats_time = \''.time().'\' '.$ndat.' '.$timen);
 
//
 
return $return;
 } 


Reemplazar por:
 
Código PHP:
/*
 getStats() : NADA QUE VER CON LA CLASE PERO BUENO PARA AHORRAR ESPACIO...
 : ESTADISTICAS DE LA WEB
 */
 
function getStats(){
 global 
$tsCore;
 
// 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\''));
        
        if(
$return['stats_time_cache'] < time()-($tsCore->settings['c_stats_cache']*60)){
        
$q1 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(user_id) AS u FROM u_miembros WHERE user_activo = \'1\' && user_baneado = \'0\''));
 
$q2 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(post_id) AS p FROM p_posts WHERE post_status = \'0\''));
        
$q3 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(foto_id) AS f FROM f_fotos WHERE f_status = \'0\''));
        
$q4 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(cid) AS c FROM p_comentarios WHERE c_status = \'0\''));
        
$q5 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(cid) AS fc FROM f_comentarios'));
        
$q6 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(vid_id) AS v FROM v_videos WHERE vid_status = \'0\''));
        
$q7 db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(cid) AS vc FROM v_comentarios'));
 
        
$return['stats_miembros'] = $q1[0];
        
$return['stats_posts'] = $q2[0];
        
$return['stats_fotos'] = $q3[0];
        
$return['stats_comments'] = $q4[0];
        
$return['stats_foto_comments'] = $q5[0];
        
$return['stats_videos'] = $q6[0];
        
$return['stats_video_comments'] = $q7[0];

        
$ndat ', stats_time_cache = \''.time().'\', stats_miembros = \''.$return['stats_miembros'].'\', stats_posts = \''.$return['stats_posts'].'\', stats_fotos = \''.$return['stats_fotos'].'\' , stats_videos = \''.$return['stats_videos'].'\', stats_comments = \''.$return['stats_comments'].'\', stats_foto_comments = \''.$return['stats_foto_comments'].'\'';
        }
        
// PARA SABER SI ESTA ONLINE
 
$is_online = (time() - ($tsCore->settings['c_last_active'] * 60));
 
// USUARIOS ONLINE - COMPROBAMOS SI CONTAMOS A TODOS LOS USUARIOS O SOLO A REGISTRADOS
 
if(empty($tsCore->settings['c_count_guests'])){
 
$cueri db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(user_id) AS u FROM `u_miembros` WHERE `user_lastactive` > \''.$is_online.'\''));
 }else{
        
$cueri db_exec('fetch_row'db_exec(array(__FILE____LINE__), 'query''SELECT COUNT(DISTINCT `session_ip`) AS s FROM `u_sessions` WHERE `session_time` > \''.$is_online.'\''));
 }
        
 
$return['stats_online'] = $cueri[0];
        
        if(
$return['stats_online'] > $return['stats_max_online']) {
            
$timen ', stats_max_online = \''.$return['stats_online'].'\', stats_max_time = \''.time().'\'';
        }
            
        
db_exec(array(__FILE____LINE__), 'query''UPDATE w_stats SET stats_time = \''.time().'\' '.$ndat.' '.$timen);
 
//
 
return $return;
 } 


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

Buscar:
 
Código PHP:
// MENSAJES
            
case 'mensaje'


Arriba agregar:
 
Código PHP:
case 'video':
            
// ¿ES MI VIDEO O ESTÁ OCULTO?
          
$query db_exec(array(__FILE____LINE__), 'query''SELECT `vid_id`, `vid_user`, `vid_status` FROM `v_videos` WHERE `vid_id` = \''.(int)$obj_id.'\' LIMIT 1') or die(mysql_error());
          
$my_video db_exec('fetch_assoc'$query);

            if(empty(
$my_video['vid_id'])) return '0: Este video no existe';
            if(
$my_video['vid_user'] == $tsUser->uid) return '0: No puedes denunciar tus propios videos.';
            if(
$my_video['vid_status'] == '1') return '0: No puedes denunciar videos ocultos.';
            
// YA HA REPORTADO?
            
$query db_exec(array(__FILE____LINE__), 'query''SELECT `did` FROM `w_denuncias` WHERE `obj_id` = \''.(int)$obj_id.'\' AND `d_user` = '.$tsUser->uid.' AND `d_type` = \'5\'');
            
$denuncio db_exec('num_rows'$query);

            if(!empty(
$denuncio)) return '0: Ya habías denunciado este video.';
            
// CUANTAS DENUNCIAS LLEVA?
            
$denuncias db_exec('num_rows'db_exec(array(__FILE____LINE__), 'query''SELECT `did` FROM `w_denuncias` WHERE `obj_id` = \''.(int)$obj_id.'\''));
           
// OCULTAMOS EL VIDEO SI YA LLEVA MÁS DE 3 DENUNCIAS
           
if($denuncias >= 2){
               
db_exec(array(__FILE____LINE__), 'query''UPDATE `v_videos` SET `vid_status` = \'1\' WHERE `vid_id` = \''.(int)$obj_id.'\'') or die(mysql_error());
               
db_exec(array(__FILE____LINE__), 'query''UPDATE `w_stats` SET `stats_videos` = stats_videos - \'1\' WHERE `stats_no` = \'1\'');
           }
           
// INSERTAR NUEVA DENUNCIA
           
if(db_exec(array(__FILE____LINE__), 'query''INSERT INTO `w_denuncias` (`obj_id`, `d_user`, `d_razon`, `d_extra`, `d_type`, `d_date`) VALUES (\''.(int)$obj_id.'\', \''.$tsUser->uid.'\', \''.$razon.'\', \''.$extras.'\', \'5\', \''.$date.'\')')){
               return 
'1: La denuncia fue enviada.';
           } else return 
'0: Error, inténtalo más tarde.';
    
           break; 


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

Buscar:
 
Código PHP:
function getNovemods()
    {
        
$datos db_exec('fetch_assoc'db_exec(array(__FILE____LINE__), 'query''SELECT (SELECT count(post_id) FROM p_posts WHERE post_status = \'3\') as revposts, (SELECT count(cid) FROM p_comentarios WHERE c_status = \'1\' ) as revcomentarios, (SELECT count(DISTINCT obj_id) FROM w_denuncias WHERE d_type = \'1\') as repposts, (SELECT count(DISTINCT obj_id) FROM w_denuncias WHERE d_type = \'2\') as repmps, (SELECT count(DISTINCT obj_id) FROM w_denuncias WHERE d_type = \'3\') as repusers, (SELECT count(DISTINCT obj_id) FROM w_denuncias  WHERE d_type = \'4\') as repfotos, (SELECT count(susp_id) FROM u_suspension) as suspusers, (SELECT count(post_id) FROM p_posts WHERE post_status = \'2\') as pospelera, (SELECT count(foto_id) FROM f_fotos WHERE f_status = \'2\') as fospelera'));
 
$datos['total'] = $datos['repposts'] + $datos['repfotos'] + $datos['repmps'] + $datos['repusers'] + $datos['revposts'] + $datos['revcomentarios'];
 return 
$datos;  
 } 


Reemplazar por:
 
Código PHP:
function getNovemods()
    {
        
$datos db_exec('fetch_assoc'db_exec(array(__FILE____LINE__), 'query''SELECT (SELECT count(post_id) FROM p_posts WHERE post_status = \'3\') as revposts, (SELECT count(cid) FROM p_comentarios WHERE c_status = \'1\' ) as revcomentarios, (SELECT count(DISTINCT obj_id) FROM w_denuncias WHERE d_type = \'1\') as repposts, (SELECT count(DISTINCT obj_id) FROM w_denuncias WHERE d_type = \'2\') as repmps, (SELECT count(DISTINCT obj_id) FROM w_denuncias WHERE d_type = \'3\') as repusers, (SELECT count(DISTINCT obj_id) FROM w_denuncias  WHERE d_type = \'4\') as repfotos, (SELECT count(DISTINCT obj_id) FROM w_denuncias WHERE d_type = \'5\') as repvideos, (SELECT count(susp_id) FROM u_suspension) as suspusers, (SELECT count(post_id) FROM p_posts WHERE post_status = \'2\') as pospelera, (SELECT count(foto_id) FROM f_fotos WHERE f_status = \'2\') as fospelera, (SELECT count(vid_id) FROM v_videos WHERE vid_status = \'2\') as vispelera'));
 
$datos['total'] = $datos['repposts'] + $datos['repfotos'] + $datos['repvideos'] + $datos['repmps'] + $datos['repusers'] + $datos['revposts'] + $datos['revcomentarios'];
 return 
$datos;  
 } 


Agregado:
 
Código PHP:
(SELECT count(DISTINCT obj_idFROM w_denuncias WHERE d_type = \'5\') as repvideos, 
 
Código PHP:
, (SELECT count(vid_idFROM v_videos WHERE vid_status = \'2\') as vispelera 
 
Código PHP:
$datos['repvideos'


En admin.php --> inc --> php --> admin.php

Buscar:
 
Código PHP:
//FOTOS
 
} elseif($action == 'fotos'){
 if(!
$act) {
 
$smarty->assign("tsAdminFotos",$tsAdmin->GetAdminFotos());
 } 


Debajo agregar:
 
Código PHP:
//VIDEOS
    
} elseif($action == 'videos'){
         if(!
$act) {
         
$smarty->assign("tsAdminVideos",$tsAdmin->GetAdminVideos());
         } 


En moderacion.php --> inc --> php --> moderacion.php

Buscar:
 
Código PHP:
// SUSPENSIONES
    
elseif($action == 'banusers'){
        
$smarty->assign("tsSuspendidos",$tsMod->getSuspendidos());
    } 


Arriba agregar:
 
Código PHP:
elseif($action == 'videos'){
      include(
'../ext/datos.php');
      if(empty(
$act)){
      
$smarty->assign("tsReports",$tsMod->getDenuncias($action));
      
$smarty->assign("tsDenuncias",$tsDenuncias[$action]);
    }elseif(
$act == 'info'){
      
$smarty->assign("tsDenuncia",$tsMod->getDenuncia($action));
      
$smarty->assign("tsDenuncias",$tsDenuncias[$action]);
    }elseif (
$act == 'borrar'){
      
$tsMod->deleteVideo($vid_);
      
header('location: /moderacion/videos');
    }
    } 


Buscar:
 
Código PHP:
elseif($action == 'fopelera'){
        
$smarty->assign("tsFopelera",$tsMod->getFopelera());
    } 


Debajo agregar:
 
Código PHP:
elseif($action == 'vipelera'){
        
$smarty->assign("tsVipelera",$tsMod->getVipelera());
    } 


En tops.php --> inc --> php --> tops.php

Buscar:
 
Código PHP:
switch($action){
 case 
'posts':
 
$smarty->assign("tsTops",$tsTops->getTopPosts($fecha$cat));
 break;
            case 
'usuarios':
                
$smarty->assign("tsTops",$tsTops->getTopUsers($fecha$cat));
            break;
 } 


Debajo agregar:
 
Código PHP:
switch($action){
 case 
'posts':
 
$smarty->assign("tsTops",$tsTops->getTopPosts($fecha$cat));
 break;
 case 
'videos':
 
$smarty->assign("tsTops",$tsTops->getTopVideos($fecha$desc));
 break;
 case 
'fotos':
 
$smarty->assign("tsTops",$tsTops->getTopFotos($fecha$desc));
 break;
     case 
'usuarios':
 
$smarty->assign("tsTops",$tsTops->getTopUsers($fecha$cat));
     break;
        } 



En ajax.admin.php --> inc --> php --> ajax --> ajax.admin.php

Buscar:
 
Código PHP:
'admin-badwords-delete' => array('n' => 4'p' => ''), 


Debajo agregar:
 
Código PHP:
'admin-video-borrar' => array('n' => 4'p' => ''),
        
'admin-video-setOpenClosed' => array('n' => 4'p' => ''),
        
'admin-video-setShowHide' => array('n' => 4'p' => ''), 


Buscar:
 
Código PHP:
case 'admin-users-InActivo'


Arriba agregar:
 
Código PHP:
case 'admin-video-borrar':
            
//<---
     
echo $tsAdmin->DelVideo();
     
//--->
 
break;
 case 
'admin-video-setOpenClosed':
      
//<---
      
echo $tsAdmin->setOpenClosedVideo();
      
//--->
 
break;
 case 
'admin-video-setShowHide':
      
//<---
      
echo $tsAdmin->setShowHideVideo();
      
//--->
 
break; 


En ajax.denuncia.php --> inc --> php --> ajax --> ajax.denuncia.php

Buscar:
 
Código PHP:
'denuncia-usuario' => array('n' => 2'p' => 'form'), 


Debajo agregar:
 
Código PHP:
'denuncia-video' => array('n' => 2'p' => 'form'), 


Buscar:
 
Código PHP:
case 'denuncia-mensaje'


Arriba agregar:
 
Código PHP:
case 'denuncia-video':
 
// CREAR DENUNCIA
 
if($_POST['razon']){
 
$tsAjax 1;
 echo 
$tsSwat->setDenuncia($obj_id'video');
 
// FORMULARIO DE DENUNCIA
 
} else {
 
// VARS
 
$tsData = array(
 
'obj_id' => $obj_id,
 
'obj_title' => $tsCore->setSecure($_POST['obj_title']),
 
'obj_user' => $tsCore->setSecure($_POST['obj_user']),
 );
 
// DATOS
 
include("../ext/datos.php");
 
$smarty->assign("tsData",$tsData);
 
$smarty->assign("tsDenuncias",$tsDenuncias['videos']);
 }
 break; 


En ajax.moderacion.php --> inc --> php --> ajax --> ajax.moderacion.php

Buscar:
 
Código PHP:
'moderacion-mps' => array('n' => 3'p' => 'main'), 


Debajo agregar:
 
Código PHP:
'moderacion-videos' => array('n' => 3'p' => 'main'), 


Buscar:
 
Código PHP:
case 'moderacion-fotos'


Arriba agregar:
 
Código PHP:
case 'moderacion-videos':
 
//<--
 
$vid = (int)$_POST['vid'];
 
// ACCIONES SECUNDARIAS
 
switch($do){
     case 
'reboot':
             
$tsAjax 1;
             echo 
$tsMod->rebootVideo($_POST['id']);
     break;
 case 
'borrar':
 if(
$_POST['razon']){
             
$tsAjax 1;
             echo 
$tsMod->deleteVideo($vid);
 }else {
 include(
'../ext/datos.php');
 
$tsPage 'php_files/p.videos.mod';
 
$smarty->assign("tsDenuncias",$tsDenuncias['videos']);
 }
        break; 


En ajax.notificaciones.php inc --> php --> ajax --> ajax.notificaciones.php

Buscar:
 
Código PHP:
case 'unfollow':
 
// <--
 
echo $tsMonitor->setUnFollow();
 
// -->
 
break; 


Debajo agregar:
 
Código PHP:
case 'videor':
 
// <--
 
echo $tsMonitor->recomVid();
 
// -->
     
break; 


En ajax.perfil.php inc --> php --> ajax --> ajax.perfil.php

Buscar:
 
Código PHP:
'perfil-posts' => array('n' => 0'p' => 'posts'), 


Debajo agregar:
 
Código PHP:
'perfil-videos' => array('n' => 0'p' => 'videos'), 


Buscar:
 
Código PHP:
case 'perfil-posts':
            
//<---
            
$smarty->assign("tsGeneral",$tsCuenta->loadPosts($user_id));
            
//--->
        
break; 


Debajo agregar:
 
Código PHP:
case 'perfil-videos':
      
//<---
      
$smarty->assign("tsGeneral",$tsCuenta->loadVideos($user_id));
     
//--->
     
break; 


En datos.php --> inc --> ext --> datos.php

Buscar:
 
Código PHP:
'fotos' => array( 


Arriba agregar:
 
Código PHP:
'videos' => array(
           
'',
    
'Ya está publicado',
    
'Se hace Spam',
    
'El video no anda',
    
'Es racista o irrespetuosa',
    
'Contiene información personal',
    
'Contiene pedofilia',
    
'Es gore o asquerosa',
    
'Otra razón (especificar)'
      
), 


En acciones.js --> themes --> default --> js --> acciones.js

Buscar:
 
Código PHP:
spamPostHandle: function (r) {
 var 
r.split('-');
 if (
x.length == 2mydialog.alert('Notificaciones'x[1]);
 else 
mydialog.close();
 }, 


Debajo agregar:
 
Código PHP:
VideoHandle: function (r) {
       var 
r.split('-');
       if (
x.length == 2mydialog.alert('Notificaciones'x[1]);
       else 
mydialog.close();
    },
 
VideoHandle: function (r) {
       var 
r.split('-');
       if (
x.length == 2mydialog.alert('Notificaciones'x[1]);
       else 
mydialog.close();
    }, 


Buscar:
 
Código PHP:
spam: function (idcb) {
 
this.ajax(Array('action=spam''postid='+id), cb);
 }, 


Debajo agregar:
 
Código PHP:
videor: function (idcb) {
 
this.ajax(Array('action=videor''videoid='+id), cb);
 }, 


Buscar:
 
Código PHP:
sharePost: function (id) {
 
mydialog.show();
 
mydialog.title('Recomendar');
 
mydialog.body('¿Quieres recomendar este post a tus seguidores?');
 
mydialog.buttons(truetrue'Recomendar''notifica.spam('+id+', notifica.spamPostHandle)'truetruetrue'Cancelar''close'truefalse);
 
mydialog.center();
 }, 


Debajo agregar:
 
Código PHP:
shareVideo: function (id) {
 
mydialog.show();
 
mydialog.title('Recomendar');
 
mydialog.body('¿Quieres recomendar este video a tus seguidores?');
 
mydialog.buttons(truetrue'Recomendar''notifica.videor('+id+', notifica.VideoHandle)'truetruetrue'Cancelar''close'truefalse);
 
mydialog.center();
 }, 


Buscar:
 
Código PHP:
case 'fotoid':
 if(
global_data.fotoid!='')
 return 
r+global_data.fotoid;
 break; 


Debajo agregar:
 
Código PHP:
case 'videoid':
           if(
global_data.videoid!='')
               return 
r+global_data.videoid;
           break; 


En admin.js --> themes --> default --> js --> admin.js

Buscar:
 
Código PHP:
medallas : {
     
borrar:function(midgew){ 


Arriba agregar:
 
Código PHP:
videos : {
borrar:function(vidgew){
if(!
gew){
mydialog.show();
mydialog.title('Borrar Video');
mydialog.body('&amp;#191;Quiere borrar este video permanentemente?');
mydialog.buttons(truetrue'Sí''admin.videos.borrar(' vid ', 1)'truefalsetrue'No''close'truetrue);
mydialog.center();
}else{
$(
'#loading').fadeIn(250);
$.
post(global_data.url '/admin-video-borrar.php''vid_id=' vid, function(a){
mydialog.alert((a.charAt(0) == '0' 'Opps!' 'Hecho'), a.substring(3), false);
mydialog.center();
success: $('#video_' vid).fadeOut(); $('#loading').fadeOut(350);
});
}
},

setOpenClosed:function(vid){
$(
'#loading').fadeIn(250);
$.
ajax({
type'POST',
urlglobal_data.url +'/admin-video-setOpenClosed.php',
data'vid=' vid,
success: function(h){
switch(
h.charAt(0)){
case 
'0'//Error
mydialog.alert('Error'h.substring(3));
break;
case 
'1':
//
$('#comments_video_' vid).html('<font color="red">Cerrados</font>');
break;
case 
'2':
//
$('#comments_video_' vid).html('<font color="green">Abiertos</font>');
break;
}
$(
'#loading').fadeOut(350);
}
});
},

setShowHide:function(vid){
$(
'#loading').fadeIn(250);
$.
ajax({
type'POST',
urlglobal_data.url +'/admin-video-setShowHide.php',
data'vid=' vid,
success: function(h){
switch(
h.charAt(0)){
case 
'0'//Error
mydialog.alert('Error'h.substring(3));
break;
case 
'1':
//
$('#status_video_' vid).html('<font color="purple">Oculto</font>');
break;
case 
'2':
//
$('#status_video_' vid).html('<font color="green">Visible</font>');
break;
}
$(
'#loading').fadeOut(350);
}
});
},
}, 


En moderacion.js --> themes --> default --> js --> moderacion.js

Buscar:
 
Código PHP:
users: { 


Arriba agregar:
 
Código PHP:
videos : {
// BORRAR
borrar:function(vidredirectaceptar){
if(!
aceptar){
$.
ajax({
type'POST',
urlglobal_data.url '/moderacion-videos.php?do=borrar',
success: function(h){
mydialog.show();
mydialog.title('Borrar Video');
mydialog.body(h);
mydialog.buttons(truetrue'Borrar''mod.videos.borrar(' vid ", '" redirect "', 1);"truefalsetrue'Cancelar''close'truetrue);
$(
'#modalBody').css('padding''20px 10px 0');
mydialog.center();
return;
}
});

} else {
mydialog.procesando_inicio('Eliminando...''Borrar Video');
var 
razon = $('#razon').val()
var 
razon_desc = $('input[name=razon_desc]').val();
$(
'#loading').fadeIn(250);
$.
ajax({
type'POST',
urlglobal_data.url '/moderacion-videos.php?do=borrar',
data'vid=' vid '&amp;razon=' razon '&amp;razon_desc=' razon_desc,
success: function(h){
switch(
h.charAt(0)){
case 
'0'//Error
mydialog.alert('Error'h.substring(3));
break;
case 
'1':
if(
redirect == 'true'mod.redirect("/moderacion/videos"1200);
else if(
redirect == 'videos') {
mydialog.alert('Aviso'h.substring(3));
mod.redirect("/videos/"2000);
}
else {
mydialog.close();
$(
'#report_' vid).slideUp();
}
break;
}
$(
'#loading').fadeOut(350);
},
complete: function(){
mydialog.procesando_fin();
$(
'#loading').fadeOut(350);
}
});
}
},
}, 


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

Buscar:
 
Código PHP:
{elseif $tsAction == 'usuarios'}
                {include 
file='modules/m.top_users.tpl'


Debajo agregar:
 
Código PHP:
{elseif $tsAction == 'videos'}
     {include 
file='modules/m.top_videos.tpl'


En p.denuncia.form.tpl --> themes --> default --> templates --> t.php_files --> p.denuncia.form.tpl

Buscar:
 
Código PHP:
{elseif $tsAction == 'denuncia-mensaje'


Arriba agregar:
 
Código PHP:
{elseif $tsAction == 'denuncia-video'}
<
div align="center" style="padding:10px 10px 0">
 <
b>Denunciar video:</b><br />
 {
$tsData.obj_title}<br /><br />
 <
b>Razón de la denuncia:</b><br />
 <
select name="razon">
 {foreach 
from=$tsDenuncias key=i item=denuncia}
     {if 
$denuncia}<option value="{$i}">{$denuncia}</option>{/if}
 {/foreach}
 </
select><br />
 <
b>Aclaración y comentarios:</b><br />
 <
textarea tabindex="6" rows="5" cols="40" name="extras"><textarea><br />
 <
span class="size9">Para atender tu caso rápidamenteadjunta pruebas de tu denuncia.<br /> (capturas de pantalla)</span>
</
div


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

Buscar:
 
Código PHP:
{if $tsInfo.visitas}
            <
ul class="clearfix">
                                {foreach 
from=$tsInfo.visitas item=v}
            <
li><a href="{$tsConfig.url}/perfil/{$v.user_name}class="hovercard" uid="{$v.user_id}style="display:inline-block;"><img src="{$tsConfig.url}/files/avatar/{$v.user_id}_50.jpg" class="vctip" title="{$v.date|hace:true}width="32" height="32"/></a></li>
                                {/foreach}
            </
ul>
                            {else}
                            <
div class="emptyData">No tiene visitas</div>
                            {/if}
            </
div>
 {/if} 


Debajo agregar:
 
Código PHP:
<div class="widget w-medallas clearfix">
      <
div class="title-w clearfix">
    <
h3>Videos</h3>
                    <
span>{$tsInfo.stats.user_videos}</span>
      </
div>
                      <
ul class="clearfix">
 {foreach 
from=$tsGeneral.videos item=v key=i}
 {if 
$v.vid_id}<a href="{$tsConfig.url}/videos/{$tsInfo.nick}/{$v.vid_id}/{$v.vid_title|seo}.html">
 <
img class=qtip title="{$v.vid_title}src="Registrate o inicia tu sesión para ver este contenido{$v.vid_url}/1.jpg" width="50" height="50">{else}
 <
li><div class="foto"></div></li>{/if}
 {/foreach}
 </
ul>
 </
div



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

Buscar:
 
Código PHP:
<li><a href="#" onclick="perfil.load_tab('medallas', this); return false">Medallas</a></li



Debajo agregar:
 
Código PHP:
<li><a href="#" onclick="perfil.load_tab('videos', this); return false">Videos</a></li



Buscar:
 
Código PHP:
<li>
                <
strong>{$tsInfo.stats.user_fotos}</strong>
                <
span>Fotos</span>
                </
li


Debajo agregar:
 
Código PHP:
<li style="float: right;">
                                    <
strong>{$tsInfo.stats.user_videos}</strong>
                                    <
span>Videos</span>
                                </
li



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

Buscar:
 
Código PHP:
fotoid:'{$tsFoto.foto_id}'


Debajo agregar:
 
Código PHP:
videoid:'{$tsVideo.vid_id}'


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

Buscar:
 
Código PHP:
{if $tsConfig.c_fotos_private == '1' && !$tsUser->is_member}{else} 
                <
li class="tabbed {if $tsPage == 'fotos'}here{/if}" id="tabbedfotos">
                    <
a title="Ir a Fotos" onclick="menu('fotos', this.href); return false;" href="{$tsConfig.url}/fotos/">Fotos <img alt="Drop Down" src="{$tsConfig.tema.t_url}/images/arrowdown.png"></a>
                </
li
 {/if} 


Debajo agregar:
 
Código PHP:
<li class="tabbed {if $tsPage == 'videos'}here{/if}" id="tabbedvideos">
                    <
a title="Ir a Videos" onclick="menu('videos', this.href); return false;" href="{$tsConfig.url}/videos/">Videos <img alt="Drop Down" src="{$tsConfig.tema.t_url}/images/arrowdown.png"></a>
                </
li


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

Buscar:
 
Código PHP:
<div id="subMenuTops" class="subMenu {if $tsPage == 'tops'}here{/if}"


Arriba agregar:
 
Código PHP:
<div id="subMenuVideos" class="subMenu {if $tsPage == 'videos'}here{/if}">
                <
ul class="floatL tabsMenu">
                    <
li{if $tsAction == '' && $tsAction != 'agregar' && $tsAction != 'album' && $tsAction != 'favoritas' || $tsAction == 'ver'} class="here"{/if}><a href="{$tsConfig.url}/videos/">Inicio</a></li>
                    {if 
$tsAction == 'album' && $tsVUser.0 != $tsUser->uid}<li class="here"><a href="{$tsConfig.url}/videos/{$tsVUser.1}">&Aacute;lbum de {$tsVUser.1}</a></li>{/if}
                    {if 
$tsUser->is_admod}<li{if $tsAction == 'agregar'} class="here"{/if}><a href="{$tsConfig.url}/videos/agregar/">Agregar Video</a></li>{/if}
                   {if 
$tsUser->is_member} <li{if $tsAction == 'album' && $tsVUser.0 == $tsUser->uid} class="here"{/if}><a href="{$tsConfig.url}/videos/album/{$tsUser->nick}">Mis Videos</a></li>{/if}
                    <
li><a href="{$tsConfig.url}/buscadorv/">Buscador</a></li>
               </
ul>
                <
div class="clearBoth"></div>
            </
div


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

Buscar:
 
Código PHP:
{elseif $tsAction == 'afs'}
                            {include 
file='admin_mods/m.admin_afiliados.tpl'


Arriba agregar:
 
Código PHP:
{elseif $tsAction == 'videos'}
                                {include 
file='admin_mods/m.admin_videos.tpl'


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

Buscar:
 
Código PHP:
{elseif $tsAction == 'fotos'}
                            {include 
file='admin_mods/m.mod_report_fotos.tpl'



Debajo agregar:
 
Código PHP:
{elseif $tsAction == 'videos'}
                                {include 
file='admin_mods/m.mod_report_videos.tpl'



Buscar:
 
Código PHP:
{elseif $tsAction == 'fopelera'}
                                {if 
$tsUser->is_admod || $tsUser->permisos.morf}{include file='admin_mods/m.mod_papelera_fotos.tpl'}{/if} 



Debajo agregar:
 
Código PHP:
{elseif $tsAction == 'vipelera'}
                                {if 
$tsUser->is_admod}{include file='admin_mods/m.mod_papelera_videos.tpl'}{/if} 



En m.admin_sidemenu.tpl --> themes --> default --> templates --> admin_mods --> m.admin_sidemenu.tpl

Buscar:
 
Código PHP:
<li id="a_cats"><span class="cat-title"><a href="{$tsConfig.url}/admin/cats">Categor&iacute;as</a></span></li



Debajo agregar:
 
Código PHP:
<li id="a_film"><span class="cat-title"><a href="{$tsConfig.url}/admin/videos">Todos los Videos</a></span></li



En m.mod_sidemenu.tpl --> themes --> default --> templates --> admin_mods --> m.mod_sidemenu.tpl

Buscar:
 
Código PHP:
<li id="a_users"><span class="cat-title"><a onclick="$('#a_users').addClass('active');" href="{$tsConfig.url}/moderacion/users">Usuarios <span class="cadGe cadGe_{if $tsConfig.novemods.repusers > 15}red{elseif $tsConfig.novemods.repusers > 5}purple{else}green{/if}">{$tsConfig.novemods.repusers}</span></a></span></li



Debajo agregar:
 
Código PHP:
<li id="a_film"><span class="cat-title"><a onclick="$('#a_film').addClass('active');" href="{$tsConfig.url}/moderacion/videos">Videos <span class="cadGe cadGe_{if $tsConfig.novemods.repvideos > 15}red{elseif $tsConfig.novemods.repvideos > 5}purple{else}green{/if}">{$tsConfig.novemods.repvideos}</span></a></span></li


Buscar:
 
Código PHP:
{if $tsUser->is_admod || $tsUser->permisos.morf}<li id="a_fopelera"><span class="cat-title"><a onclick="$('#a_fopelera').addClass('active');" href="{$tsConfig.url}/moderacion/fopelera">Fotos eliminadas <span class="cadGe cadGe_{if $tsConfig.novemods.fospelera > 15}red{elseif $tsConfig.novemods.fospelera > 5}purple{else}green{/if}">{$tsConfig.novemods.fospelera}</span></a></span></li>{/if} 


Debajo agregar:
 
Código PHP:
{if $tsUser->is_admod}<li id="a_vipelera"><span class="cat-title"><a onclick="$('#a_vipelera').addClass('active');" href="{$tsConfig.url}/moderacion/vipelera">Videos eliminados <span class="cadGe cadGe_{if $tsConfig.novemods.vispelera > 15}red{elseif $tsConfig.novemods.vispelera > 5}purple{else}green{/if}">{$tsConfig.novemods.vispelera}</span></a></span></li>{/if} 


En admin.css --> themes --> default --> css --> admin.css

Buscar:
 
Código PHP:
li#a_badwords {background-image: url(../images/icons/stop.png);} 


Debajo agregar:
 
Código PHP:
li#a_film {background-image: url(../images/film.png);} 


En moderacion.css --> themes --> default --> css --> moderacion.css

Buscar:
 
Código PHP:
li#a_revposts {background-image: url(../images/icons/exclamation.png);} 


Debajo agregar:
 
Código PHP:
li#a_vipelera {background-image: url(../images/film.png);}
li#a_film {background-image: url(../images/film.png);} 


En .htaccess

Buscar:
 
Código PHP:
# ADMIN 


Arriba agregar:
 
Código PHP:
# VIDEOS
RewriteRule ^videos/([A-Za-z0-9_-]+).phpinc/php/videos.php?action=$[QSA,L]
RewriteRule ^videos/album/([A-Za-z0-9_-]+)$ inc/php/videos.php?action=album&user=$[QSA,L]
RewriteRule ^videos/album/([A-Za-z0-9_-]+)/([0-9]+)$ inc/php/videos.php?action=album&user=$1&page=$[QSA,L]
RewriteRule ^videos/([A-Za-z0-9_-]+)/([0-9]+)/([A-Za-z0-9_-]+).htmlinc/php/videos.php?action=ver&user=$1&vid=$[QSA,L]
RewriteRule ^admin/videos/([A-Za-z0-9_-]+)/([0-9]+)$ inc/php/admin.php?action=videos&act=$1&vid=$[QSA,L]
RewriteRule ^videos/([A-Za-z0-9_-]+)/([0-9]+)$ inc/php/videos.php?action=$1&id=$[QSA,L



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


Archivos de la demo editados funcionando.

Mega
Debes agradecer para ver el contenido...

Google Drive
Debes agradecer para ver el contenido...

Mediafire
Debes agradecer para ver el contenido...


Demo
http://Registrate o inicia tu sesión par... contenido



Actualizado por: Tronlar

Creditos:

Nico

aperpen
Gracias
Buen complemento, gracias.
Gracias, vale para el tema V7?
(12-02-2023, 12:47 PM)Lalo24 escribió: [ -> ]Gracias, vale para el tema V7?

Hola, si vale, lo que cambia es el diseño, hay que adaptárselo.
Lo voy a probar gracias
Me salió este error al querer borrar un video de un usuario novato, yo (siendo administrador). lo instalé en la v6 dark

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

(04-08-2024, 05:02 PM)moyo escribió: [ -> ]Me salió este error al querer borrar un video de un usuario novato, yo (siendo administrador). lo instalé en la v6 dark

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


Sigo intentando 98
(04-08-2024, 05:02 PM)moyo escribió: [ -> ]....
Ya lo solucioné 98

Y esta fue esa solución? Ya que en el paso de ajax.moderacion.php no esta cerrado el switch y el case
Código PHP:
case 'moderacion-videos':
    
$vid = (int)$_POST['vid'];
    
// ACCIONES SECUNDARIAS
    
switch($do){
       case 
'reboot':
          
$tsAjax 1;
          echo 
$tsMod->rebootVideo($_POST['id']);
       break;
        case 
'borrar':
            if(isset(
$_POST['razon'])) {
             
$tsAjax 1;
             echo 
$tsMod->deleteVideo($vid);
            } else {
                include(
'../ext/datos.php');
                
$tsPage 'php_files/p.videos.mod';
                
$smarty->assign("tsDenuncias",$tsDenuncias['videos']);
            }
      break; 
   } 
/* Falto cerrar aquí */
break; /* Falto cerrar aquí */ 
(04-09-2024, 12:13 AM)Miguel92 escribió: [ -> ]
(04-08-2024, 05:02 PM)moyo escribió: [ -> ]....
Ya lo solucioné 98

Y esta fue esa solución? Ya que en el paso de ajax.moderacion.php no esta cerrado el switch y el case
Código PHP:
case 'moderacion-videos':
    
$vid = (int)$_POST['vid'];
    
// ACCIONES SECUNDARIAS
    
switch($do){
       case 
'reboot':
          
$tsAjax 1;
          echo 
$tsMod->rebootVideo($_POST['id']);
       break;
        case 
'borrar':
            if(isset(
$_POST['razon'])) {
             
$tsAjax 1;
             echo 
$tsMod->deleteVideo($vid);
            } else {
                include(
'../ext/datos.php');
                
$tsPage 'php_files/p.videos.mod';
                
$smarty->assign("tsDenuncias",$tsDenuncias['videos']);
            }
      break; 
   } 
/* Falto cerrar aquí */
break; /* Falto cerrar aquí */ 

La verdad que no lo he solucionado, el propio usuario novato que sube su video si lo puede borrar, pero yo siendo (administrador) no puedo borrar su video y me salía el error que puse en el mensaje anterior.

Ahora que pusiste la solución, el código lo agregué en ajax.moderacion.php  y ahora aparece bien el modal pero sigue sin eliminarlo, paso captura:  
[img]Registrate o inicia tu sesión para ver este contenido[/img]