public function xmlhttp_buddylist_page() { global $mybb; $object = new stdClass(); $object->error = false; $object->error_message = ""; if (!isset($mybb->input["my_post_key"], $mybb->input["memberuid"]) || !is_string($mybb->input["my_post_key"]) || !verify_post_check($mybb->input["my_post_key"], true) || !is_numeric($mybb->input["memberuid"])) { return; } $page = isset($mybb->input["page"]) && is_numeric($mybb->input["page"]) && $mybb->input["page"] >= 1 ? (int) $mybb->input["page"] : 1; $memberuid = (int) $mybb->input["memberuid"]; $memprofile = get_user($memberuid); if (empty($memprofile)) { return; } list($object->html, $object->count, $object->shown) = array_values($this->retrieve_buddylist_from_db($page, $memprofile)); MyProfileUtils::output_json($object); }
public function xmlhttp_comments_delete_all() { global $mybb, $db, $settings, $lang; if ($mybb->request_method != "post") { return; } if (!isset($mybb->input["my_post_key"]) || !is_string($mybb->input["my_post_key"]) || !verify_post_check($mybb->input["my_post_key"], true)) { return; } if (!$this->can_manage_comments()) { /* nice try! */ return; } MyProfileUtils::lang_load_myprofile(); $result = new stdClass(); $result->error = false; $result->error_message = ""; if (!isset($mybb->input["memberuid"]) || !is_numeric($mybb->input["memberuid"])) { $result->error = true; $result->error_message = $lang->mp_profile_comments_no_user_selected; MyProfileUtils::output_json($result); } $memberuid = (int) $mybb->input["memberuid"]; $query = $db->delete_query("myprofilecomments", "userid='{$memberuid}'"); MyProfileUtils::output_json($result); }