¡Bienvenido! ¿Aún no estás registrado?, deberás registrarte antes de poder usar el Chat, Comentar y Descargar en el Foro. Usa un email válido para la activación.
Calificación:
  • 1 voto(s) - 5 Media
  • 1
  • 2
  • 3
  • 4
  • 5

COMPLEMENTOS Posts al azar v1 (Adm-Act 1.3)
#1

3
Mejor respuesta del mensaje Posts al azar v1 (Adm-Act 1.3)
[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 `w_configuracionADD `c_max_posts_azarINT(2NOT NULL AFTER `c_max_posts`; 
 
 
En c.admin.php --> inc --> class --> c.admin.php
 
Buscar:
'max_posts' => $tsCore->setSecure($_POST['max_posts']), 
 
 
Debajo agregar:
'max_posts_azar' => $tsCore->setSecure($_POST['max_posts_azar']), 
 
 
Buscar:
$c['max_posts'] . '\', 
 
 
Al lado agregar:
`c_max_posts_azar` = \'' .$c['max_posts_azar'] . '\', 
 
 
En c.posts.php --> inc --> class --> c.posts.php
 
Buscar:
/*
getCatData()
:: OBTENER DATOS DE UNA CATEGORIA
*/
function getCatData(){
global 
$tsCore;
//
$cat intval($_GET['cat']);
//
$query db_exec(array(__FILE____LINE__), 'query''SELECT c_nombre, c_seo FROM p_categorias WHERE c_seo = \''.$tsCore->setSecure($_GET['cat']).'\' LIMIT 1');
$data db_exec('fetch_assoc'$query);

//
return $data;

 
 
Debajo agregar:
/*
getAzarPosts()
*/
function getAzarPosts()
{
global 
$tsCore$tsUser;
//
$query db_exec(array(__FILE____LINE__), 'query''SELECT p.post_id, p.post_user, p.post_category, p.post_title, p.post_date, c.c_seo, c.c_nombre, c.c_img FROM p_posts AS p LEFT JOIN u_miembros AS u ON u.user_id = p.post_user LEFT JOIN p_categorias AS c ON c.cid = p.post_category WHERE p.post_status = \'0\' '.($tsUser->is_admod && $tsCore->settings['c_see_mod'] == '' 'AND u.user_activo = \'1\' && u.user_baneado = \'0\'').' ORDER BY RAND() ASC LIMIT '.$tsCore->settings['c_max_posts_azar']);
$data result_array($query);
//
return $data;

 
 
En posts.php --> inc --> php --> posts.php
 
Buscar:
// CAT
$smarty->assign("tsCat",$category);
$smarty->assign("tsStats",$tsTops->getStats()); 
 
  
Debajo agregar:
// POSTS AL AZAR
$smarty->assign("tsAzar",$tsPosts->getAzarPosts()); 
 
 
En t.home.tpl --> themes --> default --> templates --> t.home.tpl
 
Buscar:
{include file='modules/m.home_last_comments.tpl'
 
 
Debajo agregar:
{include file='modules/m.home_azar_posts.tpl'
 
 
En m.admin_configs.tpl --> themes --> default --> templates --> admin_mods --> m.admin_configs.tpl
 
Buscar:
<dl>
<
dt>
<
label for="ai_max_post">Posts por p&aacute;gina:</label>
<
br /><span>N&uacute;mero m&aacute;ximo de posts a mostrar en cada p&aacute;gina de la portada.</span></dt>
<
dd>
<
input type="text" id="ai_max_post" name="max_posts" style="width:10%" maxlength="3" value="{$tsConfig.c_max_posts}/>
</
dd>
</
dl
 
 
Debajo agregar:
<dl>
<
dt><label for="ai_max_post">Posts al azar:</label><br /><span>N&uacute;mero m&aacute;ximo de posts al azar.</span></dt>
<
dd><input type="text" id="ai_max_posts_azar" name="max_posts_azar" style="width:10%" maxlength="3" value="{$tsConfig.c_max_posts_azar}/></dd>
</
dl
 
 
Y subir esta carpeta
 
Mega
Debes agradecer para ver el contenido...

Google Drive
Debes agradecer para ver el contenido...

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


Compartir en:

Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)