¿Ya tienes cuenta? Inicia sesión aquí
Últimos temas
-
Cómo funcionan las Mision...
Foro: Guías y Tutoriales
Último mensaje por: Tronlar
Ayer, 09:46 PM
» Respuestas: 0
» Vistas: 56 -
V6 Original/Dark/Memes (A...
Foro: Diseños Terminados
Último mensaje por: carlos007r
Ayer, 11:08 AM
» Respuestas: 26
» Vistas: 6,336 -
V5
Foro: Diseños Terminados
Último mensaje por: Aeikox
06-13-2026, 12:16 AM
» Respuestas: 8
» Vistas: 1,447 -
Risus 1.3 Actualizado jQu...
Foro: Risus 1.3
Último mensaje por: Tronlar
06-12-2026, 10:45 PM
» Respuestas: 55
» Vistas: 10,660 -
Preguntas Frecuentes y So...
Foro: Guías y Tutoriales
Último mensaje por: Tronlar
06-12-2026, 06:17 PM
» Respuestas: 0
» Vistas: 56 -
Cómo registrar tu comunid...
Foro: Guías y Tutoriales
Último mensaje por: Tronlar
06-12-2026, 05:32 PM
» Respuestas: 0
» Vistas: 50 -
Cómo monetizar tu comunid...
Foro: Guías y Tutoriales
Último mensaje por: Tronlar
06-11-2026, 07:19 PM
» Respuestas: 0
» Vistas: 50 -
Introducción al SEO para ...
Foro: Guías y Tutoriales
Último mensaje por: Tronlar
06-11-2026, 06:58 PM
» Respuestas: 0
» Vistas: 58 -
Guía completa de SEO para...
Foro: Guías y Tutoriales
Último mensaje por: Tronlar
06-11-2026, 06:48 PM
» Respuestas: 0
» Vistas: 60 -
Diccionario de términos b...
Foro: Guías y Tutoriales
Último mensaje por: Tronlar
06-11-2026, 01:41 PM
» Respuestas: 0
» Vistas: 82
Estadísticas del foro
- Mensajes del foro:1,957
- Temas del foro:614
- Miembros:1,036
- Último miembro:carlos007r
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
¿Que contiene?
- Enviar peticiones de amistado
- Aceptar/rechazar peticiones
- Avisos en el monitor
- Ver lista de amigo
- Perfiles privados configurables.
- Moderadores y administradores pueden ver los perfiles aun que sean privados.
Ejecutar estas consultas
Código PHP:
CREATE TABLE IF NOT EXISTS `u_amigos` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_1` varchar(3) NOT NULL,
`user_2` varchar(3) NOT NULL,
`fecha` int(10) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Código PHP:
CREATE TABLE IF NOT EXISTS `u_peticiones` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`de` int(3) NOT NULL,
`para` int(3) NOT NULL,
`fecha` int(3) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Código PHP:
ALTER TABLE `u_perfil` ADD `user_priv` INT( 1 ) NOT NULL DEFAULT '0'
En header.php
Buscar:
Código PHP:
// Controlador de usuarios
include TS_CLASS.'c.user.php';
Debajo agregar:
Código PHP:
//Amigos
include TS_CLASS.'c.amigos.php';
Buscar:
Código PHP:
// Mensajes
$tsMP = new tsMensajes();
Debajo agregar:
Código PHP:
//Amigos
$tsAmigos = new tsAmigos();
En c.cuenta.php --> inc --> class --> c.cuenta.php
Buscar:
Código PHP:
'firma' => $tsCore->setSecure($tsCore->parseBadWords($_POST['firma']), true),
Debajo agregar:
Código PHP:
'priv' => ($_POST['priv'] == 'n') ? 0 : 1,
Buscar:
Código PHP:
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT user_dia, user_mes, user_ano, user_pais, user_estado, user_sexo, user_firma FROM U_perfil WHERE user_id = \''.$tsUser->uid.'\' LIMIT 1');
$info = db_exec('fetch_assoc', $query);
Reemplazar por:
Código PHP:
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT user_dia, user_mes, user_ano, user_pais, user_estado, user_sexo, user_firma, user_priv FROM U_perfil WHERE user_id = \''.$tsUser->uid.'\' LIMIT 1');
$info = db_exec('fetch_assoc', $query);
Buscar:
Código PHP:
elseif(empty($perfilData['estado'])){
$msg_return = array('error' => 'Por favor, especifica tu estado.'.$_POST['estado']);
$perfilData['estado'] = $info['user_estado'];
}
Debajo agregar:
Código PHP:
elseif($perfilData['priv'] > 2){
$msg_return = array('error' => 'Por favor, indica la privacidad de tu perfil');
$perfilData['priv'] = $info['user_priv'];
}
Buscar:
Código PHP:
function loadHeadInfo($user_id){
global $tsUser, $tsCore;
// INFORMACION GENERAL
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT u.user_id, u.user_name, u.user_registro, u.user_lastactive, u.user_activo, u.user_baneado, p.user_sexo, p.user_pais, p.p_nombre, p.p_avatar, p.p_mensaje, p.p_socials, p.p_empresa, p.p_configs FROM u_miembros AS u, u_perfil AS p WHERE u.user_id = \''.(int)$user_id.'\' AND p.user_id = \''.(int)$user_id.'\'');
$data = db_exec('fetch_assoc', $query);
Reemplazar por:
Código PHP:
function loadHeadInfo($user_id){
global $tsUser, $tsCore;
// INFORMACION GENERAL
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT u.user_id, u.user_name, u.user_registro, u.user_lastactive, u.user_activo, u.user_baneado, p.user_sexo, p.user_pais, p.p_nombre, p.p_avatar, p.p_mensaje, p.p_socials, p.p_empresa, p.p_configs, p.user_priv FROM u_miembros AS u, u_perfil AS p WHERE u.user_id = \''.(int)$user_id.'\' AND p.user_id = \''.(int)$user_id.'\'');
$data = db_exec('fetch_assoc', $query);
En c.monitor.php --> inc --> class --> c.monitor.php
Buscar:
Código PHP:
17 => array('text' => 'Tu foto recibió una medalla', 'css' => 'medal'),
Debajo agregar:
Código PHP:
30 => array('text' => 'aceptó tu petición de amistad.', 'css' => 'acept'),
31 => array('text' => 'rechazó tu petición de amistad.', 'css' => 'rec'),
32 => array('text' => 'te envió una petición de amistad.', 'css' => 'new'),
Buscar:
Código PHP:
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;
Arriba agregar:
Código PHP:
case 30:
return 'SELECT user_name FROM u_miembros WHERE user_id = \''.(int)$data['obj_user'].'\' LIMIT 1';
break;
case 31:
return 'SELECT user_name FROM u_miembros WHERE user_id = \''.(int)$data['obj_user'].'\' LIMIT 1';
break;
case 32:
return 'SELECT user_name FROM u_miembros WHERE user_id = \''.(int)$data['obj_user'].'\' LIMIT 1';
break;
Buscar:
Código PHP:
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;
Arriba agregar:
Código PHP:
case 30:
$oracion['text'] = $this->monitor[$no_type]['text'];
break;
case 31:
$oracion['text'] = $this->monitor[$no_type]['text'];
break;
case 32:
$oracion['text'] = $this->monitor[$no_type]['text'];
break;
En perfil.php --> inc --> php --> perfil.php
Buscar:
Código PHP:
$smarty->assign("tsPrivacidad",$priv);
Debajo agregar:
Código PHP:
$smarty->assign("is_amigo",$tsAmigos->is_amigo($tsInfo['nick'], 'all'));
En phpost.css --> themes --> default --> phpost.css
Buscar:
Código PHP:
span.ma_medal{ background: url(images/icons/med/blue_bronze_16.png);}
Debajo agregar:
Código PHP:
span.ma_acept{ background: url(images/icons/yes.png) no-repeat;}
span.ma_rec{ background: url(images/icons/close.png) no-repeat;}
span.ma_new{ background: url(images/icons/users.png) no-repeat;}
En t.perfil.tpl --> themes --> default --> templates --> t.perfil.tpl
Buscar:
Código PHP:
{include file='sections/main_header.tpl'}
Reemplazar por:
Código PHP:
{include file='sections/main_header.tpl'}
{if $tsInfo.user_priv == 0}
<script type="text/javascript" src="{$tsConfig.default}/js/perfil.js"></script>
{include file='modules/m.perfil_headinfo.tpl'}
<div class="perfil-main clearfix {$tsGeneral.stats.user_rango.1}">
<div class="perfil-content general">
<div id="info" pid="{$tsInfo.uid}"></div>
<div id="perfil_content">
{if $tsPrivacidad.m.v == false}
<div id="perfil_wall" status="activo" class="widget">
<div class="emptyData">{$tsPrivacidad.m.m}</div>
<script type="text/javascript">
perfil.load_tab('info', $('#informacion'));
</script>
</div>
{elseif $tsType == 'story'}
{include file='modules/m.perfil_story.tpl'}
{elseif $tsType == 'news'}
{include file='modules/m.perfil_noticias.tpl'}
{else}
{include file='modules/m.perfil_muro.tpl'}
{/if}
</div>
<div style="width:100%;text-align:center;display:none" id="perfil_load"><img src="{$tsConfig.images}/fb-loading.gif" /></div>
</div>
<div class="perfil-sidebar">
{include file='modules/m.perfil_sidebar.tpl'}
</div>
</div>
{elseif $is_amigo}
Buscar:
Código PHP:
<div class="perfil-sidebar">
{include file='modules/m.perfil_sidebar.tpl'}
</div>
</div>
Debajo agregar:
Código PHP:
{else}
<div class="emptyData"> Este perfil es privado y solo los amigos de este usuario pueden verlo.</br>
<a href="{$tsConfig.url}/amigos/?user={$tsInfo.uid}"> Envía una petición de amistad a este usuario</a></div>
{/if}
En head_menu.tpl --> themes --> default --> templates --> sections --> head_menu.tpl
Buscar:
Código PHP:
$tsPage != 'fotos'
Reemplazar por:
Código PHP:
$tsPage != 'fotos' && $tsPage != 'amigos'
Buscar:
Código PHP:
{if $tsConfig.c_fotos_private == '1' && !$tsUser->is_member}{else}
<li class="tabbed {if $tsPage == 'fotos'}here{/if}" id="tabbedfotos">
<a title="Ir a Fotos" onclick="menu('fotos', this.href); return false;" href="{$tsConfig.url}/fotos/">Fotos <img alt="Drop Down" src="{$tsConfig.tema.t_url}/images/arrowdown.png"></a>
</li>
{/if}
Debajo agregar:
Código PHP:
{if $tsUser->is_member}
<li class="tabbed {if $tsPage == 'amigos'}here{/if}" id="tabbedtops">
<a title="Ir a amigos" href="{$tsConfig.url}/amigos/">Amigos <img alt="Drop Down" src="{$tsConfig.tema.t_url}/images/arrowdown.png"></a>
</li>
{/if}
En head_submenu.tpl --> themes --> default --> templates --> sections --> head_submenu.tpl
Buscar:
Código PHP:
<div id="subMenuFotos" class="subMenu {if $tsPage == 'fotos'}here{/if}">
<ul class="floatL tabsMenu">
<li{if $tsAction == '' && $tsAction != 'agregar' && $tsAction != 'album' && $tsAction != 'favoritas' || $tsAction == 'ver'} class="here"{/if}><a href="{$tsConfig.url}/fotos/">Inicio</a></li>
{if $tsAction == 'album' && $tsFUser.0 != $tsUser->uid}<li class="here"><a href="{$tsConfig.url}/fotos/{$tsFUser.1}">Álbum de {$tsFUser.1}</a></li>{/if}
{if $tsUser->is_admod || $tsUser->permisos.gopf}<li{if $tsAction == 'agregar'} class="here"{/if}><a href="{$tsConfig.url}/fotos/agregar.php">Agregar Foto</a></li>{/if}
<li{if $tsAction == 'album' && $tsFUser.0 == $tsUser->uid} class="here"{/if}><a href="{$tsConfig.url}/fotos/{$tsUser->nick}">Mis Fotos</a></li>
</ul>
<div class="clearBoth"></div>
</div>
Debajo agregar:
Código PHP:
<div id="subMenuAmigos" class="subMenu {if $tsPage == 'amigos'}here{/if}">
<ul class="floatL tabsMenu">
<li><a href="{$tsConfig.url}/amigos/">Inicio</a></li>
<li ><a href="{$tsConfig.url}/amigos/?pet=1">Peticiones</a></li>
</ul>
<div class="clearBoth"></div>
</div>
En m.cuenta_cuenta.tpl --> themes --> default --> templates --> modules --> m.cuenta_cuenta.tpl
Buscar:
Código PHP:
{if $tsConfig.c_allow_firma}
<div class="field">
<label for="firma">Firma:<br /> <small style="font-weight:normal">(Acepta BBCode) Max. 300 car.</small></label>
<textarea name="firma" id="firma" class="cuenta-save-1">{$tsPerfil.user_firma}</textarea>
</div>
{/if}
Debajo agregar:
Código PHP:
<div class="field">
<label>Perfil solo para tus amigos</label>
<ul class="fields">
<li>
<label><input type="radio" value="s" name="priv" class="radio cuenta-save-1" {if $tsPerfil.user_priv == '1'}checked="checked"{/if}/>Si</label>
</li>
<li>
<label><input type="radio" value="n" name="priv" class="radio cuenta-save-1" {if $tsPerfil.user_priv == '0'}checked="checked"{/if}/>No</label>
</li>
</ul>
</div>
En m.perfil_headinfo.tpl --> themes --> default --> templates --> modules --> m.perfil_headinfo.tpl
Buscar:
Código PHP:
<a class="btn_g unfollow_user_post" onclick="notifica.unfollow('user', {$tsInfo.uid}, notifica.userInPostHandle, $(this).children('span'))" {if $tsInfo.follow == 0}style="display: none;"{/if}><span class="icons unfollow">Dejar de seguir</span></a>
<a class="btn_g follow_user_post" onclick="notifica.follow('user', {$tsInfo.uid}, notifica.userInPostHandle, $(this).children('span'))" {if $tsInfo.follow == 1}style="display: none;"{/if}><span class="icons follow">Seguir Usuario</span></a>
{/if}
Debajo agregar:
Código PHP:
{if $tsUser->is_admod}
</br><a href="{$tsConfig.url}/amigos/?user={$tsInfo.uid}"> Envía una petición de amistad a este usuario</a>
{elseif $is_amigo}
{elseif $tsUser->is_member}
</br><a href="{$tsConfig.url}/amigos/?user={$tsInfo.uid}"> Envía una petición de amistad a este usuario</a>
{/if}
Y subir esta carpeta
Mega
http://Registrate o inicia tu sesión par... contenido
Google Drive
http://Registrate o inicia tu sesión par... contenido
Mediafire
http://Registrate o inicia tu sesión par... contenido
Creditos: aperpen
Capturas
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
Ejecutar estas consultas
Código PHP:
ALTER TABLE w_configuracion ADD u_reco VARCHAR( 15 ) NOT NULL AFTER offline_message
Código PHP:
ALTER TABLE w_configuracion ADD u_reco_id VARCHAR( 15 ) NOT NULL AFTER u_reco
En .htaccess
Buscar:
Código PHP:
#PERFIL
Debajo agregar:
Código PHP:
RewriteRule ^([A-Za-z0-9_-]+)$ inc/php/perfil.php?user=$1 [QSA,L]
RewriteRule ^([A-Za-z0-9_-]+)/([0-9]+)$ inc/php/perfil.php?user=$1&pid=$2 [QSA,L]
En c.admin.php --> inc --> class --> c.admin.php
Buscar:
Código PHP:
'titulo' => $tsCore->setSecure($tsCore->parseBadWords($_POST['titulo'])),
Debajo agregar:
Código PHP:
'reco' => $tsCore->setSecure($_POST['reco']),
'ireco' => $tsCore->setSecure($_POST['ireco']),
Buscar:
Código PHP:
$c['offline_message'] . '\'
Al lado agregar:
Código PHP:
, `u_reco` = \'' . $c['reco'] . '\', `u_reco_id` = \'' . $c['ireco'] . '\'
En c.core.php --> inc --> class --> c.core.php
Buscar:
Código PHP:
$this->settings['js'] = $this->settings['tema']['t_url'].'/js';
Debajo agregar:
Código PHP:
$this->settings['ur'] = $this->settings['u_reco'];
En t.home.tpl --> themes --> default --> templates --> t.home.tpl
Buscar:
Código PHP:
{include file='modules/m.home_stats.tpl'}
Debajo agregar:
Código PHP:
{include file='modules/m.home_u_reco.tpl'}
En m.admin_configs.tpl --> themes --> default --> templates --> admin_mods --> m.admin_configs.tpl
Buscar:
Código PHP:
<dl>
<dt>
<label for="ai_nfu">Cambio de rango:</label>
<br /><span>Un usuario sube de rango cuando obtiene los puntos mínimos en:</span></dt>
<dd>
<label>
<input name="newr" type="radio" id="ai_nfu" value="1" {if $tsConfig.c_newr_type==1 }checked="checked" {/if} class="radio" />Todos sus post</label>
<label>
<input name="newr" type="radio" id="ai_nfu" value="0" {if $tsConfig.c_newr_type !=1 }checked="checked" {/if} class="radio" />Solo en un post</label>
</dd>
</dl>
Debajo agregar:
Código PHP:
<dl>
<hr />
<center><legend>Usuario recomendado</legend></center>
<dl>
<dt>
<label for="ai_reco">Usuario recomendado</label>
<br /><span>Ingrese el nombre del usuario. </span></dt>
<dd>
<input type="text" name="reco" id="ai_reco" value="{$tsConfig.u_reco}" /></dd>
</dl>
<dl>
<dt>
<label for="ai_ireco">ID del usuario</label><br /><span>Ingrese el ID del Usuario. EJ: 1,5,8... </span>
</dt>
<dd>
<input type="text" name="ireco" id="ai_ireco" value="{$tsConfig.u_reco_id}" />
</dd>
</dl>
Y subir esta carpeta
Mega
http://Registrate o inicia tu sesión par... contenido
Google Drive
http://Registrate o inicia tu sesión par... contenido
Mediafire
http://Registrate o inicia tu sesión par... contenido
Creditos: k_jupiter
DEMO
http://Registrate o inicia tu sesión par... contenido
Captura gif
[img]Registrate o inicia tu sesión para ver este contenido[/img]
En header.php
Buscar:
Código PHP:
// Configuraciones
$smarty->assign('tsConfig',$tsCore->settings);
Debajo agregar:
Código PHP:
// Configuraciones
$smarty->assign('tsThemes',$tsCore->getThemes());
En c.core.php --> inc --> class --> c.core.php
Buscar:
Código PHP:
function __construct()
{
// CARGANDO CONFIGURACIONES
$this->settings = $this->getSettings();
$this->settings['domain'] = str_replace('http://','',$this->settings['url']);
$this->settings['categorias'] = $this->getCategorias();
$this->settings['default'] = $this->settings['url'].'/themes/default';
$this->settings['tema'] = $this->getTema();
$this->settings['images'] = $this->settings['tema']['t_url'].'/images';
$this->settings['css'] = $this->settings['tema']['t_url'].'/css';
$this->settings['js'] = $this->settings['tema']['t_url'].'/js';
//
if($_GET['do'] == 'portal' || $_GET['do'] == 'posts') $this->settings['news'] = $this->getNews();
# Mensaje del instalador y pendientes de moderación #
$this->settings['install'] = $this->existinstall();
$this->settings['novemods'] = $this->getNovemods();
}
Reemplazar por:
Código PHP:
function __construct()
{
// CARGANDO CONFIGURACIONES
$this->settings = $this->getSettings();
$this->settings['domain'] = str_replace('http://','',$this->settings['url']);
$this->settings['categorias'] = $this->getCategorias();
$this->settings['default'] = $this->settings['url'].'/themes/default';
if(!isset($_COOKIE['tema']) || !file_exists(TS_ROOT.DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.$_COOKIE['tema'])) {
$default = db_exec('fetch_array', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT * FROM w_temas WHERE tid = '.$this->settings['tema_id']));
$_COOKIE['tema'] = $default['t_path'];
}
$this->settings['tema']['t_path'] = $_COOKIE['tema'];
$this->settings['tema']['t_url'] = $this->settings['url'].'/themes/'.$this->settings['tema']['t_path'];
$this->settings['images'] = $this->settings['tema']['t_url'].'/images';
$this->settings['css'] = $this->settings['tema']['t_url'].'/css';
$this->settings['js'] = $this->settings['tema']['t_url'].'/js';
//
if($_GET['do'] == 'portal' || $_GET['do'] == 'posts') $this->settings['news'] = $this->getNews();
# Mensaje del instalador y pendientes de moderación #
$this->settings['install'] = $this->existinstall();
$this->settings['novemods'] = $this->getNovemods();
}
Buscar:
Código PHP:
/*
getNews()
*/
function getNews()
{
//
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT not_body FROM w_noticias WHERE not_active = \'1\' ORDER by RAND()');
while($row = db_exec('fetch_assoc', $query)){
$row['not_body'] = $this->parseBBCode($row['not_body'],'news');
$data[] = $row;
}
//
return $data;
}
Debajo agregar:
Código PHP:
/*
getThemes()
*/
function getThemes(){
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT * FROM w_temas');
return result_array($query);
}
En c.smarty.php --> inc --> class --> c.smarty.php
Buscar:
Código PHP:
function __construct()
{
global $tsCore;
//
$this->template_dir = TS_ROOT.DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.TS_TEMA.DIRECTORY_SEPARATOR.'templates';
$this->compile_dir = TS_ROOT.DIRECTORY_SEPARATOR.'cache';
$this->template_cb = array('url' => $tsCore->settings['url'], 'title' => $tsCore->settings['titulo']);
//
$this->_tpl_hooks = array();
}
Reemplazar por:
Código PHP:
function __construct()
{
global $tsCore;
//
$this->template_dir = TS_ROOT.DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.TS_TEMA.DIRECTORY_SEPARATOR.'templates';
$this->compile_dir = TS_ROOT.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.TS_TEMA;
if(!file_exists($this->compile_dir)) mkdir($this->compile_dir);
$this->template_cb = array('url' => $tsCore->settings['url'], 'title' => $tsCore->settings['titulo']);
//
$this->_tpl_hooks = array();
}
Importante: Ahora este código debe estar en todas la plantillas, si no, solo se podría cambiar el theme desde una plantilla y desde las otras no.
Ejemplo en el footer
Buscar:
Código PHP:
<a href="{$tsConfig.url}/pages/dmca/">Report Abuse - DMCA</a>
Debajo agregar:
Código PHP:
<a class="blanco" onclick="change.menu();">Cambiar plantilla</a>
<style>
{literal}
.change_option { display: block; padding: 10px 15px; border-bottom: 1px solid #ccc; }
.change_option:first-child { border-top: 1px solid #ccc; }
.change_option:hover { background: #444; color: white; }
{/literal}
</style>
<script>
{literal}
var change = {
menu: function() {
mydialog.show();
mydialog.title('Cambiar plantilla');
mydialog.body('{/literal}{foreach from=$tsThemes item=t}<a class="change_option" onclick="change.theme({$t.tid})">{if $tsConfig.tema.t_path == $t.t_path}<img src="{$tsConfig.images}/tick-button.png" style="vertical-align: middle;">{/if} {$t.t_name}</a>{/foreach}{literal}');
mydialog.buttons(true, true, 'Cancelar', 'close', true);
mydialog.center();
},
theme: function(id) {
$.get(global_data.url+'/change.php?theme='+id).done(function() { window.location.reload(); });
}
};
{/literal}
</script>
Y subir esta carpeta
Mega
http://Registrate o inicia tu sesión par... contenido
Google Drive
http://Registrate o inicia tu sesión par... contenido
Mediafire
http://Registrate o inicia tu sesión par... contenido
Creditos: Rhuan
Funciones de esta versión
- Los visitantes puede comentar los posts.
- Anti-flood para visitantes (60 segundos entre cada comentario).
- Deben introducir nombre y email.
- Validador de email.
- Solo el administrador pueden ver los emails.
- Cuando un invitado comenta no aparecerá en el monitor.
- Los comentarios de invitados se "fusionan" con los otros para la paginación.
- Arreglada paginación de una manera "rustica" pero funcional.
Capturas
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
Ejecutar esta consulta
ALTER TABLE `p_comentarios` ADD `c_anon` VARCHAR(200) NULL DEFAULT NULL ;
En ajax.comentario.php --> inc --> php --> ajax --> ajax.comentario.php
Buscar:
Código PHP:
'comentario-preview' => array('n' => 2, 'p' => 'preview'),
'comentario-agregar' => array('n' => 2, 'p' => 'preview'),
Reemplazar por:
Código PHP:
'comentario-preview' => array('n' => 0, 'p' => 'preview'),
'comentario-agregar' => array('n' => 0, 'p' => 'preview'),
Buscar:
Código PHP:
$preview = array(0,$tsCore->parseBBCode($comentario),'',time(),$auser, $comentario, $_SERVER['REMOTE_ADDR']);
Reemplazar por:
Código PHP:
$preview = array(0,$tsCore->parseBBCode($comentario),'',time(),$auser, $comentario, $_SERVER['REMOTE_ADDR'], $tsCore->setSecure($_POST['na']));
En c.posts.php --> inc --> class --> c.posts.php
Buscar:
Código PHP:
$q1 = db_exec('fetch_row', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT COUNT(u.user_name) AS c FROM u_miembros AS u LEFT JOIN p_comentarios AS c ON u.user_id = c.c_user WHERE c.c_post_id = \''.(int)$post_id.'\' && c.c_status = \'0\' && u.user_activo = \'1\' && u.user_baneado = \'0\''));
Reemplazar por:
Código PHP:
$q1 = db_exec('fetch_row', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT COUNT(cid) FROM p_comentarios WHERE c_post_id = \''.(int)$post_id.'\' '.($tsUser->is_admod ? '' : ' AND c_status = \'0\'').''));
Buscar:
Código PHP:
/*
getComentarios()
*/
function getComentarios($post_id){
global $tsCore, $tsUser;
//
$start = $tsCore->setPageLimit($tsCore->settings['c_max_com']);
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT u.user_name, u.user_activo, u.user_baneado, c.* FROM u_miembros AS u LEFT JOIN p_comentarios AS c ON u.user_id = c.c_user WHERE c.c_post_id = \''.(int)$post_id.'\' '.($tsUser->is_admod ? '' : 'AND c.c_status = \'0\' AND u.user_activo = \'1\' && u.user_baneado = \'0\'').' ORDER BY c.cid LIMIT '.$start);
// COMENTARIOS TOTALES
$return['num'] = db_exec('num_rows', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT cid FROM p_comentarios WHERE c_post_id = \''.(int)$post_id.'\' '.($tsUser->is_admod ? '' : 'AND c_status = \'0\'').''));
//
$comments = result_array($query);
// PARSEAR EL BBCODE
$i = 0;
foreach($comments as $comment){
// CON ESTE IF NOS AHORRAMOS CONSULTAS
if($comment['c_votos'] != 0){
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT voto_id FROM p_votos WHERE tid = \''.(int)$comment['cid'].'\' AND tuser = \''.$tsUser->uid.'\' AND type = \'2\' LIMIT 1');
$votado = db_exec('num_rows', $query);
} else $votado = 0;
// BLOQUEADO
$return['block'] = db_exec('num_rows', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT bid, b_user, b_auser FROM `u_bloqueos` WHERE b_user = \''.(int)$comment['c_user'].'\' AND b_auser = \''.$tsUser->uid.'\' LIMIT 1'));
//
$return['data'][$i] = $comment;
$return['data'][$i]['votado'] = $votado;
$return['data'][$i]['c_html'] = $tsCore->parseBadWords($tsCore->parseBBCode($return['data'][$i]['c_body']), true);
$i++;
}
//
return $return;
}
Reemplazar por:
Código PHP:
/*
getComentarios()
*/
function getComentarios($post_id){
global $tsCore, $tsUser;
//
$start = $tsCore->setPageLimit($tsCore->settings['c_max_com']);
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT u.user_name, u.user_activo, u.user_baneado, c.* FROM u_miembros AS u LEFT JOIN p_comentarios AS c ON u.user_id = c.c_user WHERE c.c_post_id = \''.(int)$post_id.'\' && c.c_user != \'0\' '.($tsUser->is_admod ? '' : 'AND c.c_status = \'0\' AND u.user_activo = \'1\' && u.user_baneado = \'0\'').' ORDER BY c.cid');
$comn = result_array($query);
$queryanon = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT * FROM p_comentarios WHERE c_post_id = \''.(int)$post_id.'\' && c_user = \'0\' '.($tsUser->is_admod ? '' : 'AND c_status = \'0\'').' ORDER BY cid');
$comanon = result_array($queryanon);
$i = 0;
foreach($comanon as $coma){
$anon_datos = unserialize($coma['c_anon']);
$comanon[$i]['anon'] = 1;
$comanon[$i]['user_activo'] = 1;
$comanon[$i]['user_name'] = $anon_datos['name'];
$comanon[$i]['user_email'] = $anon_datos['email'];
$i++;
}
// COMENTARIOS TOTALES
$return['num'] = db_exec('num_rows', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT cid FROM p_comentarios WHERE c_post_id = \''.(int)$post_id.'\' '.($tsUser->is_admod ? '' : ' AND c_status = \'0\'').''));
//
$com = array_merge((array)$comn, (array)$comanon);
// ORDENAR COMENTARIOS
foreach ($com as $key => $row) {
$aux[$key] = $row['cid'];
}
array_multisort($aux, SORT_ASC, $com);
//COMO NO NOS VALIA LA FUNCION DEL SCRIPT, CREAMOS UN PROPIO SISTEMA
$page = $_GET['page'] == 1 ? 0 : (int)$_GET['page'];
$limits[0] = empty($page) ? 0 : (int) ((($page - 1) * $tsCore->settings['c_max_com']));
$limits[1] = $limits[0]+$tsCore->settings['c_max_com']-1;
//LOS GUARDAMOS ORDENADITOS
while($limits[0] <= $limits[1]){
if(!empty($com[$limits[0]]))
$comments[] = $com[$limits[0]];
$limits[0]++;
}
// PARSEAR EL BBCODE
$i = 0;
foreach($comments as $comment){
// CON ESTE IF NOS AHORRAMOS CONSULTAS
if($comment['c_votos'] != 0){
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT voto_id FROM p_votos WHERE tid = \''.(int)$comment['cid'].'\' AND tuser = \''.$tsUser->uid.'\' AND type = \'2\' LIMIT 1');
$votado = db_exec('num_rows', $query);
} else $votado = 0;
// BLOQUEADO
$return['block'] = db_exec('num_rows', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT bid, b_user, b_auser FROM `u_bloqueos` WHERE b_user = \''.(int)$comment['c_user'].'\' AND b_auser = \''.$tsUser->uid.'\' LIMIT 1'));
//
$return['data'][$i] = $comment;
$return['data'][$i]['votado'] = $votado;
$return['data'][$i]['c_html'] = $tsCore->parseBadWords($tsCore->parseBBCode($return['data'][$i]['c_body']), true);
$i++;
}
//
return $return;
}
Buscar:
Código PHP:
/*
newComentario()
*/
function newComentario(){
global $tsCore, $tsUser, $tsActividad;
// NO MAS DE 1500 CARACTERES PUES NADIE COMENTA TANTO xD
$comentario = substr($_POST['comentario'],0,1500);
$post_id = ($_POST['postid']);
/* DE QUIEN ES EL POST */
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT post_user, post_block_comments FROM p_posts WHERE post_id = \''.(int)$post_id.'\' LIMIT 1');
$data = db_exec('fetch_assoc', $query);
/* COMPROBACIONES */
$tsText = preg_replace('# +#',"",$comentario);
$tsText = str_replace("\n","",$tsText);
if($tsText == '') return '0: El campo <b>Comentario</b> es requerido para esta operación';
/* ------ */
$most_resp = $_POST['mostrar_resp'];
$fecha = time();
//
if($data['post_user']){
if($data['post_block_comments'] != 1 || $data['post_user'] == $tsUser->uid || $tsUser->is_admod || $tsUser->permisos['mocepc']){
if(empty($tsUser->is_admod) && $tsUser->permisos['gopcp'] == false) return '0: No deberías hacer estas pruebas.';
// ANTI FLOOD
$tsCore->antiFlood();
$_SERVER['REMOTE_ADDR'] = $_SERVER['X_FORWARDED_FOR'] ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
if(!filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP)) { die('0: Su ip no se pudo validar.'); }
if(db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO `p_comentarios` (`c_post_id`, `c_user`, `c_date`, `c_body`, `c_ip`) VALUES (\''.(int)$post_id.'\', \''.$tsUser->uid.'\', \''.$fecha.'\', \''.$comentario.'\', \''.$_SERVER['REMOTE_ADDR'].'\')')) {
$cid = db_exec('insert_id');
//SUMAMOS A LAS ESTADÍSTICAS
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE w_stats SET stats_comments = stats_comments + 1 WHERE stats_no = \'1\'');
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE p_posts SET post_comments = post_comments + 1 WHERE post_id = \''.(int)$post_id.'\'');
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE u_miembros SET user_comentarios = user_comentarios + 1 WHERE user_id = \''.$tsUser->uid.'\'');
// NOTIFICAR SI FUE CITADO Y A LOS QUE SIGUEN ESTE POST, DUEÑO
$this->quoteNoti($post_id, $data['post_user'], $cid, $comentario);
// ACTIVIDAD
$tsActividad->setActividad(5, $post_id);
// array(comid, comhtml, combbc, fecha, autor_del_post)
if(!empty($most_resp)) return array($cid, $tsCore->parseBadWords($tsCore->parseBBCode($comentario), true),$comentario, $fecha, $_POST['auser'], '', $_SERVER['REMOTE_ADDR']);
else return '1: Tu comentario fue agregado satisfactoriamente.';
} else return '0: Ocurrió un error inténtalo más tarde.';
} else return '0: El post se encuentra cerrado y no se permiten comentarios.';
} else return '0: El post no existe.';
}
Reemplazar por:
Código PHP:
/*
newComentario()
*/
function newComentario(){
global $tsCore, $tsUser, $tsActividad;
// NO MAS DE 1500 CARACTERES PUES NADIE COMENTA TANTO xD
$comentario = substr($_POST['comentario'],0,1500);
$post_id = ($_POST['postid']);
$anon = $tsUser->uid > 0 ? NULL : 1;
/* COMENTARIOS DE VISITANTES */
if($anon){
if(filter_var($_POST['em'], FILTER_VALIDATE_EMAIL))
$anon = serialize(array('email' => $tsCore->setSecure($_POST['em']), 'name' => $tsCore->setSecure($_POST['na'])));
elseif(empty($_POST['em']) || empty($_POST['na']))
return '0: Rellene todos los campos';
else
return '0: Introduzca un email válido';
}
/* DE QUIEN ES EL POST */
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT post_user, post_block_comments FROM p_posts WHERE post_id = \''.(int)$post_id.'\' LIMIT 1');
$data = db_exec('fetch_assoc', $query);
/* COMPROBACIONES */
$tsText = preg_replace('# +#',"",$comentario);
$tsText = str_replace("\n","",$tsText);
if($tsText == '') return '0: El campo <b>Comentario</b> es requerido para esta operación';
/* ------ */
$most_resp = $_POST['mostrar_resp'];
$fecha = time();
//
if($data['post_user']){
if($data['post_block_comments'] != 1 || $data['post_user'] == $tsUser->uid || $tsUser->is_admod || $tsUser->permisos['mocepc']){
if(empty($tsUser->is_admod) && $tsUser->permisos['gopcp'] == false && $anon == NULL) return '0: No deberías hacer estas pruebas.';
// ANTI FLOOD
$tsCore->antiFlood();
$_SERVER['REMOTE_ADDR'] = $_SERVER['X_FORWARDED_FOR'] ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
if(!filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP)) { die('0: Su ip no se pudo validar.'); }
if(db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO `p_comentarios` (`c_post_id`, `c_user`, `c_date`, `c_body`, `c_ip`, `c_anon`) VALUES (\''.(int)$post_id.'\', \''.$tsUser->uid.'\', \''.$fecha.'\', \''.$comentario.'\', \''.$_SERVER['REMOTE_ADDR'].'\', \''.$anon.'\')')) {
$cid = db_exec('insert_id');
//SUMAMOS A LAS ESTADÍSTICAS
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE w_stats SET stats_comments = stats_comments + 1 WHERE stats_no = \'1\'');
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE p_posts SET post_comments = post_comments + 1 WHERE post_id = \''.(int)$post_id.'\'');
if($anon == NULL)
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE u_miembros SET user_comentarios = user_comentarios + 1 WHERE user_id = \''.$tsUser->uid.'\'');
// NOTIFICAR SI FUE CITADO Y A LOS QUE SIGUEN ESTE POST, DUEÑO
$this->quoteNoti($post_id, $data['post_user'], $cid, $comentario);
// ACTIVIDAD
$tsActividad->setActividad(5, $post_id);
// array(comid, comhtml, combbc, fecha, autor_del_post)
if(!empty($most_resp)) return array($cid, $tsCore->parseBadWords($tsCore->parseBBCode($comentario), true),$comentario, $fecha, $_POST['auser'], '', $_SERVER['REMOTE_ADDR'], $tsCore->setSecure($_POST['na']));
else return '1: Tu comentario fue agregado satisfactoriamente.';
} else return '0: Ocurrió un error inténtalo más tarde.';
} else return '0: El post se encuentra cerrado y no se permiten comentarios.';
} else return '0: El post no existe.';
}
En c.core.php --> inc --> class --> c.core.php
Buscar:
Código PHP:
$limit = $tsUser->permisos['goaf'];
Reemplazar por:
Código PHP:
$limit = empty($tsUser->permisos['goaf']) ? 60 : $tsUser->permisos['goaf'];
En t.posts.tpl --> themes --> default --> templates --> t.posts.tpl
Buscar:
Código PHP:
{if !$tsUser->is_member}
<div class="emptyData clearfix">
Para poder comentar necesitas estar <a onclick="registro_load_form(); return false" href="">Registrado.</a> O.. ya tienes usuario? <a onclick="open_login_box('open')" href="#">Logueate!</a>
</div>
{elseif $tsPost.block > 0}
<div class="emptyData clearfix">
¿Te has portado mal? {$tsPost.user_name} te ha bloqueado y no podrás comentar sus post.
</div>
{/if}
Reemplazar por:
Código PHP:
{if $tsPost.block > 0}
<div class="emptyData clearfix">
¿Te has portado mal? {$tsPost.user_name} te ha bloqueado y no podrás comentar sus post.
</div>
{/if}
En m.post_comments.tpl --> themes --> default --> templates --> modules --> m.post_comments.tpl
Buscar:
Código PHP:
{elseif $tsUser->is_admod == 0 && $tsUser->permisos.gopcp == false}
Reemplazar por:
Código PHP:
{elseif $tsUser->is_admod == 0 && $tsUser->permisos.gopcp == false && $tsUser->is_member}
Buscar:
Código PHP:
{elseif $tsUser->is_member && ($tsPost.post_block_comments != 1 || $tsPost.post_user == $tsUser->uid || $tsUser->is_admod || $tsUser->permisos.gopcp) && $tsPost.block == 0}
Reemplazar por:
Código PHP:
{elseif ($tsPost.post_block_comments != 1 || $tsPost.post_user == $tsUser->uid || $tsUser->is_admod || $tsUser->permisos.gopcp) && $tsPost.block == 0}
En m.post_comments_form.tpl --> themes --> default --> templates --> modules --> m.post_comments_form.tpl
Buscar:
Código PHP:
<textarea id="body_comm" class="onblur_effect autogrow" tabindex="1" title="Escribir un comentario..." style="resize:none;" onfocus="onfocus_input(this)" onblur="onblur_input(this)">Escribir un comentario...</textarea>
Arriba agregar:
Código PHP:
{if !$tsUser->is_member}
<input type="text" id="na" name="na" placeholder="Nombre" />
<input type="text" id="em" name="em" placeholder="Email" />
{/if}
En p.comentario.ajax.tpl --> themes --> default --> templates --> t.php_files --> p.comentario.ajax.tpl
Buscar:
Código PHP:
<a href="{$tsConfig.url}/perfil/{$c.user_name}" class="nick">{$c.user_name}</a> {if $tsUser->is_admod}(<span style="color:red;">IP:</span> <a href="{$tsConfig.url}/moderacion/buscador/1/1/{$c.c_ip}" class="geoip" target="_blank">{$c.c_ip}</a>){/if} dijo
Reemplazar por:
Código PHP:
{if $c.anon}<b>{$c.user_name}</b> {if $tsUser->is_admod}({$c.user_email}){if $tsUser->is_admod}(<span style="color:red;">IP:</span> <a href="{$tsConfig.url}/moderacion/buscador/1/1/{$c.c_ip}" class="geoip" target="_blank">{$c.c_ip}</a>){/if}{/if}{else}<a href="{$tsConfig.url}/perfil/{$c.user_name}" class="nick">{$c.user_name}</a> {if $tsUser->is_admod}(<span style="color:red;">IP:</span> <a href="{$tsConfig.url}/moderacion/buscador/1/1/{$c.c_ip}" class="geoip" target="_blank">{$c.c_ip}</a>){/if}{/if} dijo
Buscar:
Código PHP:
{if $tsUser->is_member}
<div class="floatR answerOptions" id="opt_{$c.cid}">
Reemplazar por:
Código PHP:
{if !$tsUser->is_member}
<div class="floatR answerOptions" id="opt_{$c.cid}">
<ul id="ul_cmt_{$c.cid}">
{*if $tsUser->info.user_rango || $tsUser->info.user_rango_post != 3*}
<li class="numbersvotes" {if $c.c_votos == 0}style="display: none"{/if}>
<div class="overview">
<span class="{if $c.c_votos >= 0}positivo{else}negativo{/if}" id="votos_total_{$c.cid}">{if $c.c_votos != 0}{if $c.c_votos >= 0}+{/if}{$c.c_votos}{/if}</span>
</div>
</li>
</ul>
</div>
{/if}
{if $tsUser->is_member}
<div class="floatR answerOptions" id="opt_{$c.cid}">
En p.comentario.preview.tpl --> themes --> default --> templates --> t.php_files --> p.comentario.preview.tpl
Buscar:
Código PHP:
<a href="{$tsConfig.url}/perfil/{$tsUser->nick}" class="nick">{$tsUser->nick}</a> {if $tsUser->is_admod}(<span style="color:red;">IP:</span> <a href="{$tsConfig.url}/moderacion/buscador/1/1/{$tsComment.6}" class="geoip" target="_blank">{$tsComment.6}</a>){/if} dijo
Reemplazar por:
Código PHP:
{if $tsUser->is_member}<a href="{$tsConfig.url}/perfil/{$tsUser->nick}" class="nick">{$tsUser->nick}</a>{else}<b>{$tsComment.7}</b>{/if} {if $tsUser->is_admod}(<span style="color:red;">IP:</span> <a href="{$tsConfig.url}/moderacion/buscador/1/1/{$tsComment.6}" class="geoip" target="_blank">{$tsComment.6}</a>){/if} dijo
En funciones.js --> themes --> default --> js --> funciones.js
Buscar:
Código PHP:
data: 'comentario=' + encodeURIComponent(text) + '&postid=' + gget('postid') + '&mostrar_resp=' + mostrar_resp + '&auser=' + auser,
Reemplazar por:
Código PHP:
data: 'comentario=' + encodeURIComponent(text) + '&postid=' + gget('postid') + '&mostrar_resp=' + mostrar_resp + '&auser=' + auser + '&em=' + $('#em').val() + '&na=' + $('#na').val(),
Buscar:
Código PHP:
data: 'comentario=' + encodeURIComponent(text) + '&auser=' + auser,
Reemplazar por:
Código PHP:
data: 'comentario=' + encodeURIComponent(text) + '&auser=' + auser + '&na=' + $('#na').val(),
Creditos: aperpen
Capturas
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
En c.registro.php --> inc --> class --> c.registro.php
Buscar:
Código PHP:
// INSERTAMOS EL PERFIL
db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO `u_perfil` (`user_id`, `user_dia`, `user_mes`, `user_ano`, `user_pais`, `user_estado`, `user_sexo`) VALUES (\''.(int)$tsData['user_id'].'\', \''.(int)$tsData['user_dia'].'\', \''.(int)$tsData['user_mes'].'\', \''.(int)$tsData['user_anio'].'\', \''.$tsCore->setSecure($tsData['user_pais']).'\', \''.$tsCore->setSecure($tsData['user_estado']).'\', \''.(int)$tsData['user_sexo'].'\')');
db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO `u_portal` (`user_id`) VALUES (\''.$tsData['user_id'].'\')');
Debajo agregar:
Código PHP:
// AVATAR ALEATORIO
$number=rand(0,10);
if($tsData['user_sexo'] != 'f'){
$name=$number.'.jpg';
$namemini=$number.'.jpg';
}else{
$name=$number.'.png';
$namemini=$number.'.png';
}
copy('../../files/avatar/registro/'.$name.'','../../files/avatar/'.$tsData['user_id'].'_120.jpg');
copy('../../files/avatar/registro/mini/'.$namemini.'','../../files/avatar/'.$tsData['user_id'].'_50.jpg');
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE u_perfil SET p_avatar= 1 WHERE user_id = \''.$tsData['user_id'].'\'');
Y subir esta carpeta
Mega
http://Registrate o inicia tu sesión par... contenido
Google Drive
http://Registrate o inicia tu sesión par... contenido
Mediafire
http://Registrate o inicia tu sesión par... contenido
Creditos: Tron y Taringra
Capturas
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
En c.cuenta.php --> inc --> class --> c.cuenta.php
Buscar:
Código PHP:
$q3 = db_exec('fetch_row', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT COUNT(cid) AS c FROM p_comentarios WHERE c_user = \''.(int)$user_id.'\' && c_status = \'0\''));
Debajo agregar:
Código PHP:
$q4 = db_exec('fetch_row', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT COUNT(t_id) AS t FROM c_temas LEFT JOIN c_comunidades ON c_id = t_comunidad WHERE t_autor = \''.(int)$user_id.'\' && t_estado = \'0\' && c_estado = \'0\''));
$data['stats']['user_temas'] = $q4[0];
En m.perfil_headinfo.tpl --> themes --> default --> templates --> modules --> m.perfil_headinfo.tpl
Buscar:
Código PHP:
<li>
<strong>{$tsInfo.stats.user_fotos}</strong>
<span>Fotos</span>
</li>
Debajo agregar:
Código PHP:
<li>
<strong>{$tsInfo.stats.user_temas}</strong>
<span>{if $tsInfo.stats.user_temas == 1}Tema {else} Temas{/if}</span>
</li>
Creditos: Kmario19
Capturas
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
En header.php
Buscar:
Código PHP:
// Mensajes
$smarty->assign('tsMPs',$tsMP->mensajes);
Debajo agregar:
Código PHP:
$smarty->assign("tsStats",$tsCore->getEstadisticas());
En c.core.php --> inc --> class --> c.core.php
Al final antes de la ultima llave } agregar:
Código PHP:
function getEstadisticas(){
// 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()-($this->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() - ($this->settings['c_last_active'] * 60));
// USUARIOS ONLINE - COMPROBAMOS SI CONTAMOS A TODOS LOS USUARIOS O SOLO A REGISTRADOS
if(empty($this->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;
}
Creditos: Kmario19
Captura
[img]Registrate o inicia tu sesión para ver este contenido[/img]
Importar la tabla a la base de datos
Mega
http://Registrate o inicia tu sesión par... contenido
En c.posts.php --> inc --> class --> c.posts.php
Buscar:
Código PHP:
// DATOS DEL POST
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT c.* ,m.*, u.user_id FROM `p_posts` AS c LEFT JOIN `u_miembros` AS u ON c.post_user = u.user_id LEFT JOIN `u_perfil` AS m ON c.post_user = m.user_id WHERE `post_id` = \''.(int)$post_id.'\' '.($tsUser->is_admod && $tsCore->settings['c_see_mod'] == 1 ? '' : 'AND u.user_activo = \'1\' && u.user_baneado = \'0\'').' LIMIT 1');
Debajo agregar:
Código PHP:
if(!$tsUser->is_member){
$ip = $tsCore->getIP();
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT ip,total FROM visitors WHERE ip =\''.$ip.'\'');
$dato = db_exec('fetch_assoc', $query);
if($dato['ip']==$ip){
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE visitors SET total = total + 1 WHERE ip = \''.$ip.'\'');
}else{
$sql = "INSERT INTO visitors (ip,id_post,total) VALUES ('{$ip}','{$post_id}',1)";
$result = db_exec(array(__FILE__, __LINE__), 'query', $sql);
}
}
Buscar:
Código PHP:
if(!empty($tsDraft['b_title'])) return array('deleted','Oops! Este post no existe o fue eliminado.');
else return array('deleted','Oops! El post fue eliminado!');
}
Debajo agregar:
Código PHP:
elseif($dato['total'] > 2) return array('deleted','deberás registrarte para continuar en los posts.');
Creditos: Tron
Captura
[img]Registrate o inicia tu sesión para ver este contenido[/img]
En c.posts.php --> inc --> class --> c.posts.php
Al final antes de la última } agregar:
Código PHP:
/**
* Verifica si el usuario actual ha votado este post
* @param int $post_id
* @return int|null Retorna los puntos dados o null si no ha votado
*/
public function getVoto(int $post_id): ?int
{
global $tsUser;
// Si no está logueado, no puede haber votado
if (empty($tsUser->uid)) {
return null;
}
$query = db_exec(
[__FILE__, __LINE__],
'query',
"SELECT cant FROM p_votos WHERE tid = $post_id AND tuser = {$tsUser->uid} AND type = '1' LIMIT 1"
);
$data = db_exec('fetch_assoc', $query);
// Retorna el entero de puntos o null si no existe el registro
return ($data && isset($data['cant'])) ? (int)$data['cant'] : null;
}
En posts.php --> inc --> php --> posts.php
Buscar:
Código PHP:
// DATOS DEL RANGO DEL PUTEADOR
$smarty->assign("tsPunteador",$tsPosts->getPunteador());
Debajo agregar:
Código PHP:
// VOTOS DEL POSTS
$smarty->assign("tsVoto", $tsPosts->getVoto((int)$tsPost['post_id']));
En m.posts_metadata.tpl --> themes --> default --> templates --> modules --> m.posts_metadata.tpl
Buscar:
Código PHP:
<span>Dar Puntos:</span>
{section name=puntos start=1 loop=$tsUser->info.user_puntosxdar+1 max=$tsPunteador.rango}
<a href="#" onclick="votar_post({$smarty.section.puntos.index}); return false;">{$smarty.section.puntos.index}</a> {if $smarty.section.puntos.index < $tsPunteador.rango}-{/if}
{/section}
{/if}
(de {$tsUser->info.user_puntosxdar} Disponibles)
Reemplazar por:
Código PHP:
{if $tsVoto !== null}
<div class="votod">Ya diste {$tsVoto} puntos en este post</div>
{else}
<span>Dar Puntos:</span>
{section name=puntos start=1 loop=$tsUser->info.user_puntosxdar+1 max=$tsPunteador.rango}
<a href="#" onclick="votar_post({$smarty.section.puntos.index}); return false;">
{$smarty.section.puntos.index}
</a>
{if !$smarty.section.puntos.last}-{/if}
{/section}
(de {$tsUser->info.user_puntosxdar} Disponibles)
{/if}
Capturas
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
Ejecutar esta consulta
Código PHP:
ALTER TABLE `p_categorias` ADD `c_color` varchar(6) NOT NULL DEFAULT '005CA5';
En c.admin.php --> inc --> class --> c.admin.php
Buscar:
Código PHP:
function getCat()
{
global $tsCore;
//
//$db = $this->getDBtypes();
$cid = intval($_GET['cid']);
//
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT cid, c_orden, c_nombre, c_seo, c_img FROM p_categorias WHERE cid = \'' .
(int)$cid . '\' LIMIT 1');
$data = db_exec('fetch_assoc', $query);
//
return $data;
}
Antes del FROM agregar:
Código PHP:
, c_color
Resultado:
Código PHP:
function getCat()
{
global $tsCore;
//
//$db = $this->getDBtypes();
$cid = intval($_GET['cid']);
//
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT cid, c_orden, c_nombre, c_seo, c_img, c_color FROM p_categorias WHERE cid = \'' .
(int)$cid . '\' LIMIT 1');
$data = db_exec('fetch_assoc', $query);
//
return $data;
}
Buscar:
Código PHP:
function saveCat()
{
global $tsCore;
//
//$db = $this->getDBtypes();
$cid = $tsCore->setSecure($_GET['cid']);
//
$c_nombre = $tsCore->setSecure($tsCore->parseBadWords($_POST['c_nombre']));
$cimg = $tsCore->setSecure($tsCore->parseBadWords($_POST['c_img']));
if (db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE `p_categorias` SET c_nombre = \'' . $tsCore->setSecure($c_nombre) .
'\', c_seo = \'' . $tsCore->setSecure($tsCore->setSEO($c_nombre, true)) . '\', c_img = \'' .
$tsCore->setSecure($cimg) . '\' WHERE cid = \'' . (int)$cid . '\''))
return true;
}
Reemplazar por:
Código PHP:
function saveCat()
{
global $tsCore;
//
//$db = $this->getDBtypes();
$cid = $tsCore->setSecure($_GET['cid']);
//
$c_nombre = $tsCore->setSecure($tsCore->parseBadWords($_POST['c_nombre']));
$cimg = $tsCore->setSecure($tsCore->parseBadWords($_POST['c_img']));
$c_color = $tsCore->setSecure($tsCore->parseBadWords($_POST['c_color']));
if (db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE `p_categorias` SET c_nombre = \'' . $tsCore->setSecure($c_nombre) .
'\', c_seo = \'' . $tsCore->setSecure($tsCore->setSEO($c_nombre, true)) . '\', c_img = \'' .
$tsCore->setSecure($cimg) . '\', c_color = \'' . $tsCore->setSecure($c_color) .
'\' WHERE cid = \'' . (int)$cid . '\''))
return true;
}
Buscar:
Código PHP:
function newCat()
{
global $tsCore;
//
//$db = $this->getDBtypes();
// VALORES
$c_nombre = $tsCore->setSecure($tsCore->parseBadWords($_POST['c_nombre']));
$cimg = $tsCore->setSecure($tsCore->parseBadWords($_POST['c_img']));
// ORDEN
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT COUNT(cid) AS total FROM `p_categorias`');
$orden = db_exec('fetch_assoc', $query);
$orden = $orden['total'] + 1;
// INSERTS
if (db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO `p_categorias` (`c_orden`, `c_nombre`, `c_seo`, `c_img`) VALUES (\'' .
$orden . '\', \'' . $c_nombre . '\',\'' . $tsCore->setSEO($c_nombre, true) . '\', \'' .
$cimg . '\')'))
return true;
}
Reemplazar por:
Código PHP:
function newCat()
{
global $tsCore;
//
//$db = $this->getDBtypes();
// VALORES
$c_nombre = $tsCore->setSecure($tsCore->parseBadWords($_POST['c_nombre']));
$cimg = $tsCore->setSecure($tsCore->parseBadWords($_POST['c_img']));
$c_color = $tsCore->setSecure($tsCore->parseBadWords($_POST['c_color']));
// ORDEN
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT COUNT(cid) AS total FROM `p_categorias`');
$orden = db_exec('fetch_assoc', $query);
$orden = $orden['total'] + 1;
// INSERTS
if (db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO `p_categorias` (`c_orden`, `c_nombre`, `c_seo`, `c_img`, `c_color`) VALUES (\'' .
$orden . '\', \'' . $c_nombre . '\',\'' . $tsCore->setSEO($c_nombre, true) . '\', \'' .
$cimg . '\', \'' . $c_color . '\')'))
return true;
}
En c.posts.php --> inc --> class --> c.posts.php
Buscar:
Código PHP:
/*********/
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT p.post_id, p.post_user, p.post_category, p.post_title, p.post_date, p.post_comments, p.post_puntos, p.post_private, p.post_sponsored, p.post_status, p.post_sticky, u.user_id, u.user_name, u.user_activo, u.user_baneado, c.c_nombre, c.c_seo, c.c_img FROM p_posts AS p LEFT JOIN u_miembros AS u ON p.post_user = u.user_id '.($tsUser->is_admod && $tsCore->settings['c_see_mod'] == 1 ? '' : ' && u.user_activo = \'1\' && u.user_baneado = \'0\'').' LEFT JOIN p_categorias AS c ON c.cid = p.post_category WHERE '.($tsUser->is_admod && $tsCore->settings['c_see_mod'] == 1 ? 'p.post_id > 0' : 'p.post_status = \'0\' && u.user_activo = \'1\' && u.user_baneado = \'0\'').' '.$c_where.' '.$s_where.' GROUP BY p.post_id ORDER BY '.$s_order.' DESC LIMIT '.$start);
$lastPosts['data'] = result_array($query);
Antes del FROM agregar:
Código PHP:
, c.c_color
Resultado:
Código PHP:
/*********/
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT p.post_id, p.post_user, p.post_category, p.post_title, p.post_date, p.post_comments, p.post_puntos, p.post_private, p.post_sponsored, p.post_status, p.post_sticky, u.user_id, u.user_name, u.user_activo, u.user_baneado, c.c_nombre, c.c_seo, c.c_img, c.c_color FROM p_posts AS p LEFT JOIN u_miembros AS u ON p.post_user = u.user_id '.($tsUser->is_admod && $tsCore->settings['c_see_mod'] == 1 ? '' : ' && u.user_activo = \'1\' && u.user_baneado = \'0\'').' LEFT JOIN p_categorias AS c ON c.cid = p.post_category WHERE '.($tsUser->is_admod && $tsCore->settings['c_see_mod'] == 1 ? 'p.post_id > 0' : 'p.post_status = \'0\' && u.user_activo = \'1\' && u.user_baneado = \'0\'').' '.$c_where.' '.$s_where.' GROUP BY p.post_id ORDER BY '.$s_order.' DESC LIMIT '.$start);
$lastPosts['data'] = result_array($query);
En m.admin_cats.tpl --> themes --> default --> templates --> admin_mods --> m.admin_cats.tpl
Buscar:
Código PHP:
<p><input type="submit" name="save" value="Guardar cambios" class="btn_g"/ ></p>
Arriba agregar:
Código PHP:
<dl>
<dt><label for="cat_name">Color de la categoría:</label></dt>
<dd><input type="text" maxlength="6" id="cat_name"name="c_color" value="{$tsCat.c_color}" /></dd>
</dl>
Buscar:
Código PHP:
<p><input type="submit" name="save" value="Crear Categoría" class="btn_g"/></p>
Arriba agregar:
Código PHP:
<dl>
<dt><label for="cat_name">Color de la categoría:</label></dt>
<dd><input type="text" maxlength="6" id="cat_name"name="c_color" value="" /></dd>
</dl>
En m.home_last_posts.tpl --> themes --> default --> templates --> modules --> m.home_last_posts.tpl
Buscar 2 veces:
Código PHP:
href="{$tsConfig.url}/posts/{$p.c_seo}/{$p.post_id}/{$p.post_title|seo}.html"
Y agregar al lado:
Código PHP:
style="color:#{$p.c_color};"
Resultado:
Código PHP:
href="{$tsConfig.url}/posts/{$p.c_seo}/{$p.post_id}/{$p.post_title|seo}.html" style="color:#{$p.c_color};"
Creditos: vellenger

