case 'rebuild': $queue = queue_overlord::get_queue_object($queue_id, true); $queue->update_first_queue_post(); redirect(titania_url::append_url($base_url, array('q' => $queue->queue_id))); break; case 'allow_author_repack': $queue = queue_overlord::get_queue_object($queue_id, true); $topic = $queue->get_queue_discussion_topic(); $post = new titania_post(TITANIA_QUEUE_DISCUSSION, $topic); $post->__set_array(array('post_subject' => 'Re: ' . $post->topic->topic_subject)); // Load the message object $message_object = new titania_message($post); $message_object->set_auth(array('bbcode' => true, 'smilies' => true)); $message_object->set_settings(array('display_subject' => false)); // Submit check...handles running $post->post_data() if required $submit = $message_object->submit_check(); if ($submit) { $queue->allow_author_repack = true; $contrib = contribs_overlord::get_contrib_object($queue->contrib_id, true); $for_edit = $post->generate_text_for_edit(); $post->post_text = $for_edit['message'] . "\n\n[url=" . titania_url::append_url($contrib->get_url('revision'), array('repack' => $queue->revision_id)) . ']' . phpbb::$user->lang['AUTHOR_REPACK_LINK'] . '[/url]'; $post->generate_text_for_storage($for_edit['allow_bbcode'], $for_edit['allow_smilies'], $for_edit['allow_urls']); $post->submit(); $queue->submit(); $queue->topic_reply('QUEUE_REPLY_ALLOW_REPACK'); $queue->submit(); redirect(titania_url::append_url($base_url, array('q' => $queue->queue_id))); } $message_object->display(); // Common stuff phpbb::$template->assign_vars(array('S_POST_ACTION' => titania_url::$current_page_url, 'L_POST_A' => phpbb::$user->lang['DISCUSSION_REPLY_MESSAGE']));
} else { load_contrib(); } // Output the simple info on the contrib titania::$contrib->assign_details(true); switch ($action) { case 'create': case 'edit': if (!phpbb::$auth->acl_get('u_titania_mod_faq_mod') && !phpbb::$auth->acl_get('u_titania_faq_' . $action) && !titania::$contrib->is_author && !titania::$contrib->is_active_coauthor) { titania::needs_auth(); } // Load the message object $message = new titania_message($faq); $message->set_auth(array('bbcode' => phpbb::$auth->acl_get('u_titania_bbcode'), 'smilies' => phpbb::$auth->acl_get('u_titania_smilies'), 'attachments' => true)); // Submit check...handles running $faq->post_data() if required $submit = $message->submit_check(); $error = array_merge($error, $message->error); if ($submit) { $error = array_merge($error, $faq->validate()); if (($validate_form_key = $message->validate_form_key()) !== false) { $error[] = $validate_form_key; } if (!sizeof($error)) { $faq->submit(); $message->submit($faq->faq_id); $sql = 'SELECT right_id FROM ' . TITANIA_CONTRIB_FAQ_TABLE . ' WHERE contrib_id = ' . titania::$contrib->contrib_id . ' ORDER BY right_id DESC LIMIT 1'; $result = phpbb::$db->sql_query($sql); $right_id = (string) phpbb::$db->sql_fetchfield('right_id'); phpbb::$db->sql_freeresult($result);