Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

Recommended Posts

Hola gente! ;)

A raíz de estos maravillosos complementos...

 

Tronlar:

 

Vzlawarez:

Se me ocurrió la idea de incluir dicha modificación directamente en el editor de post (tal como lo sugirió Tronlar aqui):

Pero claro,yo nose como hacerlo,asi que como propuso albert2227...

 

Hice este post con la esperanza q alguien pueda ayudarnos con eso,pienso q sería genial,bueno eso es todo,saludos y gracias ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By Tronlar
      Hola a [email protected], os dejo el mod de videos actualizado a 1.3 y fixeado, lo he probado en el tema default de risus pero tiene que funcionar en cualquier tema, lo que cambia es el diseño, más tarde lo dejo adaptado al diseño de la V5 y V6.
       
      Ver Demo
       

       

       

       

       

       
      Ejecutar estas consultas
       
      CREATE TABLE IF NOT EXISTS `v_videos` ( `vid_id` int(11) NOT NULL AUTO_INCREMENT, `vid_title` varchar(40) NOT NULL, `vid_date` int(10) NOT NULL, `vid_description` text NOT NULL, `vid_url` varchar(200) NOT NULL, `vid_user` int(11) NOT NULL, `vid_closed` int(1) NOT NULL DEFAULT '0', `vid_visitas` int(1) NOT NULL DEFAULT '0', `vid_votos_pos` int(3) NOT NULL DEFAULT '0', `vid_votos_neg` int(3) NOT NULL DEFAULT '0', `vid_status` int(1) NOT NULL DEFAULT '0', `vid_last` int(1) NOT NULL DEFAULT '0', `vid_hits` int(11) NOT NULL DEFAULT '0', `vid_ip` varchar(15) NOT NULL DEFAULT '0', PRIMARY KEY (`vid_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1; CREATE TABLE IF NOT EXISTS `v_comentarios` ( `cid` int(11) NOT NULL AUTO_INCREMENT, `c_vid_id` int(11) NOT NULL, `c_user` int(11) NOT NULL, `c_date` int(10) NOT NULL, `c_body` text NOT NULL, `c_ip` varchar(15) NOT NULL, PRIMARY KEY (`cid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS `v_votos` ( `vid` int(11) NOT NULL AUTO_INCREMENT, `v_vid_id` int(11) NOT NULL, `v_user` int(11) NOT NULL, `v_type` int(1) NOT NULL, `v_date` int(11) NOT NULL, PRIMARY KEY (`vid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; ALTER TABLE `w_medallas` ADD `m_cond_video` INT( 11 ) NOT NULL; ALTER TABLE `w_medallas` ADD `m_cond_video` INT( 11 ) NOT NULL; ALTER TABLE `w_stats` ADD `stats_video_comments` INT NOT NULL; ALTER TABLE `w_stats` ADD `stats_video_comments` INT NOT NULL;  
      En c.admin.php --> inc --> class --> c.admin.php
       
      Buscar:
      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:
      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:
      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:
      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:
      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:
      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:
      $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 == 1 ? '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:
      $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 == 1 ? '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:
      // $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 == 1 ? '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:
      $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 == 1 ? '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:
      /** * @name deletePost($pid) * @access public * @param int * @return string */ Arriba agregar:
      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:
      /** * @name setSticky * @access public * @param $post_id * @return string * @info Pone sticky un post */ Arriba agregar:
      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', $aviso, 1); // } // 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:
      } public function getPospelera() { Arriba agregar:
      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:
      public function getComentariosD() { Arriba agregar:
      public function getVipelera() { global $tsUser, $tsCore; // $max = 20; // MAXIMO A MOSTRAR $limit = $tsCore->setPageLimit($max, true); // 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:
      $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:
      $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); Buscar:
      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:
      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:
      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:
      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:
      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:
      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:
      // 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:
      u.user_posts, Agregar:
      u.user_videos, Buscar:
      $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:
      $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:
      $data['stats']['user_comentarios'] = $q3[0]; Debajo agregar:
      $data['stats']['user_videos'] = $q4[0]; Buscar:
      $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:
      $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:
      // 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:
      // 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:
      /* 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:
      /* 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:
      private function makeMonitor(){ $this->monitor = array( 1 => array('text' => 'agreg&oacute; a favoritos tu', 'ln_text' => 'post', 'css' => 'star'), 2 => array('text' => array('coment&oacute; tu','_REP_ nuevos comentarios en tu'), 'ln_text' => 'post', 'css' => 'comment_post'), 3 => array('text' => 'dej&oacute; _REP_ puntos en tu', 'ln_text' => 'post', 'css' => 'points'), 4 => array('text' => 'te est&aacute; siguiendo', 'ln_text' => 'Seguir a este usuario', 'css' => 'follow'), 5 => array('text' => 'cre&oacute; un nuevo', 'ln_text' => 'post', 'css' => 'post'), 6 => array('text' => array('te recomienda un', '_REP_ usuarios te recomiendan un'), 'ln_text' => 'post', 'css' => 'share'), 7 => array('text' => array('coment&oacute; en un', '_REP_ nuevos comentarios en el'), 'ln_text' => 'post', 'extra' => 'que sigues', 'css' => 'blue_ball'), 8 => array('text' => array('vot&oacute; _REP_ tu', '_REP_ nuevos votos a tu'), 'ln_text' => 'comentario', 'css' => 'voto_'), 9 => 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:
      private function makeMonitor(){ $this->monitor = array( 1 => array('text' => 'agreg&oacute; a favoritos tu', 'ln_text' => 'post', 'css' => 'star'), 2 => array('text' => array('coment&oacute; tu','_REP_ nuevos comentarios en tu'), 'ln_text' => 'post', 'css' => 'comment_post'), 3 => array('text' => 'dej&oacute; _REP_ puntos en tu', 'ln_text' => 'post', 'css' => 'points'), 4 => array('text' => 'te est&aacute; siguiendo', 'ln_text' => 'Seguir a este usuario', 'css' => 'follow'), 5 => array('text' => 'cre&oacute; un nuevo', 'ln_text' => 'post', 'css' => 'post'), 6 => array('text' => array('te recomienda un', '_REP_ usuarios te recomiendan un'), 'ln_text' => 'post', 'css' => 'share'), 7 => array('text' => array('coment&oacute; en un', '_REP_ nuevos comentarios en el'), 'ln_text' => 'post', 'extra' => 'que sigues', 'css' => 'blue_ball'), 8 => array('text' => array('vot&oacute; _REP_ tu', '_REP_ nuevos votos a tu'), 'ln_text' => 'comentario', 'css' => 'voto_'), 9 => 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:
      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:
      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:
      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 == 8 || $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:
      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 == 8 || $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:
      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(6, 1, $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:
      /** * @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(21, 1, $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:
      /* 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:
      /* 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:
      /* 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:
      /* 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:
      // MENSAJES case 'mensaje': Arriba agregar:
      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:
      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:
      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; } En admin.php --> inc --> php --> admin.php
       
      Buscar:
      //FOTOS } elseif($action == 'fotos'){ if(!$act) { $smarty->assign("tsAdminFotos",$tsAdmin->GetAdminFotos()); } Debajo agregar:
      //VIDEOS } elseif($action == 'videos'){ if(!$act) { $smarty->assign("tsAdminVideos",$tsAdmin->GetAdminVideos()); } En moderacion.php --> inc --> php --> moderacion.php
       
      Buscar:
      // SUSPENSIONES elseif($action == 'banusers'){ $smarty->assign("tsSuspendidos",$tsMod->getSuspendidos()); } Arriba agregar:
      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:
      elseif($action == 'fopelera'){ $smarty->assign("tsFopelera",$tsMod->getFopelera()); } Debajo agregar:
      elseif($action == 'vipelera'){ $smarty->assign("tsVipelera",$tsMod->getVipelera()); } En tops.php --> inc --> php --> tops.php
       
      Buscar:
      switch($action){ case 'posts': $smarty->assign("tsTops",$tsTops->getTopPosts($fecha, $cat)); break; case 'usuarios': $smarty->assign("tsTops",$tsTops->getTopUsers($fecha, $cat)); break; } Debajo agregar:
      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:
      'admin-badwords-delete' => array('n' => 4, 'p' => ''), Debajo agregar:
      'admin-video-borrar' => array('n' => 4, 'p' => ''), 'admin-video-setOpenClosed' => array('n' => 4, 'p' => ''), 'admin-video-setShowHide' => array('n' => 4, 'p' => ''), Buscar:
      case 'admin-users-InActivo': Arriba agregar:
      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:
      'denuncia-usuario' => array('n' => 2, 'p' => 'form'), Debajo agregar:
      'denuncia-video' => array('n' => 2, 'p' => 'form'), Buscar:
      case 'denuncia-mensaje': Arriba agregar:
      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:
      'moderacion-mps' => array('n' => 3, 'p' => 'main'), Debajo agregar:
      'moderacion-videos' => array('n' => 3, 'p' => 'main'), Buscar:
      case 'moderacion-fotos': Arriba agregar:
      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:
      case 'unfollow': // <-- echo $tsMonitor->setUnFollow(); // --> break; Debajo agregar:
      case 'videor': // <-- echo $tsMonitor->recomVid(); // --> break; En ajax.perfil.php inc --> php --> ajax --> ajax.perfil.php
       
      Buscar:
      'perfil-posts' => array('n' => 0, 'p' => 'posts'), Debajo agregar:
      'perfil-videos' => array('n' => 0, 'p' => 'videos'), Buscar:
      case 'perfil-posts': //<--- $smarty->assign("tsGeneral",$tsCuenta->loadPosts($user_id)); //---> break; Debajo agregar:
      case 'perfil-videos': //<--- $smarty->assign("tsGeneral",$tsCuenta->loadVideos($user_id)); //---> break; En datos.php --> inc --> ext --> datos.php
       
      Buscar:
      'fotos' => array( Arriba agregar:
      '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:
      spamPostHandle: function (r) { var x = r.split('-'); if (x.length == 2) mydialog.alert('Notificaciones', x[1]); else mydialog.close(); }, Debajo agregar:
      VideoHandle: function (r) { var x = r.split('-'); if (x.length == 2) mydialog.alert('Notificaciones', x[1]); else mydialog.close(); }, VideoHandle: function (r) { var x = r.split('-'); if (x.length == 2) mydialog.alert('Notificaciones', x[1]); else mydialog.close(); }, Buscar:
      spam: function (id, cb) { this.ajax(Array('action=spam', 'postid='+id), cb); }, Debajo agregar:
      videor: function (id, cb) { this.ajax(Array('action=videor', 'videoid='+id), cb); }, Buscar:
      sharePost: function (id) { mydialog.show(); mydialog.title('Recomendar'); mydialog.body('¿Quieres recomendar este post a tus seguidores?'); mydialog.buttons(true, true, 'Recomendar', 'notifica.spam('+id+', notifica.spamPostHandle)', true, true, true, 'Cancelar', 'close', true, false); mydialog.center(); }, Debajo agregar:
      shareVideo: function (id) { mydialog.show(); mydialog.title('Recomendar'); mydialog.body('¿Quieres recomendar este video a tus seguidores?'); mydialog.buttons(true, true, 'Recomendar', 'notifica.videor('+id+', notifica.VideoHandle)', true, true, true, 'Cancelar', 'close', true, false); mydialog.center(); }, Buscar:
      case 'fotoid': if(global_data.fotoid!='') return r+global_data.fotoid; break; Debajo agregar:
      case 'videoid': if(global_data.videoid!='') return r+global_data.videoid; break; En admin.js --> themes --> default --> js --> admin.js
       
      Buscar:
      medallas : { borrar:function(mid, gew){ Arriba agregar:
      videos : { borrar:function(vid, gew){ if(!gew){ mydialog.show(); mydialog.title('Borrar Video'); mydialog.body('&amp;#191;Quiere borrar este video permanentemente?'); mydialog.buttons(true, true, 'Sí', 'admin.videos.borrar(' + vid + ', 1)', true, false, true, 'No', 'close', true, true); 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', url: global_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', url: global_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:
      users: { Arriba agregar:
      videos : { // BORRAR borrar:function(vid, redirect, aceptar){ if(!aceptar){ $.ajax({ type: 'POST', url: global_data.url + '/moderacion-videos.php?do=borrar', success: function(h){ mydialog.show(); mydialog.title('Borrar Video'); mydialog.body(h); mydialog.buttons(true, true, 'Borrar', 'mod.videos.borrar(' + vid + ", '" + redirect + "', 1);", true, false, true, 'Cancelar', 'close', true, true); $('#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', url: global_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:
      {elseif $tsAction == 'usuarios'} {include file='modules/m.top_users.tpl'} Debajo agregar:
      {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:
      {elseif $tsAction == 'denuncia-mensaje'} Arriba agregar:
      {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ápidamente, adjunta pruebas de tu denuncia.<br /> (capturas de pantalla)</span> </div>  
      En m.perfil_sidebar.tpl --> themes --> default --> templates --> modules --> m.perfil_sidebar.tpl
       
      Buscar:
      {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:
      <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="http://img.youtube.com/vi/{$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:
      <li><a href="#" onclick="perfil.load_tab('medallas', this); return false">Medallas</a></li> Debajo agregar:
      <li><a href="#" onclick="perfil.load_tab('videos', this); return false">Videos</a></li> Buscar:
      <li> <strong>{$tsInfo.stats.user_fotos}</strong> <span>Fotos</span> </li> Debajo agregar:
      <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:
      fotoid:'{$tsFoto.foto_id}', Debajo agregar:
      videoid:'{$tsVideo.vid_id}', En head_menu.tpl --> themes --> default --> templates --> sections --> head_menu.tpl
       
      Buscar:
      {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:
      <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:
      <div id="subMenuTops" class="subMenu {if $tsPage == 'tops'}here{/if}"> Arriba agregar:
      <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:
      {elseif $tsAction == 'afs'} {include file='admin_mods/m.admin_afiliados.tpl'} Arriba agregar:
      {elseif $tsAction == 'videos'} {include file='admin_mods/m.admin_videos.tpl'} En t.moderacion.tpl --> themes --> default --> templates --> t.moderacion.tpl
         
      Buscar:
      {elseif $tsAction == 'fotos'} {include file='admin_mods/m.mod_report_fotos.tpl'} Debajo agregar:
      {elseif $tsAction == 'videos'} {include file='admin_mods/m.mod_report_videos.tpl'} Buscar:
      {elseif $tsAction == 'fopelera'} {if $tsUser->is_admod || $tsUser->permisos.morf}{include file='admin_mods/m.mod_papelera_fotos.tpl'}{/if} Debajo agregar:
      {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:
      <li id="a_cats"><span class="cat-title"><a href="{$tsConfig.url}/admin/cats">Categor&iacute;as</a></span></li> Debajo agregar:
      <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:
      <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:
      <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:
      {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:
      {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:
      li#a_badwords {background-image: url(../images/icons/stop.png);} Debajo agregar:
      li#a_film {background-image: url(../images/film.png);} En moderacion.css --> themes --> default --> css --> moderacion.css
       
      Buscar:
      li#a_revposts {background-image: url(../images/icons/exclamation.png);} Debajo agregar:
      li#a_vipelera {background-image: url(../images/film.png);} li#a_film {background-image: url(../images/film.png);} En .htaccess

      Buscar:
      # ADMIN Arriba agregar:
      # VIDEOS RewriteRule ^videos/([A-Za-z0-9_-]+).php$ inc/php/videos.php?action=$1 [QSA,L] RewriteRule ^videos/album/([A-Za-z0-9_-]+)$ inc/php/videos.php?action=album&user=$1 [QSA,L] RewriteRule ^videos/album/([A-Za-z0-9_-]+)/([0-9]+)$ inc/php/videos.php?action=album&user=$1&page=$2 [QSA,L] RewriteRule ^videos/([A-Za-z0-9_-]+)/([0-9]+)/([A-Za-z0-9_-]+).html$ inc/php/videos.php?action=ver&user=$1&vid=$2 [QSA,L] RewriteRule ^admin/videos/([A-Za-z0-9_-]+)/([0-9]+)$ inc/php/admin.php?action=videos&act=$1&vid=$2 [QSA,L] RewriteRule ^videos/([A-Za-z0-9_-]+)/([0-9]+)$ inc/php/videos.php?action=$1&id=$2 [QSA,L]  
      Y subir esta carpeta
      https://mega.nz/file/hBIyCRKQ#l8OQEmYQDAvyk-0vTXRt5l2XsFi0Fz0EPLVNXBUTYnw
       
      Creditos: Nico y Aperpen
       
       
       
       
    • By Miguel92
      Esto es algo que siempre quise hacer, pero como he mencionado anteriormente "SOY MALíSIMO EN PROGRAMACIÓN PHP", pero estaba buscando algo parecido en el foro...pero no encontré. Así que realice uno desde cero.
       
      1 - En inc/class/c.posts.php buscan
          /*         getCatData()         :: OBTENER DATOS DE UNA CATEGORIA     */ y arriba agregan
         /*       OBTENER LOS TITULOS DE LOS POSTS ANTERIOR/SIGUIENTE    */    function TituloAnterior() {       global $tsCore;       $post_id = intval($_GET['post_id']-1);       $query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT post_id, post_title FROM p_posts WHERE post_id = \''.$tsCore->setSecure($post_id).'\' LIMIT 1');       $data = db_exec('fetch_assoc', $query);       return $data['post_title'];    }    function TituloSiguente() {       global $tsCore;       $post_id = intval($_GET['post_id']+1);       $query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT post_id, post_title FROM p_posts WHERE post_id = \''.$tsCore->setSecure($post_id).'\' LIMIT 1');       $data = db_exec('fetch_assoc', $query);       return $data['post_title'];    }  
      2 - Luego en inc/php/posts.php buscan
                  // COMENTARIOS             /*$tsComments = $tsPosts->getComentarios($tsPost['post_id']);             $tsComments = array('num' => $tsComments['num'], 'data' => $tsComments['data']);             $smarty->assign("tsComments",$tsComments);*/             // PAGINAS y arriba pegan
                  $smarty->assign("tsTituloAnterior",$tsPosts->TituloAnterior());             $smarty->assign("tsTituloSiguente",$tsPosts->TituloSiguente());  
      y en la sección del post donde esta anterior, aleatorio y siguente le agregan 
      {$tsTituloAnterior} o {$tsTituloSiguente}
       
      hasta ahora todo bien, pero cual es el problema
      Ejemplo 1: Llegaste al último post, pero ya no veras ningún nombre de post siguente...Pero lo que quiero es que muestre el nombre del post actual ya que es el último
      Ejemplo 2: Tienes los posts con las id (1,2,3,6) hay falta el 4 y 5, y esto no funcionaría ya que le esta sumando o restando a la ID actual y en este caso:
      ¿Como haría para buscar el ID más cercano?
    • By Miguel92
      Pedido: [Mod] Imagen de cabecera en comunidades
      Por: @fellomix
       
      Una segunda forma de poder hacerlo!
       
      1 -  Ejecutar esta consulta
      ALTER TABLE `c_comunidades` ADD `c_headercom` VARCHAR(255) NOT NULL AFTER `c_nombre_corto`; 2 -  Buscar en c.comunidades.php en la función nueva_comunidad()
                      'fecha' => time(),                 'nombre' => $tsCore->setSecure($tsCore->parseBadWords($_POST['nombre']), true),                 'ncorto' => $tsCore->setSeo($tsCore->setSecure($_POST['ncorto'], true)),
      y debajo agregamos
                      'headercom' => $tsCore->setSecure($tsCore->parseBadWords($_POST['headercom']), true),
      un poco más abajo buscamos
                  // Insertamos             if(db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO c_comunidades (c_autor, c_nombre, c_nombre_corto,
      y le agregamos a lado 
                   c_headercom,
      un poquito más abajo de
                      VALUES (                     \''.$tsUser->uid.'\',                     \''.$dato['nombre'].'\',                     \''.$dato['ncorto'].'\',
      agregamos
                          \''.$dato['headercom'].'\',
      Luego buscamos la función editar_comunidad($comid)
                          'pais' => $tsCore->setSecure($_POST['pais']),                         'desc' => $tsCore->setSecure($_POST['descripcion']),                     'color' => $tsCore->setSecure($_POST['back_color']),
      y debajo pegamos
                          'headercom' => $tsCore->setSecure($_POST['headercom']),
      más abajo buscamos 
                          c_acceso = \''.(int)$dato['acceso'].'\',                     c_permisos = \''.$dato['permisos'].'\',
      y debajo pegamos
       
                         c_headercom = \''.$dato['headercom'].'\',             
      3 - Después buscamos en c.crear_left.tpl
          <div class="item_form clearfix">         <label>Categoría</label>         <select name="categoria" id="ShowCats" class="required" onChange="com.subcat()" tabindex="3">             <option value="0">Selecciona una categoría</option>             {foreach from=$tsCats item=c}             <option value="{$c.cid}" {if $tsDato.c_categoria == $c.cid}selected="selected"{/if}>{$c.c_nombre}</option>             {/foreach}         </select>     </div>
      y debajo o arriba pegamos (se me olvido quitar los required, ya que no es obligatorio)
          <div class="item_form clearfix">         <label>Cabecera!</label>         <input type="text" name="headercom" tabindex="10" maxlength="180" size="60" class="required input_text https" placeholder="URL de portada (debe tener https://)" pattern="https://.*" value="{$tsDato.c_headercom}">         <small class="mg-lt">Solo admitirá los https!</small>     </div> 4 - Después buscamos c.com_info.tpl [línea 24 y 25]
      <div class="ver_com_info">     <div class="vci_left floatL">
      y la reemplazamos por
      <div class="ver_com_info" style="background-image: url({$tsCom.c_headercom});">     <div class="opacity">     <div class="vci_left floatL">
      luego debajo de la línea 61 agregaremos un 
          </div> 5 -  Por último agregaremos esto a comunidades.css
      .ver_com_info {     padding: 0; } .headercom {      background-position: center center;     background-size: cover;     background-repeat: no-repeat; } .opacity {     padding: 20px 8px;     background-color: rgba(255,255,255,.6); }  
    • By Miguel92
      Esto es una mini actualización del

      Lo había incluido en el theme Hydra, pero no lo voy a usar!

      ¿Cual es la diferencia con el original?
      Que solo he agregado una función que he buscado por internet, que en este caso leerá el directorio CSS y obtendrá todos los nombre que existan en dicha carpeta, y es por ello que estan escritas manualmente estilo.css, extras.css y phpost.css en el caso que exista otro css fuera de la carpeta lo tendrán que escribir...
      Todos los achivos encontrados serán mostrados en un select en el cual ustedes puede seleccionar y presionar editar ya que agrega el texto correspondiente en el input

      1 - Ir a js/admin.js y debajo de todo agregar
      /* EDITAR CSS */ var css = { editar: function(){ var e = $('input[name=file-css]').val(); if(css.check(e)){ $.ajax({ type: 'POST', url: global_data.url + '/css.php?ajax=1&pas=0', data: 'css=' + e, success: function(h){ $('textarea[name=css]').html(h).css({ width:'100%', height: '500px', resize: 'vertical' }).show(); $('button[name=savecss]').show(); } }); } else sinCss(); }, save: function(){ var e = $('input[name=file-css]').val(); var t = $('textarea[name=css]').val(); $.ajax({ type: 'POST', url: global_data.url + '/css.php?ajax=1&pas=1', data: 'css=' + t + '&name=' + e, success: function(h){ mydialog.show(); mydialog.title('Guardado...'); mydialog.body('Debes recargar <b>' + global_data.s_title + '</b> para que los cambios realizados en el archivos sean aplicados!'); mydialog.buttons(true, true, 'Regargar', 'admincss()', true, false, true, 'No', 'close', true, true); mydialog.center(); } }); }, check: function(filename){ var ext = (/[.]/.exec(filename)) ? /[^.]+$/.exec(filename.toLowerCase()) : ''; if(ext && /^(css)$/.test(ext)) return true; else return false; } } // admincss function admincss() { location.href = global_data.url + '/admin/css' } function sinCss() { mydialog.show(); mydialog.title('Error'); mydialog.body('Debes seleccionar o escribir un archivos CSS para poder elegir'); mydialog.buttons(true, true, 'Ya entendi!', 'close', true, true); mydialog.center(); }

      2 - Ir a templates/t.admin.tpl y debajo de
      {elseif $tsAction == 'rangos'} {include file='admin_mods/m.admin_rangos.tpl'}
      agregar
      {elseif $tsAction == 'css'} {include file='admin_mods/m.admin_css.tpl'}
      3 -  Ir a templates/admin_mods/ y crear un archivo llamado m.admin_css.tpl y agregar lo siguiente (El diseño esta realizado con bootstrap 4 y Material) por lo que deberán adaptarlo a su theme
      {literal} <script type="text/javascript"> function cambioOpciones() { document.getElementById("mostrarCss").value=document.getElementById("opciones").value; } </script> {/literal} <div class="card-header"> <h3>Editar CSS</h3> </div> <div id="rec" class="card-body"> <span class="d-block">Seleccione un archivo, si no se encuentra escribalo!</span> <div class="row"> <div class="col-4"> <select id="opciones" onchange="cambioOpciones();" size="8" class="custom-select"> <option value=''>Selecciona una opción</option> <option value='estilo.css'>Estilo</option> <option value='extras.css'>Extras</option> <option value='phpost.css'>Phpost</option> {php} $directorio = opendir("../../themes/".TS_TEMA."/css/"); //ruta actual while ($archivo = readdir($directorio)) { if (is_dir($archivo)) { } else { $txtCSS = ucfirst(str_replace('.css', ' ', $archivo)); echo "<option value='css/$archivo'>$txtCSS</option>"; } } {/php} </select> </div> <div class="col-8"> <input type="text" name="file-css" id=mostrarCss" class="d-inline form-control" placeholder="Ej: estilo.css o css/admin.css" size="15" style="width:70%" /> <button class="btn btn-outline-success" onclick="css.editar(); return false;">Editar</button> <textarea name="css" class="prettyprint lang-css" style="display:none;"></textarea> <button class="btn btn-outline-info" onclick="css.save(); return false;" name="savecss" style="display:none;">Guardar</button> </div> </div> </div>
      Veran en el código de m.admin_css.tpl esto
      $directorio = opendir("../../themes/".TS_TEMA."/css/"); //ruta actual
      en donde dice ".TS_TEMA." no funciona, solo le cambian por el nombre de su theme actual

      4 - En la misma carpeta buscan m.admin_sidemenu.tpl y buscan
      <li id="a_temas"><span class="cat-title"><a href="{$tsConfig.url}/admin/temas">Temas y apariencia</a></span></li> y  agregan
      <li id="a_rangos"><span class="cat-title"><a href="{$tsConfig.url}/admin/css">Editar CSS</a></span></li> 5 - Por último van a inc/php/ajax y crean un archivo llamado ajax.css.php y pegan esto
      <?php if ( ! defined('TS_HEADER')) exit('No se permite el acceso directo al script att Xtatter :P'); /*/ · EDITAR EL CSS EN LA ADMIN BY XTATTER /*/ if($tsUser->uid == 1){ $pas = (int)$_GET['pas']; if($pas == 0) { $file_css = $tsCore->setSecure($_POST['css']); $i = file_get_contents($tsCore->settings['tema']['t_url'] . '/' . $file_css); if(empty($i)) $i = 'Error: el archivo no existe'; die($i); } else { $css = $_POST['css']; $css = str_replace('\\n', '\n', $css); $css = str_replace("&#039;", "'", $css); $css = str_replace('&quot;', '"', $css); $file_css = $_POST['name']; $i = '../../'.$tsCore->settings['tema']['t_url'] . '/'; file_put_contents( '../../themes/'.$tsCore->settings['tema']['t_path'] .'/'. $file_css, $css ); } } else { return false; } ?>
      VISTA PREVIA

    • By Miguel92
      Pedido: [Mod] Imagen de cabecera en comunidades
      Por: @fellomix
       
      No sé si es exactamente lo que se pidió..
       
      Quedaría como la imagen, pero obviamente no tiene ese borde rojo ya que lo estaba probando...

       
      Ahora deben de seguir los siguientes pasos...(creo que les va a servir para cualquier theme con comunidades y cualquier versión de Risus)
      Buscamos en inc/class/c.comunidades.php
                  } elseif($type == 3) {                 $this->mod_history($comid, 5, $comid);                 $name = 'cf_'.(int)$comid.'.jpg';                 $root = TS_FILES.'uploads/'.$name;                 if(copy($file['tmp_name'],$root)) return '1: '.$tsCore->settings['url'].'/files/uploads/'.$name;                 else return '0: No se pudo subir la imagen';             }  y debajo o al lado de } pegamos
                   elseif($type == 4) {                 $this->mod_history($comid, 6, $comid);                 $name = 'head_'.(int)$comid.'.jpg';                 $root = TS_FILES.'uploads/'.$name;                 if(copy($file['tmp_name'],$root)) return '1: '.$tsCore->settings['url'].'/files/uploads/'.$name;                 else return '0: No se pudo subir la imagen';             } Luego buscamos en inc/php/ajax/ajax.comunidades.php
              case 'comunidades-edit_fondo':             //<--                 $result = $tsCom->uploadImagen($_FILES['background'], $_GET['comid'], 3);                 echo $tsCore->setJSON($result);             //-->         break; y debajo agregaremos
              case 'comunidades-edit_header':             //<--                 $result = $tsCom->uploadImagen($_FILES['header'], $_GET['comid'], 4);                 echo $tsCore->setJSON($result);             //-->         break; Luego vamos a themes/TUTHEME/js/comunidades.js y buscamos
          votar_tema: function(voto) {         $('#loading').fadeIn(250);         voto = (voto == 'pos') ? 'pos' : 'neg';         var votos = $('#votos_total');         var total_votos = parseInt(votos.text());         total_votos = (isNaN(total_votos)) ? 0 : total_votos; Arriba de esto pegamos lo siguiente
          subir_cabecera: function() {         $('#loading').fadeIn(250);         if ($('#head_input').val()) {             if(isImageFile($('#head_input').val())){                 $('#head_change').css({'opacity' : 0.5});                 $.ajaxFileUpload({                     url: global_data.url + '/comunidades-edit_header.php?' + cgget('comid', true),                     fileElementId: 'head_input',                     dataType: 'json',                     success: function(h){                         if(h.charAt(0) == 1) {                             $('#head_change').css({'opacity' : 1});                             $('#head_change').attr({'src' : h.substring(3) + '?' + new Date().getTime()});                         } else {                             mydialog.alert('Error', h.substring(3));                         }                                         $('#loading').fadeOut(250);                     }                 });             } else mydialog.alert('Error', 'El archivo no es una imagen válida.');         } else mydialog.alert('Error', 'No selecciono ningun archivo.');     },  
      Más abajo buscamos
          if(global_com.comid!='') {         $('body').css({'background-image' : 'url("' + global_data.url + '/files/uploads/cf_' + global_com.comid + '.jpg")'});     }
      y debajo agregamos
          if(global_com.comid!='') {         $('.headercom').css({'background-image' : 'url("' + global_data.url + '/files/uploads/head_' + global_com.comid + '.jpg")'});     } Solo tendríamos que agregar la clase .headercom en donde queramos que aparezca la cabecera de la comunidad
       
      Luego en themes/TUTHEME/templates/comunidades/c.crear_right.tpl y arriba de
      <input type="hidden" id="comid" value="{$tsDato.c_id}" /> <div class="com_box_title clearfix"><h2>Imagen de la comunidad</h2></div>
      Pegamos
          <div class="com_box_title clearfix"><h2>Cabecera de la comunidad</h2></div>     <div class="com_edit_imagen" align="center"> <img src="{$tsConfig.url}/files/uploads/head_{$tsDato.c_id}.jpg" id="head_change" height="180" width="100%" /> <input type="file" id="head_input" class="input_text" name="header" style="width: 100%;" onchange="com.subir_cabecera({$tsDato.c_id})" /> </div>  
      En themes/TUTHEME/templates/comunidades/c.com_info.tpl
      <div class="ver_com_info">     <div class="vci_left floatL">
      y la reemplazamos por
      <div class="ver_com_info headercom">     <div class="opacity">     <div class="vci_left floatL">
      luego más abajo buscamos
          <a href="#" onclick="$('.ver_com_info').toggle();return false;"><i class="com_icon icon_less"></i></a>     <div class="clearfix"></div> </div>
      y la reemplazamos por
          <a href="#" onclick="$('.ver_com_info').toggle();return false;"><i class="com_icon icon_less"></i></a>     <div class="clearfix"></div>     </div> </div> por último en themes/TUTHEME/css/comunidades.css agregamos
      .ver_com_info {     padding: 0; } .headercom { /* De acá podrán darle estilo al fondo */     background-position: center center;     background-size: cover;     background-repeat: no-repeat; } .opacity {     padding: 20px 8px;     background-color: rgba(255,255,255,.6); }  
      Luego trataré de hacer otro, pero que evite subir imagenes a nuestro servidor y que la suba a un web como por ejemplo imgur...creo, no sé...ya lo veré
      PD: Si al editar la imagen no cambia, presionen "CTRL + SHIFT + R" y para evitar eso busquen en t.comunidades.tpl 
      <script type="text/javascript" src="{$tsConfig.js}/comunidades.js"></script> y lo cambian por
      <script type="text/javascript" src="{$tsConfig.js}/comunidades.js?{$smarty.now}"></script>  
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Patrocinador



  • ×