Últimos temas
-
Cómo funcionan las Mision...
Foro: Guías y Tutoriales
Último mensaje por: Tronlar
Ayer, 09:46 PM
» Respuestas: 0
» Vistas: 60 -
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,661 -
Preguntas Frecuentes y So...
Foro: Guías y Tutoriales
Último mensaje por: Tronlar
06-12-2026, 06:17 PM
» Respuestas: 0
» Vistas: 58 -
Cómo registrar tu comunid...
Foro: Guías y Tutoriales
Último mensaje por: Tronlar
06-12-2026, 05:32 PM
» Respuestas: 0
» Vistas: 51 -
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
Esta línea está en c.posts.php --> inc --> class --> c.posts.php en la función getPost. (esta consulta actualiza la fecha de visita del usuario logueado al post)
Código PHP:
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE `w_visitas` SET `date` = \''.time().'\', ip = \''.$tsCore->getIP().'\' WHERE `for` = \''.(int)$post_id.'\' && `type` = \'2\' && `user` = \''.$tsUser->uid.'\' LIMIT 1');
El problema es que después de que el sitio tenga suficiente tiempo online o muchísimas visitas, esta tabla w_visitas llega a tener millones de registros y cuando una tabla así no está indexada tiende a hacer una consulta "FULL SCAN" por lo que básicamente tiene que recorrer todos los registros para poder finalizar su tarea, y en el caso del sitio de pruebas tiene más de 2 millones de registros.
Entonces, para todos aquellos que quieran evitar este pequeño problema de rendimiento a futuro cuando tengan muchas visitas o si ya se les presenta el caso, la solución es ir a su base de datos y ejecutar la siguiente consulta:
Código PHP:
ALTER TABLE `w_visitas` ADD INDEX (`for`, `type`, `user`);
Y listo, eso soluciona el problema.
Para que se hagan una idea de los resultados, esta es una consulta antes de agregar el indice:
[img]Registrate o inicia tu sesión para ver este contenido[/img]
Y esta es la misma consulta después de agregar el índice:
[img]Registrate o inicia tu sesión para ver este contenido[/img]
Estamos hablando de una absurda reducción de 91150% de acuerdo al tiempo de ejecución de MySQL pero realmente pasamos a un tiempo de carga del sitio de unos 6 segundos aprox. a menos de 1 segundo.
Bueno, es un índice que debería ir por defecto en el .sql con el que se instala el script para evitar ese inconveniente a futuro. Seguramente algunas otras secciones críticas del script con el pasar del tiempo y vayan creciendo necesitarán de estos índices para mejorar los tiempos de consulta de la base de datos.
Creditos: Kmario19
[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]
En c.posts.php --> inc --> class --> c.posts.php
Buscar:
Código PHP:
// ES SU POST EL Q INTENTA BORRAR?
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT post_id, post_title, post_user, post_body, post_category FROM p_posts WHERE post_id = \''.(int)$post_id.'\' AND post_user = \''.$tsUser->uid.'\'');
$data = db_exec('fetch_assoc', $query);
Reemplazar por:
Código PHP:
// ES SU POST EL Q INTENTA BORRAR?
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT post_id, post_title, post_user, post_body, post_puntos, post_category FROM p_posts WHERE post_id = \''.(int)$post_id.'\' AND post_user = \''.$tsUser->uid.'\'');
$data = db_exec('fetch_assoc', $query);
Buscar:
Código PHP:
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE `u_miembros` SET `user_posts` = user_posts - \'1\' WHERE `user_id` = \''.$data['post_user'].'\'');
Debajo agregar:
Código PHP:
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE `u_miembros` SET `user_puntos` = user_puntos - \''.$data['post_puntos'].'\' WHERE `user_id` = \''.$data['post_user'].'\'');
En c.moderacion.php --> inc --> class --> c.moderacion.php
Buscar:
Código PHP:
// ENVIAR AVISO
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT p.post_user, p.post_title, p.post_body, p.post_tags, p.post_category, u.user_name, u.user_email FROM p_posts AS p LEFT JOIN u_miembros AS u ON p.post_user = u.user_id WHERE p.post_id = \'' .
(int)$pid . '\' LIMIT 1');
Reemplazar por:
Código PHP:
// ENVIAR AVISO
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT p.post_user, p.post_title, p.post_body, p.post_tags, p.post_puntos, p.post_category, u.user_id, u.user_name, u.user_email FROM p_posts AS p LEFT JOIN u_miembros AS u ON p.post_user = u.user_id WHERE p.post_id = \'' .
(int)$pid . '\' LIMIT 1');
Buscar:
Código PHP:
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE `w_stats` SET `stats_posts` = stats_posts - \'1\' WHERE `stats_no` = \'1\'');
Debajo agregar:
Código PHP:
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE `u_miembros` SET `user_puntos` = user_puntos - \''.$data['post_puntos'].'\' WHERE `user_id` = \''.$data['post_user'].'\'');
Creditos: Vellenger
[img]Registrate o inicia tu sesión para ver este contenido[/img]
Ejecutar esta consulta
Código PHP:
ALTER TABLE `u_miembros` ADD `user_acces` INT NOT NULL
En c.user.php --> inc --> class --> c.user.php
Buscar:
Código PHP:
// HORA EN LA CUAL RECARGAR PUNTOS 0 = MEDIA NOCHE DEL SERVIDOR
$ultimaRecarga = $this->info['user_nextpuntos'];
$tiempoActual = time();
Debajo agregar:
Código PHP:
//////////ACCESO RESTRINGIDO EN LA ADMINISTRACION ADAPTADO POR TUTAN-KABRON////////
$tiempo = time();
$resultado= $tiempo;
$timeuser= $this->info['user_acces'] + 360;
if($timeuser < $resultado){
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE u_miembros SET user_acces = \'0\' WHERE user_id = \''.$this->uid.'\'');
}
//////////////////////FIN ACCESO/////////////////////////
Buscar:
Código PHP:
// NOMBRE
$this->nick = $this->info['user_name'];
$this->uid = $this->info['user_id'];
Debajo agregar:
Código PHP:
$this->acces = $this->info['user_acces'];
En c.admin.php --> inc --> class --> c.admin.php
Buscar:
Código PHP:
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
// ADMINISTRAR \\
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
Debajo agregar:
Código PHP:
/*
getSecure()
*/
function getSecure(){
global $tsUser,$tsCore;
//
$username= $tsCore->setSecure($_POST['username']);
$password= $tsCore->setSecure($_POST['pass']);
$username = strtolower($username);
$pp_password = md5(md5($password).strtolower($username));
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT user_name,user_password FROM u_miembros WHERE user_password = \''.$pp_password.'\' AND user_name = \''.$username.'\'');
//
$data = result_array($query);
$tiempo = time();
$resultado= $tiempo;
if($resultado=0){
$resultado=1;
}else{
$resultado= $tiempo;
}
if(!empty($data)){
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE u_miembros SET user_acces = '.$resultado.' WHERE user_id = '.$tsUser->uid.'');
}
return $data;
}
En admin.php --> inc --> php --> admin.php
Buscar:
Código PHP:
/**********************************\
* (INSTRUCCIONES DE CODIGO) *
\*********************************/
Debajo agregar:
Código PHP:
$smarty->assign("tsAcces",$tsAdmin->getSecure());
if(!empty($_POST['pass'])) {
$tsCore->redirectTo($tsCore->settings['url'].'/admin/');
}
En t.admin.tpl --> themes --> default --> templates --> t.admin.tpl
Buscar:
Código PHP:
{include file='sections/main_header.tpl'}
Debajo agregar:
Código PHP:
{if $tsUser->acces>0}
Buscar:
Código PHP:
<div style="clear:both"></div>
Debajo agregar:
Código PHP:
{else}
{include file='modules/m.acces.tpl'}
{/if}
Y subir esta carpeta
Mega
Google Drive
Mediafire
Creditos: tutan-kabron
[img]Registrate o inicia tu sesión para ver este contenido[/img]
En c.post.php --> inc --> class --> c.post.php
Buscar:
Código PHP:
/*
editComentario()
*/
Arriba agregar:
Código PHP:
/*
TOPs Punteador
*/
function tops_puntos(){
global $tsCore, $tsUser;
$query = db_exec(array(__FILE__, __LINE__), 'query', "SELECT * FROM u_miembros ORDER BY user_puntos DESC LIMIT 5");
$data = result_array($query);
//
return $data;
}
En post.php --> inc --> class --> post.php
Buscar:
Código PHP:
// AFILIADOS
$smarty->assign("tsAfiliados",$tsAfiliado->getAfiliados());
Debajo agregar:
Código PHP:
$smarty->assign("tsTOPs_p",$tsPosts->tops_puntos());
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_tops_puntos.tpl'}
Y subir esta carpeta
Mega
Google Drive
Mediafire
Creditos: Exedras
[img]Registrate o inicia tu sesión para ver este contenido[/img]
En c.tops.php --> inc --> class --> c.tops.php
Buscar:
Código PHP:
/*
getTopUsers()
*/
function getTopUsers($fecha, $cat){
//
$data = $this->setTime($fecha);
$category = empty($cat) ? '' : 'AND post_category = '.$cat;
// PUNTOS
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT SUM(p.post_puntos) AS total, u.user_id, u.user_name FROM p_posts AS p LEFT JOIN u_miembros AS u ON p.post_user = u.user_id WHERE p.post_status = 0 AND p.post_date ***** '.$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 ***** '.$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 ***** '.$data['start'].' AND '.$data['end'].' GROUP BY m.medal_for ORDER BY total DESC LIMIT 10');
$array['medallas'] = result_array($query);
//
return $array;
}
Antes del último
Código PHP:
//
Agregar:
Código PHP:
// POSTS
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT COUNT(p.post_id) 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 ***** '.$data['start'].' AND '.$data['end'].' '.$category.' GROUP BY p.post_user ORDER BY total DESC LIMIT 10');
$array['posts'] = result_array($query);
Tiene que quedar así:
Código PHP:
/*
getTopUsers()
*/
function getTopUsers($fecha, $cat){
//
$data = $this->setTime($fecha);
$category = empty($cat) ? '' : 'AND post_category = '.$cat;
// PUNTOS
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT SUM(p.post_puntos) AS total, u.user_id, u.user_name FROM p_posts AS p LEFT JOIN u_miembros AS u ON p.post_user = u.user_id WHERE p.post_status = 0 AND p.post_date ***** '.$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 ***** '.$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 ***** '.$data['start'].' AND '.$data['end'].' GROUP BY m.medal_for ORDER BY total DESC LIMIT 10');
$array['medallas'] = result_array($query);
// POSTS
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT COUNT(p.post_id) 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 ***** '.$data['start'].' AND '.$data['end'].' '.$category.' GROUP BY p.post_user ORDER BY total DESC LIMIT 10');
$array['posts'] = result_array($query);
//
return $array;
}
En m.top_users.tpl --> themes --> default --> templates --> modules --> m.top_users.tpl
Buscar:
Código PHP:
<!--MEDALLAS-->
Arriba agregar:
Código PHP:
<!--POSTS-->
<div class="boxy xtralarge" style="height: 440px">
<div class="boxy-title">
<h3>Top usuario con más posts</h3>
<span class="icon-noti follow-n"></span>
</div>
<div class="boxy-content">
{if !$tsTops.posts}<div class="emptyData">Nada por aqui</div>
{else}
<ol>
{foreach from=$tsTops.posts item=p}
<li class="categoriaUsuario clearfix">
<img width="16" height="16" src="{$tsConfig.url}/files/avatar/{$p.user_id}_50.jpg"/>
<a href="{$tsConfig.url}/perfil/{$p.user_name}">{$p.user_name}</a> <span class="qtip" title="tiene un total de {$p.total} Posts">{$p.total}</span>
</li>
{/foreach}
</ol>
{/if}
</div>
</div>
Creditos: Nico
[img]Registrate o inicia tu sesión para ver este contenido[/img]
En c.posts.php --> inc --> class --> c.posts.php
Buscar:
Código PHP:
/*
editComentario()
*/
Arriba agregar:
Código PHP:
/*
TOPs Seguidore
*/
function tops_seguidores(){
global $tsCore, $tsUser;
$query = db_exec(array(__FILE__, __LINE__), 'query', "SELECT * FROM u_miembros ORDER BY user_seguidores DESC LIMIT 7");
$data = result_array($query);
//
return $data;
}
En post.php --> inc --> class --> post.php
Buscar:
Código PHP:
// AFILIADOS
$smarty->assign("tsAfiliados",$tsAfiliado->getAfiliados());
Debajo agregar:
Código PHP:
$smarty->assign("tsTOPs_s",$tsPosts->tops_seguidores());
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_tops_seguidores.tpl'}
Y subir esta carpeta
Mega
Google Drive
Mediafire
Creditos: Vellenger
[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]
Ejecutar esta consulta
Código PHP:
ALTER TABLE w_configuracion ADD actnot int(1) NOT NULL DEFAULT '0', ADD titlenot varchar(100) NOT NULL, ADD infonot varchar(350) NOT NULL, ADD timenot int(1) NOT NULL DEFAULT '1';
En c.admin.php --> inc --> class --> c.admin.php
Buscar:
Código PHP:
'offline_message' => $tsCore->setSecure($tsCore->parseBadWords($_POST['offline_message'])),
Debajo agregar:
Código PHP:
'actnot' => empty($_POST['actnot']) ? 0 : 1,
'titlenot' => $tsCore->setSecure($tsCore->parseBadWords($_POST['titlenot'])),
'infonot' => $tsCore->setSecure($tsCore->parseBadWords($_POST['infonot'])),
'timenot' => $tsCore->setSecure($_POST['timenot']),
Buscar:
Código PHP:
`offline_message` = \'' . $c['offline_message'] . '\'
Al lado agregar:
Código PHP:
, `actnot` = \'' . $c['actnot'] . '\' , `titlenot` = \'' . $c['titlenot'] . '\' , `infonot` = \'' . $c['infonot'] . '\' , `timenot` = \'' . $c['timenot'] . '\'
En t.home.tpl --> themes --> default --> templates --> t.home.tpl
Buscar:
Código PHP:
{include file='sections/main_footer.tpl'}
Arriba agregar:
Código PHP:
{if $tsConfig.actnot == 1}
<div class="boxvell">
<span class="titlenot"><h2>{$tsConfig.titlenot}</h2></span>
<div style="margin:5px">{$tsConfig.infonot}</div>
</div>
{/if}
En m.admin_configs.tpl --> themes --> default --> templates --> admin_mods --> m.admin_configs.tpl
Buscar:
Default y V5
Código PHP:
<dl>
<dt>
<label for="ai_chat">Chatango ID:</label>
<br /><span>Por defecto puedes agregar un chat de <a href="Registrate o inicia tu sesión para ver este contenido">Chatango</a> para tu web, solo crea tu grupo he ingresa el nombre. (Dejar vacío para usar xat)</span></dt>
<dd>
<input type="text" id="ai_chat" name="chat" maxlength="20" value="{$tsConfig.chat_id}" /> </dd>
</dl>
Arriba agregar:
Código PHP:
<hr>
<dl>
<dt><label for="actnot">Mensaje Temporal:</label><span>Este mensaje se mostrara de manera temporal.</span></dt>
<dd>
<label><input name="actnot" type="radio" id="actnot" value="1" {if $tsConfig.actnot == 1}checked="checked"{/if} class="radio"/> Sí</label>
<label><input name="actnot" type="radio" id="actnot" value="0" {if $tsConfig.actnot != 1}checked="checked"{/if} class="radio"/> No</label>
</dd>
</dl>
<dl>
<dt><label for="timenot">Tiempo:</label> <span>Indique la cantidad de segundos que se mostrara el mensaje.(<b>0</b> es permanente)</span></dt>
<dd><input type="text" onkeyup="var no_digito = /\D/g; this.value = this.value.replace(no_digito , '');" id="timenot" name="timenot" style="width:10%" maxlength="5" value="{$tsConfig.timenot}" /> segundos.</dd>
</dl>
<dl>
<dt><label for="titlenot">Título:</label><span>Indique el título del mensaje.</span></dt>
<dd><input type="text" maxlength="100" id="titlenot" name="titlenot" maxlength="20" value="{$tsConfig.titlenot}" /> </dd>
</dl>
<dl>
<dt><label for="infonot">Contenido del Mensaje:</label><span>Ingresar el mensaje (max. 350 caracteres)</span></dt>
<dd><textarea style="width:300px;" maxlength="350" id="infonot" name="infonot">{$tsConfig.infonot}</textarea></dd>
</dl>
<hr>
V6
Buscar:
Código PHP:
<div class="boxblo">
<div class="desbox">
<label for="ai_chat">Chatango ID:</label>
<span class="foquito" onclick="mydialog.alert('Información','Por defecto puedes agregar un chat de <b>Chatango</b> para tu sitio<br/> solo crea tu grupo he ingresa el nombre.')"></span>
</div>
<input type="text" id="ai_chat" name="chat" maxlength="20" value="{$tsConfig.chat_id}" placeholder="Dejar vacío para usar xat"/>
</div>
Debajo agregar:
Código PHP:
<div class="boxblo">
<div class="desbox">
<label for="actnot">Mensaje Temporal:</label>
<span class="foquito" onclick="mydialog.alert('Este mensaje se mostrara de manera temporal.')"></span>
</div>
<select name="actnot">
<option value="1" {if $tsConfig.actnot == 1}selected="selected"{/if}>Si</option>
<option value="0" {if $tsConfig.actnot != 1}selected="selected"{/if}>No</option>
</select>
</div>
<div class="boxblo" style="border-top: none;">
<div class="desbox">
<label for="timenot">Tiempo:</label>
<span class="foquito" onclick="mydialog.alert('Indique la cantidad de segundos que se mostrara el mensaje.(<b>0</b> es permanente)')"></span>
</div>
<input type="text" onkeyup="var no_digito = /\D/g; this.value = this.value.replace(no_digito , '');" id="timenot" name="timenot" style="width:10%" maxlength="5" value="{$tsConfig.timenot}" placeholder="segundos"/>
</div>
<div class="boxblo" style="border-top: none;">
<div class="desbox">
<label for="titlenot">Título:</label>
<span class="foquito" onclick="mydialog.alert('Indique el título del mensaje.')"></span>
</div>
<input type="text" maxlength="100" id="titlenot" name="titlenot" maxlength="20" value="{$tsConfig.titlenot}"/>
</div>
<div class="boxblo" style="border-top: none;">
<div class="desbox">
<label for="infonot">Contenido del Mensaje:</label>
<span class="foquito" onclick="mydialog.alert('Ingresar el mensaje (max. 350 caracteres)')"></span>
</div>
<textarea maxlength="350" id="infonot" name="infonot">{$tsConfig.infonot}</textarea>
</div>
En main_header.tpl --> themes --> default --> templates --> sections --> main_header.tpl
Buscar:
Código PHP:
</head>
Arriba agregar:
Código PHP:
{if $tsConfig.actnot == 1}
<script type="text/javascript">
{literal}
setTimeout(function(){$('.boxvell').fadeOut('fast')},{/literal}({if $tsConfig.timenot==0}10000{else}{$tsConfig.timenot}{/if}*1000){literal}); //30000 = 30 segundos
{/literal}
</script>
{/if}
En extras.css --> themes --> default --> extras.css
Al final agregar:
Código PHP:
.titlenot h2{font-size:14px;color:#f4ff74;text-decoration:underline}
.boxvell{position:fixed;bottom:0;right:200px;padding:10px;color:#fff;font-family:tahoma;font-size:11px;font-family:tahoma;font-size:11px;text-align:left;margin-bottom:17px;width:300px;background:url(Registrate o inicia tu sesión para ver este contenido 1px 1px rgba(0,0,0,.7);-moz-box-shadow:0 2px 7px rgba(0,0,0,.3);-webkit-box-shadow:0 2px 7px rgba(0,0,0,.3);box-shadow:0 2px 7px rgba(0,0,0,.3)}
Creditos: Vellenger
[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:
// MEDALLAS
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT m.*, a.* FROM w_medallas AS m LEFT JOIN w_medallas_assign AS a ON a.medal_id = m.medal_id WHERE a.medal_for = \''.(int)$user_id.'\' AND m.m_type = \'1\' ORDER BY a.medal_date DESC LIMIT 21');
$data['medallas'] = result_array($query);
$data['m_total'] = count($data['medallas']);
Debajo agregar:
Código PHP:
// ULTIMOS COMENTARIOS
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT cm.cid, cm.c_date, p.post_id, p.post_title, c.c_seo FROM p_comentarios AS cm LEFT JOIN p_posts AS p ON p.post_id = cm.c_post_id LEFT JOIN p_categorias AS c ON c.cid = p.post_category WHERE c_user = \''.(int)$user_id.'\' AND p.post_status = \'0\' AND cm.c_status = \'0\' ORDER BY cid DESC LIMIT 10');
$data['com'] = result_array($query);
En m.perfil_sidebar.tpl --> themes --> default --> templates --> admin_mods --> m.perfil_sidebar.tpl
Default y V5
Buscar:
Código PHP:
<div style="margin-bottom: 10px">
{$tsConfig.ads_300}
</div>
Debajo agregar:
Código PHP:
<div class="widget w-medallas clearfix">
<div class="title-w clearfix">
<h3>Últimos comentarios</h3>
<span>{$tsInfo.stats.user_comentarios}</span>
</div>
{if $tsInfo.stats.user_comentarios > 0}
<ul class="clearfix">
{foreach from=$tsGeneral.com item=c key=i}
<li>
<strong style="color: #36F;">{if $i <= 8}0{/if}{$i+1}. </strong>
<a style="" href="{$tsConfig.url}/posts/{$c.c_seo}/{$c.post_id}/{$c.post_title|seo}.html#pp_{$c.cid}" class="qtip size13" title="{$c.c_date|hace}">{$c.post_title|truncate:45}</a>
</li>
{/foreach}
</ul>
{else}
<div class="emptyData">No ha hecho comentarios.</div>
{/if}
</div>
V6
En t.perfil.tpl --> themes --> default --> templates --> t.perfil.tpl
Buscar:
Código PHP:
{include file='modules/m.perfil_medallas.tpl'}
Debajo agregar:
Código PHP:
{include file='modules/m.perfil_posts_comentados.tpl'}
Y subir esta carpeta
Mega
Google Drive
Mediafire
Creditos: Kmario19
[img]Registrate o inicia tu sesión para ver este contenido[/img]
Ejecutar estas consultas
Código PHP:
CREATE TABLE IF NOT EXISTS `u_muro_tags` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`p_id` int(11) NOT NULL,
`p_tags` varchar(35) NOT NULL,
`p_date` varchar(35) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ;
Código PHP:
CREATE TABLE IF NOT EXISTS `u_pins` (
`pid` int(11) NOT NULL AUTO_INCREMENT,
`p_user` int(11) NOT NULL,
`p_data` text NOT NULL,
`p_fecha` varchar(35) NOT NULL,
PRIMARY KEY (`pid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ;
En c.muro.php --> inc --> class --> c.muro.php
Buscar:
Código PHP:
//
$return['user_name'] = $tsUser->nick;
// MONITOR
$tsMonitor->setNotificacion(12, $pid, $tsUser->uid, $pub_id);
Arriba agregar:
Código PHP:
if(preg_match_all("/#([A-Za-z0-9_-ñÑçÇáÁäÄàÀâÂéÉëËèÈêÊíÍïÏìÌîÎóÓöÖòÒôÔúÚüÜùÙûÛ]+)/",$data,$tags)){
$tags2 = str_replace("006595",' ' ,$tags);
$hash = $tags2[1]; //Sin ##
foreach($hash as $tag){
$save_tags = "$tag";
if($save_tags=='006595'){ $save_tags='1';}
if($save_tags != '1'){
db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO `u_muro_tags` (`p_id`, `p_tags`, `p_date`) VALUES (\''.$pub_id.'\', \''.$save_tags.'\', \''.time().'\')');}
}}
Buscar:
Código PHP:
// MONITOR
$tsMonitor->setMuroRepost($pid, $pub['p_user'], $pub['p_user_pub']);
Arriba agregar:
Código PHP:
if(preg_match_all("/#([A-Za-z0-9_-ñÑçÇáÁäÄàÀâÂéÉëËèÈêÊíÍïÏìÌîÎóÓöÖòÒôÔúÚüÜùÙûÛ]+)/",$data,$tags)){
$tags2 = str_replace("006595",' ' ,$tags);
$hash = $tags2[1]; //Sin ##
foreach($hash as $tag){
$save_tags = "$tag";
if($save_tags=='006595'){ $save_tags='1';}
if($save_tags != '1'){
db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO `u_muro_tags` (`p_id`, `p_tags`, `p_date`) VALUES (\''.$pid.'\', \''.$save_tags.'\', \''.time().'\')');}
}}
En c.portal.php --> inc --> class --> c.portal.php
Buscar:
Código PHP:
/** getLastPosts()
* @access public
* @param string
* @return array
*/
Arriba agregar:
Código PHP:
//hashtags del momento
function hashtagsPops(){
global $tsCore, $tsUser;
$time = time() -(60*60*5); // son 5 horas
$q = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT id,p_date,p_tags,count(p_tags) AS total FROM `u_muro_tags` WHERE p_date >= '.$time.' GROUP BY p_tags order by total desc limit 5');
$data1 = result_array($q);
$q1 = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT id,p_date,p_tags,count(p_tags) AS total FROM `u_muro_tags` GROUP BY p_tags order by total desc limit 5');
$data2 = result_array($q1);
if(empty($data1)){
$data = $data2;
}else{
$data = $data1;}
return $data;
}
function new_pin($cuerpo){
global $tsCore, $tsUser;
$cuerpo = $tsCore->setSecure($_POST['cuerpo']);
$cuerpo = preg_replace("/#([A-Za-z0-9_-ñÑçÇáÁäÄàÀâÂéÉëËèÈêÊíÍïÏìÌîÎóÓöÖòÒôÔúÚüÜùÙûÛ]+)/", "<a href=/hashtags/result/?q=%23$1><b><font color=#006595>$0</font></b></a>", $cuerpo );
if(strlen($cuerpo) <= 0) return '0: Tu Pin debe tener al menos una letra.';
//Tienes ese pin?
if(db_exec('num_rows', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT pid FROM `u_muro_tags` WHERE p_user = \''.$tsUser->uid.'\' AND p_data = \''.$cuerpo.'\' LIMIT 1'))){
return '0: Ya tienes ese pin.';}
//Tienes mas de 10
if(db_exec('num_rows', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT pid FROM `u_pins` WHERE p_user = \''.$tsUser->uid.'\'')) > 10){
return '0: No puedes tener mas de <b>10</b> pins.';}
//Insertar
if(db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO `u_pins` (`p_user`,`p_data`,`p_fecha`) VALUES (\''.$tsUser->uid.'\',\''.$cuerpo.'\',\''.time().'\') ')){
return "1: El pin se agrego con exito";}
}
function del_pin($id){
global $tsCore, $tsUser;
$id = $tsCore->setSecure($_POST['id']);
//Tienes ese pin?
if(!db_exec('num_rows', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT `pid` FROM `u_pins` WHERE `pid` = \''.(int)$id .'\' LIMIT 1'))) {
return '0: El id ingresado no existe.';
}
if(db_exec(array(__FILE__, __LINE__), 'query', 'DELETE FROM `u_pins` WHERE `pid` = \''.(int)$id .'\'')){
return '1: Se ha eliminado con exito.';
} else return 'Ocurrió un error';
}
function hash_pin($id){
global $tsCore, $tsUser;
$id = $tsCore->setSecure($_POST['id']);
$q = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT p_tags,id FROM `u_muro_tags` WHERE id = \''.(int)$id.'\' LIMIT 1');
$data = db_exec('fetch_assoc', $q);
$tutan = '<a href=/hashtags/result/?q=%23'.$data['p_tags'].'><b><font color=#006595>#'.$data['p_tags'].'</font></b></a>';
//Tienes ese pin?
if(db_exec('num_rows', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT pid FROM `u_pins` WHERE p_user = \''.$tsUser->uid.'\' AND p_data = \''.$tutan.'\' LIMIT 1'))){
return '0: Ya tienes ese pin.';}
//Tienes mas de 10
if(db_exec('num_rows', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT pid FROM `u_pins` WHERE p_user = \''.$tsUser->uid.'\'')) > 10){
return '0: No puedes tener mas de <b>10</b> pins.';}
$pin = '<a href=/hashtags/result/?q=%23'.$data['p_tags'].'><b><font color=#006595>#'.$data['p_tags'].'</font></b></a>';
//Insertar
if(db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO `u_pins` (`p_user`,`p_data`,`p_fecha`) VALUES (\''.$tsUser->uid.'\',\''.$pin.'\',\''.time().'\') ')){
return "1: El pin se agrego con exito";}
}
function ver_pins(){
global $tsCore, $tsUser;
$q = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT p_user,p_data,pid FROM `u_pins` WHERE p_user = '.$tsUser->uid.' ORDER BY pid ASC LIMIT 10');
$data = result_array($q);
return $data;
}
En ajax.portal.php --> inc --> php --> ajax --> ajax.portal.php
Buscar:
Código PHP:
'portal-activity_pages' => array('n' => 2, 'p' => 'actividad'),
Debajo agregar:
Código PHP:
'portal-pin' => array('n' => 2, 'p' => '0'),
'portal-pin2' => array('n' => 2, 'p' => '0'),
'portal-hpin' => array('n' => 2, 'p' => '0'),
Buscar:
Código PHP:
default:
die('0: Este archivo no existe.');
break;
Arriba agregar:
Código PHP:
case 'portal-pin':
$cuerpo = $_POST['cuerpo'];
//<--
echo $tsPortal->new_pin($cuerpo);
//-->
break;
case 'portal-pin2':
$id = $_POST['pid'];
//<--
echo $tsPortal->del_pin($id);
//-->
break;
case 'portal-hpin':
$id = $_POST['id'];
//<--
echo $tsPortal->hash_pin($id);
//-->
break;
En portal.php --> inc --> php --> portal.php
Buscar:
Código PHP:
// FOTOS
Arriba agregar:
Código PHP:
// HASHTAGS Y PINS
$smarty->assign("tsHas",$tsPortal->hashtagsPops());
$smarty->assign("tsPins",$tsPortal->ver_pins());
En t.portal.tpl --> themes --> default --> templates --> t.portal.tpl
Buscar:
Código:
{include file='modules/m.home_stats.tpl'}Debajo agregar:
Código PHP:
{include file='modules/pins.tpl'}
{include file='modules/hashtagsmom.tpl'}
Y subir esta carpeta
Mega
Googe Drive
Mediafire
Nota: para poder ver los hashtags es necesario insertar en la db los hashtags cuando es el primer uso para ello solo escriban hashtags en una publicación y automáticamente se insertan.
Creditos: tutan-kabron
[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 p_posts ADD post_descripcion VARCHAR( 180 ) NOT NULL;
Código PHP:
ALTER TABLE p_borradores ADD b_descripcion VARCHAR( 180 ) NOT NULL
En c.borradores.php --> inc --> class --> c.borradores.php
Buscar:
Código PHP:
'title' => $tsCore->setSecure($tsCore->parseBadWords($_POST['titulo']), true),
Debajo agregar:
Código PHP:
'descripcion' => $tsCore->setSecure($_POST['descripcion'], true),
Buscar:
Código PHP:
// INSERT
if(db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO `p_borradores` (`b_user`, `b_date`, `b_title`, `b_body`, `b_tags`, `b_category`, `b_private`, `b_block_comments`, `b_sponsored`, `b_sticky`, `b_smileys`, `b_visitantes`, `b_status`, `b_causa`) VALUES (\''.$tsUser->info['user_id'].'\', \''.$draftData['date'].'\', \''.$draftData['title'].'\', \''.$draftData['body'].'\', \''.$draftData['tags'].'\', \''.$draftData['category'].'\', \''.$draftData['private'].'\', \''.$draftData['block_comments'].'\', \''.$draftData['sponsored'].'\', \''.$draftData['sticky'].'\', \''.$draftData['smileys'].'\', \''.$draftData['visitantes'].'\', \'1\', \'\')')) return '1: '.db_exec('insert_id');
Reemplazar por:
Código PHP:
// INSERT
if(db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO `p_borradores` (`b_user`, `b_date`, `b_title`, `b_descripcion`, `b_body`, `b_tags`, `b_category`, `b_private`, `b_block_comments`, `b_sponsored`, `b_sticky`, `b_smileys`, `b_visitantes`, `b_status`, `b_causa`) VALUES (\''.$tsUser->info['user_id'].'\', \''.$draftData['date'].'\', \''.$draftData['title'].'\', \''.$draftData['descripcion'].'\', \''.$draftData['body'].'\', \''.$draftData['tags'].'\', \''.$draftData['category'].'\', \''.$draftData['private'].'\', \''.$draftData['block_comments'].'\', \''.$draftData['sponsored'].'\', \''.$draftData['sticky'].'\', \''.$draftData['smileys'].'\', \''.$draftData['visitantes'].'\', \'1\', \'\')')) return '1: '.db_exec('insert_id');
Agregado:
Código PHP:
`b_descripcion`,
Código PHP:
\''.$draftData['descripcion'].'\',
Buscar:
Código PHP:
$bid = intval($_GET['action']);
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT bid, b_user, b_date, b_title, b_body, b_tags, b_category, b_private, b_block_comments, b_sponsored, b_sticky, b_smileys, b_post_id, b_status, b_causa FROM `p_borradores` WHERE `bid` = \''.(int)$bid.'\' AND `b_user` = \''.$tsUser->info['user_id'].'\' AND b_status = \''.$status.'\' LIMIT 1');
Reemplazar por:
Código PHP:
$bid = intval($_GET['action']);
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT bid, b_user, b_date, b_title, b_descripcion, b_body, b_tags, b_category, b_private, b_block_comments, b_sponsored, b_sticky, b_smileys, b_post_id, b_status, b_causa FROM `p_borradores` WHERE `bid` = \''.(int)$bid.'\' AND `b_user` = \''.$tsUser->info['user_id'].'\' AND b_status = \''.$status.'\' LIMIT 1');
Agregado:
Código PHP:
b_descripcion,
En c.posts.php --> inc --> class --> c.posts.php
Buscar:
Código PHP:
'title' => $tsCore->parseBadWords($tsCore->setSecure($_POST['titulo'], true)),2,
Debajo agregar:
Código PHP:
'descripcion' => $tsCore->setSecure($_POST['descripcion']),
Buscar:
Código PHP:
// INSERTAMOS
$_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_posts` (post_user, post_category, post_title, post_body, post_date, post_tags, post_ip, post_private, post_block_comments, post_sponsored, post_sticky, post_smileys, post_visitantes, post_status) VALUES (\''.$tsUser->uid.'\', \''.(int)$postData['category'].'\', \''.$postData['title'].'\', \''.$postData['body'].'\', \''.$postData['date'].'\', \''.$postData['tags'].'\', \''.$_SERVER['REMOTE_ADDR'].'\', \''.(int)$postData['private'].'\', \''.(int)$postData['block_comments'].'\', \''.(int)$postData['sponsored'].'\', \''.(int)$postData['sticky'].'\', \''.(int)$postData['smileys'].'\', \''.(int)$postData['visitantes'].'\', '.(!$tsUser->is_admod && ($tsCore->settings['c_desapprove_post'] == 1 || $tsUser->permisos['gorpap'] == true) ? '\'3\'' : '\'0\'').')')) {
Reemplazar por:
Código PHP:
// INSERTAMOS
$_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_posts` (post_user, post_category, post_title, post_descripcion, post_body, post_date, post_tags, post_ip, post_private, post_block_comments, post_sponsored, post_sticky, post_smileys, post_visitantes, post_status) VALUES (\''.$tsUser->uid.'\', \''.(int)$postData['category'].'\', \''.$postData['title'].'\', \''.$postData['descripcion'].'\', \''.$postData['body'].'\', \''.$postData['date'].'\', \''.$postData['tags'].'\', \''.$_SERVER['REMOTE_ADDR'].'\', \''.(int)$postData['private'].'\', \''.(int)$postData['block_comments'].'\', \''.(int)$postData['sponsored'].'\', \''.(int)$postData['sticky'].'\', \''.(int)$postData['smileys'].'\', \''.(int)$postData['visitantes'].'\', '.(!$tsUser->is_admod && ($tsCore->settings['c_desapprove_post'] == 1 || $tsUser->permisos['gorpap'] == true) ? '\'3\'' : '\'0\'').')')) {
Agregado:
Código PHP:
post_descripcion,
Código PHP:
\''.$postData['descripcion'].'\',
Buscar:
Código PHP:
'title' => $tsCore->parseBadWords($_POST['titulo'], true),
Debajo agregar:
Código PHP:
'descripcion' => $tsCore->setSecure($_POST['descripcion'], true),
Buscar:
Código PHP:
// ACTUALIZAMOS
if($tsUser->uid == $data['post_user'] || !empty($tsUser->is_admod) || !empty($tsUser->permisos['moedpo'])){
if(db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE p_posts SET post_title = \''.$postData['title'].'\', post_body = \''.$postData['body'].'\', post_tags = \''.$tsCore->setSecure($postData['tags']).'\', post_category = \''.(int)$postData['category'].'\', post_private = \''.$postData['private'].'\', post_block_comments = \''.$postData['block_comments'].'\', post_sponsored = \''.$postData['sponsored'].'\', post_smileys = \''.$postData['smileys'].'\', post_visitantes = \''.$postData['visitantes'].'\', post_sticky = \''.$postData['sticky'].'\' WHERE post_id = \''.(int)$post_id.'\'') or exit( show_error('Error al ejecutar la consulta de la línea '.__LINE__.' de '.__FILE__.'.', 'db') )) {
Reemplazar por:
Código PHP:
// ACTUALIZAMOS
if($tsUser->uid == $data['post_user'] || !empty($tsUser->is_admod) || !empty($tsUser->permisos['moedpo'])){
if(db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE p_posts SET post_title = \''.$postData['title'].'\', post_descripcion = \''.$postData['descripcion'].'\', post_body = \''.$postData['body'].'\', post_tags = \''.$tsCore->setSecure($postData['tags']).'\', post_category = \''.(int)$postData['category'].'\', post_private = \''.$postData['private'].'\', post_block_comments = \''.$postData['block_comments'].'\', post_sponsored = \''.$postData['sponsored'].'\', post_smileys = \''.$postData['smileys'].'\', post_visitantes = \''.$postData['visitantes'].'\', post_sticky = \''.$postData['sticky'].'\' WHERE post_id = \''.(int)$post_id.'\'') or exit( show_error('Error al ejecutar la consulta de la línea '.__LINE__.' de '.__FILE__.'.', 'db') )) {
Agregado:
Código PHP:
post_descripcion = \''.$postData['descripcion'].'\',
Buscar:
Código PHP:
// ES SU POST EL Q INTENTA BORRAR?
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT post_id, post_title, post_user, post_body, post_category FROM p_posts WHERE post_id = \''.(int)$post_id.'\' AND post_user = \''.$tsUser->uid.'\'');
$data = db_exec('fetch_assoc', $query);
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE `w_stats` SET `stats_posts` = stats_posts - \'1\' WHERE `stats_no` = \'1\'');
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE `u_miembros` SET `user_posts` = user_posts - \'1\' WHERE `user_id` = \''.$data['post_user'].'\'');
// ES MIO O SOY MODERADOR/ADMINISTRADOR...
if(!empty($data['post_id']) || !empty($tsUser->is_admod)){
// SI ES MIS POST LO BORRAMOS Y MANDAMOS A BORRADORES
if(db_exec(array(__FILE__, __LINE__), 'query', 'DELETE FROM p_posts WHERE post_id = \''.(int)$post_id.'\'')) {
if(db_exec(array(__FILE__, __LINE__), 'query', 'DELETE FROM p_comentarios WHERE c_post_id = \''.(int)$post_id.'\'')) {
if(db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO `p_borradores` (b_user, b_date, b_title, b_body, b_tags, b_category, b_status, b_causa) VALUES (\''.$tsUser->uid.'\', \''.time().'\', \''.$tsCore->setSecure($data['post_title']).'\', \''.$tsCore->setSecure($data['post_body']).'\', \'\', \''.$data['post_category'].'\', \'2\', \'\')'))
return "1: El post fue eliminado satisfactoriamente.";
}
Reemplazar por:
Código PHP:
// ES SU POST EL Q INTENTA BORRAR?
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT post_id, post_title, post_descripcion, post_user, post_body, post_category FROM p_posts WHERE post_id = \''.(int)$post_id.'\' AND post_user = \''.$tsUser->uid.'\'');
$data = db_exec('fetch_assoc', $query);
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE `w_stats` SET `stats_posts` = stats_posts - \'1\' WHERE `stats_no` = \'1\'');
db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE `u_miembros` SET `user_posts` = user_posts - \'1\' WHERE `user_id` = \''.$data['post_user'].'\'');
// ES MIO O SOY MODERADOR/ADMINISTRADOR...
if(!empty($data['post_id']) || !empty($tsUser->is_admod)){
// SI ES MIS POST LO BORRAMOS Y MANDAMOS A BORRADORES
if(db_exec(array(__FILE__, __LINE__), 'query', 'DELETE FROM p_posts WHERE post_id = \''.(int)$post_id.'\'')) {
if(db_exec(array(__FILE__, __LINE__), 'query', 'DELETE FROM p_comentarios WHERE c_post_id = \''.(int)$post_id.'\'')) {
if(db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO `p_borradores` (b_user, b_date, b_title, b_descripcion, b_body, b_tags, b_category, b_status, b_causa) VALUES (\''.$tsUser->uid.'\', \''.time().'\', \''.$tsCore->setSecure($data['post_title']).'\', \''.$tsCore->setSecure($data['post_descripcion']).'\', \''.$tsCore->setSecure($data['post_body']).'\', \'\', \''.$data['post_category'].'\', \'2\', \'\')'))
return "1: El post fue eliminado satisfactoriamente.";
}
Agregado:
Código PHP:
post_descripcion,
Código PHP:
b_descripcion,
Código PHP:
\''.$tsCore->setSecure($data['post_descripcion']).'\',
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);
Reemplazar por:
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_descripcion, 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);
Agregado:
Código PHP:
p.post_descripcion,
En m.agregar_form.tpl --> themes --> default --> templates --> modules --> m.agregar_form.tpl
Buscar:
Código PHP:
<li>
<label>Título</label>
<span style="display: none;" class="errormsg"></span>
<input type="text" tabindex="1" name="titulo" maxlength="60" size="60" class="text-inp required" value="{$tsDraft.b_title}" style="width:760px"/>
<div id="repost"></div>
</li>
Debajo agregar:
Código PHP:
<li>
<label>Descripción</label>
<span style="display: none;" class="errormsg"></span>
<input type="text" tabindex="2" name="descripcion" maxlength="180" size="60" class="text-inp required" value="{$tsDraft.b_descripcion}" placeholder="Escibe una descripción (Max 180 Caracteres)" />
</li>
En m.home_last_posts.tpl --> themes --> default --> templates --> modules --> m.home_last_posts.tpl donde quieran que salga la descripción agregan esta variable
Código PHP:
{$p.post_descripcion}
Creditos: Kmario19

