if (!$topic) { die('0'); } $tag_name = rawurldecode($tag_name); $x = new nxt_Ajax_Response(); foreach (bb_add_topic_tags($id, $tag_name) as $tag_id) { if (!is_numeric($tag_id) || !($tag = bb_get_tag((int) $tag_id, bb_get_current_user_info('id'), $topic->topic_id))) { if (!($tag = bb_get_tag($tag_id))) { continue; } } $tag->tag_id = $tag_id; $tag->user_id = bb_get_current_user_info('id'); $tag_id_val = $tag->tag_id . '_' . $tag->user_id; $tag->raw_tag = esc_attr($tag_name); $x->add(array('what' => 'tag', 'id' => $tag_id_val, 'data' => _bb_list_tag_item($tag, array('list_id' => 'tags-list', 'format' => 'list')))); } $x->send(); break; case 'delete-tag': list($tag_id, $user_id) = explode('_', $_POST['id']); $tag_id = (int) $tag_id; $user_id = (int) $user_id; $topic_id = (int) $_POST['topic_id']; if (!bb_current_user_can('edit_tag_by_on', $user_id, $topic_id)) { die('-1'); } bb_check_ajax_referer("remove-tag_{$tag_id}|{$topic_id}"); add_action('bb_rpe_tag_removed', 'bb_grab_results', 10, 3); $tag = bb_get_tag($tag_id); $user = bb_get_user($user_id);
case 'draft': $stat = __('Draft'); break; } if ('0000-00-00 00:00:00' == $post->post_date) { $time = ''; } else { /* translators: date format in table columns, see http://php.net/date */ $time = mysql2date(__('Y/m/d'), $post->post_date); } $html .= '<tr class="found-posts"><td class="found-radio"><input type="radio" id="found-' . $post->ID . '" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>'; $html .= '<td><label for="found-' . $post->ID . '">' . esc_html($post->post_title) . '</label></td><td>' . esc_html($time) . '</td><td>' . esc_html($stat) . '</td></tr>' . "\n\n"; } $html .= '</tbody></table>'; $x = new nxt_Ajax_Response(); $x->add(array('what' => $what, 'data' => $html)); $x->send(); break; case 'widgets-order': check_ajax_referer('save-sidebar-widgets', 'savewidgets'); if (!current_user_can('edit_theme_options')) { die('-1'); } unset($_POST['savewidgets'], $_POST['action']); // save widgets order for all sidebars if (is_array($_POST['sidebars'])) { $sidebars = array(); foreach ($_POST['sidebars'] as $key => $val) { $sb = array(); if (!empty($val)) { $val = explode(',', $val);