function editapply() { $this->load->library('m_security'); $this->m_security->filterPost('termid', 'required'); $this->m_security->filterPost('editname', 'required'); if ($this->m_security->startPost() == TRUE) { $termid = $this->input->post('termid', TRUE); $name = $this->input->post('editname', TRUE); $slug = $this->input->post('editslug', TRUE); $desc = $this->input->post('editdescription', TRUE); $proses = updateTags($termid, $name, $slug, $desc, '0'); if ($proses == TRUE) { redirect(base_url(roleURIUser() . 'content/tags'), 'refresh'); } else { redirect(base_url(roleURIUser() . 'content/tags'), 'refresh'); } } else { redirect(base_url(roleURIUser() . 'content/tags'), 'refresh'); } }
if (TAGS) { include 'includes/tags_functions.php'; $tags = trim($tags); //Remove any commas, dots, quotes, plus signs since the user might use commas to seperate tags rather than spaces $toRemove = array('"', "'", ",", "+"); $tags = str_replace($toRemove, "", $tags); $tags = filter($tags); // cut tags if too long > 150 chars $tags = substr($tags, 0, 150); if ($tags != null) { //Check if the book was public $public = checkIfPublic($id); //Was public and still is (P P) if ($public && $newPublic) { //Make the changes to the tags, if any updateTags($id, $tags); } //Was not public, and now is (~ P) if (!$public && $newPublic) { //Add the tags addTags($tags); //Store the tags with the bookmark storeTags($id, $tags); } //Was public, and now is not (P ~) if ($public && !$newPublic) { //Remove (unstore) all the tags attached to this bookmark in table tags_books unstoreTags($id); } } }
// update entry $queryResult = addTags($link, 'tags'); // assign message to query result $message = $queryResult ? '<span class="fi-asterisk alertHeader" aria-hidden="true"></span><h2>Success!</h2> Tag has been added.' : '<span class="fi-asterisk alertHeader" aria-hidden="true"></span><h2>Warning!</h2> Tag was not added. Please try again.'; $messageSpanClass = $queryResult ? 'info' : 'alert'; // display query result message $queryAlert = '<div data-alert class="alert-box ' . $messageSpanClass . '"> <span class="queryMessage">' . $message . '</span> <a href="#" class="close">×</a> </div> <script>$(".alert-box").hide().prependTo("#queryAlert").slideDown(800, "swing");</script> '; } if (isset($_POST['btnUpdateLocation'])) { // update entry $queryResult = updateTags($link, 'location'); // assign message to query result $message = $queryResult ? '<span class="fi-asterisk alertHeader" aria-hidden="true"></span><h2>Success!</h2> Location has been updated!' : '<span class="fi-asterisk alertHeader" aria-hidden="true"></span><h2>Warning!</h2> Location was not updated. Please try again.'; $messageSpanClass = $queryResult ? 'info' : 'alert'; // display query result message $queryAlert = '<div data-alert class="alert-box ' . $messageSpanClass . '"> <span class="queryMessage">' . $message . '</span> <a href="#" class="close">×</a> </div> <script>$(".alert-box").hide().prependTo("#queryAlert").slideDown(800, "swing");</script> '; } if (isset($_POST['btnDeleteLocation'])) { // update entry $queryResult = deleteTags($link, 'location'); // assign message to query result