$topic, 'limit' => 1, ) ); $row = $smcFunc['db_fetch_assoc']($request); $smcFunc['db_free_result']($request); // Check if he is allowed. if (!allowedTo('solve_topic_any') && $user_info['id'] == $row['id_member_started']) isAllowedTo('solve_topic_own'); else isAllowedTo('solve_topic_any'); // Change the status. $smcFunc['db_query']('', ' UPDATE {db_prefix}topics SET is_solved = {int:is_solved} WHERE id_topic = {int:topic} LIMIT {int:limit}', array( 'topic' => $topic, 'is_solved' => empty($row['is_solved']) ? 1 : 0, 'limit' => 1, ) ); // Change the icon. $smcFunc['db_query']('', ' UPDATE {db_prefix}messages SET icon = {string:icon} WHERE id_msg = {int:msg} LIMIT {int:limit}', array( 'msg' => $row['id_first_msg'], 'icon' => empty($row['is_solved']) ? 'topicsolved' : 'xx', 'limit' => 1, ) ); // Do some logging, only for moderators though... if ($user_info['id'] != $row['id_member_started']) logAction(empty($row['is_solved']) ? 'solve' : 'not_solve', array('topic' => $topic, 'board' => $board), 'topic_solved'); // Take us back to last post. redirectexit('topic=' . $topic . '.msg' . $row['id_last_msg'] . '#new'); } ?>