if (($search_mode == 'bookmarks') && !$user->data['session_logged_in']) { redirect(append_sid(CMS_PAGE_LOGIN . '?redirect=' . CMS_PAGE_SEARCH . '?search_id=bookmarks&search_mode=bookmarks', true)); } if (($search_mode == 'bookmarks') && ($mode == 'removebm')) { // Delete Bookmarks $delete = (isset($_POST['delete'])) ? true : false; if ($delete && isset($_POST['topic_id_list'])) { $topics = request_post_var('topic_id_list', array(0)); $topic_list = implode(',', $topics); if ($user->data['session_logged_in']) { remove_bookmark($topic_list); redirect(append_sid(CMS_PAGE_SEARCH . '?search_id=bookmarks&search_mode=bookmarks' . (!empty($start) ? ('&start=' . $start) : ''), true)); } } // Reset settings $mode = ''; } if ($mode == 'searchuser') { // This handles the simple windowed user search functions called from various other scripts $search_username = request_var('search_username', '', true); $search_username = htmlspecialchars_decode($search_username, ENT_COMPAT); username_search($search_username); exit; }
<?php require_once "../../../../wp-load.php"; header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past if (isset($_POST['post_id'])) { $ret_val = add_to_bookmark($_POST['post_id'], $_POST['user_id']); if ($ret_val == "true") { echo __("Successfully added ", "colabsthemes"); } elseif ($ret_val == "exists") { echo __("Already Exists ", "colabsthemes"); } } $success = false; if (isset($_POST['bookmark_id'])) { $bookmark_val = remove_bookmark($_POST['bookmark_id']); if ($bookmark_val == true) { $success = true; } }
} elseif (db_available()) { $message .= ' (sign in to have it stored for you automatically)'; } } $editing = $params['post'] || isset($seditid) || strlen($bbcode) == 0 && strlen($title) == 0; $newcode = !isset($seditid); // see also $actions array in parse_surl if ($action == 'initdb' && NEED_INIT_DB) { initdb(); } elseif ($action == 'fmtlist') { $fmtdesc = get_format_arrays(); return_json($fmtdesc); } elseif ($action == 'save') { save($params, $data); } elseif ($action == 'forget' && isset($userid) && isset($scodeid)) { if (remove_bookmark($userid, $scodeid)) { $message .= 'This map has been removed from your library.'; } } elseif ($action == 'signout') { unset($_SESSION['user_id']); unset($userid); } elseif ($action == 'bookmark' && isset($userid) && $data) { update_library($userid, $params['id'], ''); $message = 'The code was added to your library'; } elseif ($action == 'import' && isset($_FILES['file'])) { if (!is_uploaded_file($_FILES['file']['tmp_name']) || $_FILES['file']['size'] == 0 || $_FILES['file']['error'] > 0) { $errors = array('OK', 'too big', 'bigger than MAX_FILE_SIZE', 'partial upload', 'no file', '', 'nowhere to store', 'failed to write', 'extension error'); $err = $errors[$_FILES['file']['error']]; if ($api) { return_json(array('error' => 'File upload error: ' . $err, 'code' => $_FILES['file']['error'])); } else {
// Set or remove bookmark - BEGIN $setbm = request_var('setbm', ''); $removebm = request_var('removebm', ''); if ((!empty($setbm) || !empty($removebm)) && !$user->data['is_bot']) { $redirect = CMS_PAGE_VIEWTOPIC . '?' . $forum_id_append . '&' . $topic_id_append . $kb_mode_append_red . '&start=' . $start . $vt_sort_append_red . '&highlight=' . urlencode($_GET['highlight']); if ($user->data['session_logged_in']) { if (!empty($setbm)) { set_bookmark($topic_id); } elseif (!empty($removebm)) { remove_bookmark($topic_id); } } else { if (!empty($setbm)) { $redirect .= '&setbm=true'; } elseif (!empty($removebm)) { $redirect .= '&removebm=true'; } redirect(append_sid(CMS_PAGE_LOGIN . '?redirect=' . $redirect, true)); } redirect(append_sid($redirect, true));