$text->validate(); $text->makeClean('trim', 'slash_if_needed'); $c = $text->clean; if ($text->is_missing_required) { $baddata = true; } else { // deal with options. $c['bb'] = empty($c['bb']) ? 1 : 0; $c['html'] = empty($c['html']) ? 1 : 0; $c['smiles'] = empty($c['smiles']) ? 1 : 0; badHtmlSecond($c['body']); // make the updates $update = new nlb_blog($db); $update->fetchFromDB($_GET['id']); foreach (array('subject', 'custom', 'body', 'bb', 'html', 'smiles', 'access') as $item) { $update->setItem($item, $c[$item]); } // deal with comments. if (empty($c['comments'])) { // comments are allowed $update->recountComments(); } else { // no comments $update->setItem('comments', -1); } // deal with blog count $user->recountBlogs(); // set it in stone $update->updateToDB(); $user->updateDB(); $ets->page_body = $l['goodedit'];
$text->makeClean('trim', 'slash_if_needed'); $c = $text->clean; if ($text->is_missing_required) { $baddata = true; } else { /** * U P D A T E I T E M */ // deal with options. $bb = empty($c['bb']) ? 1 : 0; $html = empty($c['html']) ? 1 : 0; $smiles = empty($c['smiles']) ? 1 : 0; badHtmlSecond($c['subject']); $update = new nlb_blog($db); $update->fetchFromDB($_GET['id']); $update->setItem("subject", $c['subject']); $update->setItem("body", $c['body']); $update->setItem("bb", $bb); $update->setItem("html", $html); $update->setItem("smiles", $smiles); if (empty($c['comments'])) { $update->recountComments(); } else { $update->setItem("comments", -1); } $update->updateToDB(); $ets->page_body = $l['goodedit']; } } /** * Build input