/*
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;
}
}