04-20-2021, 07:45 AM
(Última modificación: 04-28-2021, 05:02 PM por Tronlar.
Razón: Añadido consulta
)
5
[img]Registrate o inicia tu sesión para ver este contenido[/img]
Ejecutar esta consulta
Código PHP: ( Seleccionar Todo )
ALTER TABLE w_configuracion
ADD `cata` varchar(100) NOT NULL,
ADD `catb` varchar(100) NOT NULL,
ADD `catc` varchar(100) NOT NULL,
ADD `ccant` int(3) NOT NULL;
En c.admin.php buscar:
Código PHP: ( Seleccionar Todo )
'newr' => empty($_POST['newr']) ? 0 : 1,
Arriba agregar:
Código PHP: ( Seleccionar Todo )
'cata' => $tsCore->setSecure($tsCore->parseBadWords($_POST['cata'])),
'catb' => $tsCore->setSecure($tsCore->parseBadWords($_POST['catb'])),
'catc' => $tsCore->setSecure($tsCore->parseBadWords($_POST['catc'])),
'ccant' => $tsCore->setSecure($tsCore->parseBadWords($_POST['ccant'])),
Buscar:
Código PHP: ( Seleccionar Todo )
$c['offline_message']
Y agregamos al lado:
Código PHP: ( Seleccionar Todo )
. '\', `cata` = \'' . $c['cata'] . '\', `catb` = \'' . $c['catb']. '\', `catc` = \'' . $c['catc'] .'\', `ccant` = \'' . $c['ccant']
Buscar:
Código PHP: ( Seleccionar Todo )
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT cid, c_orden, c_nombre, c_seo, c_img FROM p_categorias WHERE cid = \'' .
Reemplazar por:
Código PHP: ( Seleccionar Todo )
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT cid, c_orden, c_nombre, c_seo, c_img, c_cat, c_opc FROM p_categorias WHERE cid = \'' .
Buscar:
Código PHP: ( Seleccionar Todo )
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: ( Seleccionar Todo )
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_opc = $tsCore->setSecure($tsCore->parseBadWords($_POST['c_opc'] == 'n') ? 0 : 1);
$c_cat = $tsCore->setSecure($tsCore->parseBadWords($_POST['c_cat']));
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_opc = \'' .$tsCore->setSecure($c_opc) .'\',c_cat = \'' . $tsCore->setSecure($c_cat).'\' WHERE cid = \'' . (int)$cid . '\''))
return true;
}
Buscar:
Código PHP: ( Seleccionar Todo )
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: ( Seleccionar Todo )
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_opc = $tsCore->setSecure($tsCore->parseBadWords($_POST['c_opc'] == 'n') ? 0 : 1);
$c_cat = $tsCore->setSecure($tsCore->parseBadWords($_POST['c_cat']));
// 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_opc`, `c_cat`) VALUES (\'' .
$orden . '\', \'' . $c_nombre . '\',\'' . $tsCore->setSEO($c_nombre, true) . '\', \'' .
$cimg . '\', \'' .$c_opc . '\', \'' .$c_cat . '\')'))
return true;
}
En c.posts.php
Buscar:
Código PHP: ( Seleccionar Todo )
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT p.post_id, p.post_title, c.c_seo 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'] == 1 ? '' : '&& u.user_activo = \'1\' && u.user_baneado = \'0\'').' && MATCH(p.post_title) AGAINST(\''.$q.'\' IN BOOLEAN MODE) ORDER BY RAND() DESC LIMIT 5');
Reemplazar por:
Código PHP: ( Seleccionar Todo )
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT p.post_id, p.post_title, c.c_seo, c.c_nombre, c.c_img, c.c_opc, c.c_cat 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'] == 1 ? '' : '&& u.user_activo = \'1\' && u.user_baneado = \'0\'').' && MATCH(p.post_title) AGAINST(\''.$q.'\' IN BOOLEAN MODE) ORDER BY RAND() DESC LIMIT 5');
Buscar:
Código PHP: ( Seleccionar Todo )
$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);
Reemplazar por:
Código PHP: ( Seleccionar Todo )
$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_opc, c.c_cat 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);
Buscar:
Código PHP: ( Seleccionar Todo )
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT c.c_nombre, c.c_seo FROM p_categorias AS c WHERE c.cid = \''.$postData['post_category'].'\'');
Reemplazar por:
Código PHP: ( Seleccionar Todo )
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT c.c_nombre, c.c_seo, c.c_opc, c.c_cat FROM p_categorias AS c WHERE c.cid = \''.$postData['post_category'].'\'');
En el archivo m.home_last_post.tpl
Buscar:
Código PHP: ( Seleccionar Todo )
{foreach from=$tsPosts item=p}
Debajo agregar:
Código PHP: ( Seleccionar Todo )
{if $p.c_cat ==0 || $p.c_cat == 4 & $p.c_opc ==0}
Buscar:
Código PHP: ( Seleccionar Todo )
{/foreach}
Arriba agregar:
Código PHP: ( Seleccionar Todo )
{/if}
En el archivo t.home.tpl después de:
Código PHP: ( Seleccionar Todo )
{include file='sections/main_header.tpl'}
Agregar:
Código PHP: ( Seleccionar Todo )
{if $tsPage == 'home' || $tsPage == 'portal'}
{include file='modules/m.cat_principal.tpl'}
{/if}
En el archivo m.admin_cats.tpl
Buscar:
Código PHP: ( Seleccionar Todo )
<p><input type="submit" name="save" value="Guardar cambios" class="btn_g"/ ></p>
Arriba agregar:
Código PHP: ( Seleccionar Todo )
<hr>
<dl>
<dt><label for="cat_opc">Usar categoría principal:</label><br /><span>Seleccione si sesea usar como categoría principal</span><br/> (A-B-C)</dt>
<label><input type="radio" value="s" name="c_opc" class="radio cuenta-save-1" {if $tsCat.c_opc == '1'}checked="checked"{/if}/><b>Sí</b></label>
<label><input type="radio" value="n" name="c_opc" class="radio cuenta-save-1" {if $tsCat.c_opc == '0'}checked="checked"{/if}/><b>No</b></label>
<br/>
</dl>
<dl>
<dt><label for="c_cat">Tipo de categoría:</label><br /><span>Categoría <b>D</b> se reserva como Default - Si le asigna como <b>categoría Principal</b> No se vera en la Home</span></dt>
<dd>
<select style="width:40px;font-weight:bold;"id="dia" name="c_cat" tabindex="5" onblur="registro.blur(this)" onfocus="registro.focus(this)" autocomplete="off" title="Ingrese categoría">
<option value="0"{if $tsCat.c_cat == 0} selected{/if}></option>
<option value="1"{if $tsCat.c_cat == 1} selected{/if}>A</option>
<option value="2"{if $tsCat.c_cat == 2} selected{/if}>B</option>
<option value="3"{if $tsCat.c_cat == 3} selected{/if}>C</option>
<option value="4"{if $tsCat.c_cat == 4} selected{/if}>D</option>
</select>
</dd>
</dl>
Buscar:
Código PHP: ( Seleccionar Todo )
<p><input type="submit" name="save" value="Crear Categoría" class="btn_g"/></p>
Arriba agregar:
Código PHP: ( Seleccionar Todo )
<hr>
<dl>
<dt><label for="cat_opc">Usar categoría principal:</label><br /><span>Seleccione si sesea usar como categoría principal</span><br/> (A-B-C)</dt>
<label><input type="radio" value="s" name="c_opc" class="radio cuenta-save-1" {if $tsCat.c_opc == '1'}checked="checked"{/if}/><b>Sí</b></label>
<label><input type="radio" value="n" name="c_opc" class="radio cuenta-save-1" {if $tsCat.c_opc == '0'}checked="checked"{/if}/><b>No</b></label>
<br/>
</dl>
<dl>
<dt><label for="c_cat">Tipo de categoría:</label><br /><span>Categoría <b>D</b> se reserva como Default - Si le asigna como <b>categoría Principal</b> No se vera en la Home</span></dt>
<dd>
<select style="width:40px;font-weight:bold;"id="dia" name="c_cat" tabindex="5" onblur="registro.blur(this)" onfocus="registro.focus(this)" autocomplete="off" title="Ingrese categoría">
<option value="0"{if $tsCat.c_cat == 0} selected{/if}></option>
<option value="1"{if $tsCat.c_cat == 1} selected{/if}>A</option>
<option value="2"{if $tsCat.c_cat == 2} selected{/if}>B</option>
<option value="3"{if $tsCat.c_cat == 3} selected{/if}>C</option>
<option value="4"{if $tsCat.c_cat == 4} selected{/if}>D</option>
</select>
</dd>
</dl>
En el archivo m.admin_configs.tpl
Buscar:
Código PHP: ( Seleccionar Todo )
<dl>
<dt><label for="ai_offline">Modo mantenimiento:</label><br /><span>Esto hará al Sitio inaccesible a los usuarios. Si quiere, también puede introducir un breve mensaje (255 caracteres) para mostrar.</span></dt>
<dd>
<label><input name="offline" type="radio" id="ai_offline" value="1" {if $tsConfig.offline == 1}checked="checked"{/if} class="radio"/> Sí</label>
<label><input name="offline" type="radio" id="ai_offline" value="0" {if $tsConfig.offline != 1}checked="checked"{/if} class="radio"/> No</label>
<br />
<input type="text" name="offline_message" id="ai_offline" value="{$tsConfig.offline_message}" />
</dd>
</dl>
Debajo agregar:
Código PHP: ( Seleccionar Todo )
<hr>
<dl>
<dt><label for="ai_titulo">Categorias Principales:</label><br /><span>Elige los nombres para las tres <i><b>Categorias</b></i> principales que se veran en la home.<br/> Categoria <b>A - B - C</b></span></dt>
<dd><b>A:</b> <input type="text" id="cata" name="cata" maxlength="22" value="{$tsConfig.cata}" /></dd>
<br class="space"/>
<dd><b>B:</b> <input type="text" id="catb" name="catb" maxlength="24" value="{$tsConfig.catb}" /></dd>
<br class="space"/>
<dd><b>C:</b> <input type="text" id="catc" name="catc" maxlength="24" value="{$tsConfig.catc}" /></dd>
</dl>
<dl>
<dt><label for="ccant">Cantidad de post:</label><br /><span>Ingrese la cantidad de posts que desea mostrar en las categorías</span></dt>
<dd><input type="text" id="ccant" name="ccant" style="width:10%" maxlength="3" value="{$tsConfig.ccant}" /></dd>
</dl>
<hr>
En el archivo head_menu.tpl
Buscar:
Código PHP: ( Seleccionar Todo )
<li class="tabbed {if $tsPage == 'tops'}here{/if}" id="tabbedtops">
<a title="Ir a TOPs" onclick="menu('tops', this.href); return false;" href="{$tsConfig.url}/top/">TOPs <img alt="Drop Down" src="{$tsConfig.tema.t_url}/images/arrowdown.png"></a>
</li>
Debajo agregar:
Código PHP: ( Seleccionar Todo )
<li class="tabbed {if $tsPage == 'principal'}here{/if}" id="tabbedtops">
<a title="Ir a Principal" onclick="menu('principal', this.href); return false;" href="{$tsConfig.url}/principal/">Principal <img alt="Drop Down" src="{$tsConfig.tema.t_url}/images/arrowdown.png"></a>
</li>
En el archivo head_submenu.tpl
Buscar:
Código PHP: ( Seleccionar Todo )
<div id="subMenuTops" class="subMenu {if $tsPage == 'tops'}here{/if}">
<ul class="floatL tabsMenu">
<li{if $tsAction == 'posts'} class="here"{/if}><a href="{$tsConfig.url}/top/posts/">Posts</a></li>
<li{if $tsAction == 'usuarios'} class="here"{/if}><a href="{$tsConfig.url}/top/usuarios/">Usuarios</a></li>
</ul>
<div class="clearBoth"></div>
</div>
Debajo agregar:
Código PHP: ( Seleccionar Todo )
<div class="subMenu {if $tsPage == 'principal'}here{/if}">
<ul class="floatL tabsMenu">
<li{if $tsAction == 'a'} class="here"{/if}><a href="{$tsConfig.url}/principal/a/">{$tsConfig.cata}</a></li>
<li{if $tsAction == 'b'} class="here"{/if}><a href="{$tsConfig.url}/principal/b/">{$tsConfig.catb}</a></li>
<li{if $tsAction == 'c'} class="here"{/if}><a href="{$tsConfig.url}/principal/c/">{$tsConfig.catc}</a></li>
</ul>
<div class="clearBoth"></div>
</div>
En el archivo extras.css al final agregar:
Código PHP: ( Seleccionar Todo )
#cat-prim{width:100%;height:auto;float:left;overflow: hidden; }
#cat-prim h1{text-align:center;padding:10px 0 10px 0;background:url('images/box_titlebg2.gif');color:#999;font-weight:600;font-size:20px;border:1px solid #CCC;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;}
#cat-x-vell{width:305px;height:372px;background:#E4E4E4;border:1px solid #CCC;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;}
#cat-x-vell ul{margin-top:0px;background:#FFF;width:305px;}
#cat-x-vell ul li{display:inline-block;padding:8px 0 8px 15px;width:290px;border-bottom:1px solid #CCC;cursor:pointer;}
#cat-x-vell ul li:hover{background:#F8F8F8;}
#cat-x-vell ul li a{color:#005CA5;font-weight:bold;margin-left:10px;}
#cat-x-vell a{text-decoration:none;color:#009999;font-size:10px;font-weight:bold;}
.cat-img-v{position:absolute;float:left;margin-left:-12px;}
.cat-a{float:left;width:305px;padding:0 0 2px 0;height:auto;}
.cat-b{float:left;width:305px;margin-left:11px;height:auto;}
.cat-c{float:right;width:305px;margin-right:3px;height:auto;}
.box_title_v{background:url('images/box_titlebg2.gif');text-align:center;border-bottom:1px solid #CCC;border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px 5px 0 0;-o-border-radius:5px 5px 0 0;}
.box-cat-v{padding:10px 0 10px 0;color:#FFF;font-size:18px;font-weight:bold;text-shadow:1px 1px 5px #000;}
#categorias-principales{width:100%;height:auto;background:transparent;border:1px solid #CCC;overflow: hidden; }
#categorias-principales ul li{width:100%;padding:20px 0 21px 5px;border-bottom:1px solid #CCC;}
#categorias-principales ul li:hover{background:#F8F8F8;}
#categorias-principales ul li a{text-decoration:none;}
#categorias-principales ul li span{color:#9E9E9E;}
#categorias-t {font-size: 14px;font-weight: bold;color:#005CA5;margin-left:60px;text-decoration:none;}
.categoria-a{padding:10px 0 10px 0;color:#8B8B8B;background:url('images/box_titlebg2.gif');text-align:center;border-bottom:1px solid #CCC;font-size:20px;font-weight:700;}
#c-a-i{width:50px;height:50px;position:absolute;float:left;margin-left:-1px;margin-top:-17px;cursor:pointer;}
#c-a-p{position:absolute;float:left;margin-left:500px;margin-top:-5px;cursor:pointer;}
.c-a-pp{position:absolute;float:left;margin-left:530px;margin-top:0px;}
.c-a-pp strong{padding: 10px;color:#009999;}
#c-a-c{position:absolute;float:left;margin-left:580px;margin-top:-4px;cursor:pointer;}
.c-a-cc {position:absolute;float:left;margin-left:615px;margin-top:0px;}
.c-a-cc strong{padding: 10px;color:#009999;}
#c-a-v{position:absolute;float:left;margin-left:670px;margin-top:0px;cursor:pointer;}
.c-a-cvh {position:absolute;float:left;margin-left:690px;margin-top:0px;}
.c-a-cvh strong{padding: 10px;color:#009999;}
.c-c-ip{position:absolute;float:left;margin-left:60px;margin-top:-13px;}
.c-c-ip-u{position:absolute;float:left;margin-left:760px;margin-top:-15px;}
#c-a-r{position:absolute;float:left;margin-left:730px;margin-top:0px;cursor:pointer;}
.c-a-e-1{position:absolute;float:left;margin-left:60px;margin-top:17px;}
.c-a-e-2{position:absolute;float:left;margin-left:80px;margin-top:17px;}
.c-a-e-3{position:absolute;float:left;margin-left:100px;margin-top:17px;}
.c-a-e-4{position:absolute;float:left;margin-left:120px;margin-top:17px;}
.c-a-e-5{position:absolute;float:left;margin-left:140px;margin-top:17px;}
.c-a-e-6{position:absolute;float:left;margin-left:160px;margin-top:17px;}
.c-a-e-7{position:absolute;float:left;margin-left:180px;margin-top:17px;}
.c-a-e-8{position:absolute;float:left;margin-left:410px;margin-top:0px;}
.c-a-e-9{position:absolute;float:left;margin-left:460px;margin-top:-3px;}
.c-a-ur {position:absolute;float:left;margin-left:760px;margin-top:0px;font-size:12px;}
.cat-buscador{width:400px;height:35px;margin:10px 0 20px 220px;color:#333;}
.cat-buscador:hover{box-shadow:inset 0px 0px 2px #00CCFF;}
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... y Debes agradecer para ver el contenido...