0
Hola, esto es lo que haría.
1 - Ejecuto esta consulta, con esto guardaremos la/s pagina/s que deseamos, ejemplo: home (una pagina) otra forma home,portal (dos o más paginas) y si se deja vacio, será de manera global!
2 - En c.admin.php modificar las siguientes funciones
por estas funciones
3 - En c.core.php buscar
y reemplazar toda la función.
4 - En themes/default/templates/admin_mods/m.admin_noticias.tpl buscar
y arriba añadir
1 - Ejecuto esta consulta, con esto guardaremos la/s pagina/s que deseamos, ejemplo: home (una pagina) otra forma home,portal (dos o más paginas) y si se deja vacio, será de manera global!
Código: ( Seleccionar Todo )
ALTER TABLE `w_noticias` ADD `not_pages` VARCHAR(32) NOT NULL DEFAULT '' AFTER `not_active`;2 - En c.admin.php modificar las siguientes funciones
Código PHP: ( Seleccionar Todo )
function getNoticia() {...}
function newNoticia() {...}
function editNoticia() {...}
por estas funciones
Código PHP: ( Seleccionar Todo )
/*
getNoticia()
*/
function getNoticia() {
global $tsCore;
//
$not_id = $tsCore->setSecure($_GET['nid']);
//
$query = db_exec([__FILE__, __LINE__], 'query', 'SELECT `not_id`, `not_body`, `not_date`, `not_active`, `not_pages` FROM w_noticias WHERE not_id = \'' . (int)$not_id . '\' LIMIT 1');
$data = db_exec('fetch_assoc', $query);
//
return $data;
}
/*
newNoticia()
*/
function newNoticia() {
global $tsCore, $tsUser;
//
$not_body = $tsCore->setSecure($tsCore->parseBadWords(substr($_POST['not_body'], 0, 190)));
$not_active = empty($_POST['not_active']) ? 0 : 1;
$not_pages = $tsCore->setSecure($_POST['not_pages']);
if (!empty($not_body)) {
if (db_exec([__FILE__, __LINE__], 'query', 'INSERT INTO `w_noticias` (`not_body`, `not_autor`, `not_date`, `not_active`, `not_pages`) VALUES (\'' . $not_body . '\', \'' . $tsUser->uid . '\', \'' . time() . '\', \'' . $not_active . '\', \'' . $not_pages . '\')'))
return true;
}
//
return false;
}
/*
editNoticia()
*/
function editNoticia() {
global $tsCore, $tsUser;
//
$not_id = intval($_GET['nid']);
$not_body = $tsCore->setSecure($tsCore->parseBadWords(substr($_POST['not_body'], 0, 190)));
$not_active = empty($_POST['not_active']) ? 0 : 1;
$not_pages = $tsCore->setSecure($_POST['not_pages']);
//
if (!empty($not_body)) {
if (db_exec([__FILE__, __LINE__], 'query', 'UPDATE `w_noticias` SET `not_autor` = \'' . $tsUser->uid . '\', `not_body` = \'' . $not_body . '\', not_active = \'' . $not_active . '\', not_pages = \'' . $not_pages . '\' WHERE not_id = \'' . (int)$not_id . '\'')) return true;
}
}
3 - En c.core.php buscar
Código PHP: ( Seleccionar Todo )
function getNews() {...}
y reemplazar toda la función.
Código PHP: ( Seleccionar Todo )
public function getNews() {
global $tsPage;
$query = result_array(db_exec([__FILE__, __LINE__], 'query', "SELECT not_body, not_pages FROM w_noticias WHERE not_active = 1 ORDER BY RAND() LIMIT 5"));
$tsPage = $tsPage ?? $GLOBALS['_GET']['do'];
$data = [];
foreach ($query as $nid => $new) {
$pages = array_map('trim', explode(',', $new['not_pages']));
if ((empty($new['not_pages']) OR $tsPage === $new['not_pages']) OR in_array($tsPage, $pages)) {
$data[]['not_body'] = $this->parseBBCode($new['not_body'], 'news');
}
}
return $data;
}
4 - En themes/default/templates/admin_mods/m.admin_noticias.tpl buscar
Código: ( Seleccionar Todo )
<dl>
<dt><label for="ai_not_active">Activar noticia:</label><br /><span>Activar inmediatamente esta noticia en {$tsConfig.titulo}.</span></dt>y arriba añadir
Código: ( Seleccionar Todo )
<dl>
<dt><label for="ai_pages">En pagina:</label><br /><span>Donde deseas que se muestre la noticia.</span></dt>
<dd><input type="text" id="ai_pages" name="not_pages" placeholder="home,portal,perfil,etc" value="{$tsNew.not_pages}" /></dd>
</dl>

Facebook
Twitter
Reddit
Digg
del.icio.us
Tumblr
Pinterest
Blogger
Fark
LinkedIn
Mix
Google