titania::$contrib->change_permalink($permalink); } } // Submit the changes titania::$contrib->submit(); // Set the coauthors titania::$contrib->set_coauthors($active_coauthors_list, $nonactive_coauthors_list, true); // Create relations titania::$contrib->put_contrib_in_categories($contrib_categories); // Update the release topic titania::$contrib->update_release_topic(); if ($change_owner == '') { redirect(titania::$contrib->get_url()); } else { $s_hidden_fields = array('submit' => true, 'change_owner' => $change_owner, 'change_owner_id' => $change_owner_id); titania::confirm_box(false, sprintf(phpbb::$user->lang['CONTRIB_CONFIRM_OWNER_CHANGE'], '<a href="' . phpbb::append_sid('memberlist', 'mode=viewprofile&u=' . $change_owner_id) . '">' . $change_owner . '</a>'), titania_url::append_url(titania_url::$current_page), $s_hidden_fields); } } } else { $sql = 'SELECT category_id FROM ' . TITANIA_CONTRIB_IN_CATEGORIES_TABLE . ' WHERE contrib_id = ' . titania::$contrib->contrib_id; $result = phpbb::$db->sql_query($sql); while ($row = phpbb::$db->sql_fetchrow($result)) { $contrib_categories[] = $row['category_id']; } phpbb::$db->sql_freeresult($result); $active_coauthors = $nonactive_coauthors = array(); foreach (titania::$contrib->coauthors as $row) { // User does not exist anymore... if (users_overlord::get_user($row['user_id'], 'user_id') != $row['user_id']) {
$tags = titania::$cache->get_tags(TITANIA_QUEUE); if (check_link_hash(request_var('hash', ''), 'quick_actions') || titania::confirm_box(true)) { $new_tag = request_var('id', 0); if (!isset($tags[$new_tag])) { trigger_error('NO_TAG'); } $queue->move($new_tag); } else { // Generate the list of tags we can move it to $extra = '<select name="id">'; foreach ($tags as $tag_id => $row) { $extra .= '<option value="' . $tag_id . '">' . (isset(phpbb::$user->lang[$row['tag_field_name']]) ? phpbb::$user->lang[$row['tag_field_name']] : $row['tag_field_name']) . '</option>'; } $extra .= '</select>'; phpbb::$template->assign_var('CONFIRM_EXTRA', $extra); titania::confirm_box(false, 'MOVE_QUEUE'); } redirect(titania_url::append_url($base_url, array('q' => $queue->queue_id))); break; } // Display the main queue item $data = queue_overlord::display_queue_item($queue_id); // Handle replying/editing/etc $posting_helper = new titania_posting(); $posting_helper->act('manage/queue_post.html'); // Display the posts in the queue (after the posting helper acts) posts_overlord::display_topic_complete($data['topic']); titania::page_header(queue_overlord::$queue[$queue_id]['topic_subject']); } else { // Subscriptions titania_subscriptions::handle_subscriptions(TITANIA_QUEUE, $queue_type, titania_url::$current_page_url);
private function common_delete($post_id, $undelete = false) { titania::add_lang('posting'); phpbb::$user->add_lang('posting'); // Load the stuff we need $post_object = $this->load_post($post_id); // Check permissions if (!$undelete && !$post_object->acl_get('delete') || $undelete && !$post_object->acl_get('undelete')) { titania::needs_auth(); } if (titania::confirm_box(true)) { if (!$undelete) { $redirect_post_id = false; // Delete the post if (isset($_POST['hard_delete']) || $post_object->post_deleted) { if (!phpbb::$auth->acl_get('u_titania_post_hard_delete')) { titania::needs_auth(); } $post_object->hard_delete(); // Try to redirect to the next or previous post $redirect_post_id = posts_overlord::next_prev_post_id($post_object->topic_id, $post_object->post_id); if ($redirect_post_id) { redirect(titania_url::append_url($post_object->topic->get_url(), array('p' => $redirect_post_id, '#p' => $redirect_post_id))); } redirect(titania_url::build_url($post_object->topic->topic_url)); } else { $post_object->soft_delete(); if (phpbb::$auth->acl_get('u_titania_mod_post_mod')) { // They can see the post, redirect back to it redirect($post_object->get_url()); } else { // They cannot see the post, try to redirect to the next or previous post $redirect_post_id = posts_overlord::next_prev_post_id($post_object->topic_id, $post_object->post_id); if ($redirect_post_id) { redirect(titania_url::append_url($post_object->topic->get_url(), array('p' => $redirect_post_id, '#p' => $redirect_post_id))); } } } redirect($post_object->topic->get_url()); } else { $post_object->undelete(); redirect($post_object->get_url()); } } else { phpbb::$template->assign_var('S_HARD_DELETE', !$undelete && !$post_object->post_deleted && phpbb::$auth->acl_get('u_titania_post_hard_delete') ? true : false); titania::confirm_box(false, !$undelete ? 'DELETE_POST' : 'UNDELETE_POST', '', array(), 'posting/delete_confirm.html'); } redirect($post_object->get_url()); }
load_contrib(); if ($page == 'report') { // Check permissions if (!phpbb::$user->data['is_registered']) { titania::needs_auth(); } titania::add_lang('posting'); phpbb::$user->add_lang('mcp'); if (titania::confirm_box(true)) { $message = utf8_normalize_nfc(request_var('report_text', '', true)); titania::$contrib->report($message); // Notifications redirect(titania::$contrib->get_url()); } else { //phpbb::$template->assign_var('S_CAN_NOTIFY', ((phpbb::$user->data['is_registered']) ? true : false)); titania::confirm_box(false, 'REPORT_CONTRIBUTION', '', array(), 'posting/report_body.html'); } redirect(titania::$contrib->get_url()); } titania::$contrib->get_download(); titania::$contrib->get_revisions(); titania::$contrib->get_screenshots(); titania::$contrib->get_rating(); titania::$contrib->assign_details(); if (!phpbb::$user->data['is_bot']) { titania::$contrib->increase_view_counter(); } // Set tracking titania_tracking::track(TITANIA_CONTRIB, titania::$contrib->contrib_id); // Subscriptions titania_subscriptions::handle_subscriptions(TITANIA_CONTRIB, titania::$contrib->contrib_id, titania::$contrib->get_url());
redirect($faq->get_url()); } } $message->display(); phpbb::$template->assign_vars(array('L_POST_A' => phpbb::$user->lang[$action == 'edit' ? 'EDIT_FAQ' : 'CREATE_FAQ'], 'ERROR_MSG' => sizeof($error) ? implode('<br />', $error) : '', 'S_EDIT' => true, 'S_POST_ACTION' => $faq->get_url($action, $faq->faq_id))); titania::page_header($action == 'edit' ? 'EDIT_FAQ' : 'CREATE_FAQ'); break; case 'delete': if (!phpbb::$auth->acl_get('u_titania_mod_faq_mod') && !phpbb::$auth->acl_get('u_titania_faq_delete') && !titania::$contrib->is_author && !titania::$contrib->is_active_coauthor) { titania::needs_auth(); } if (titania::confirm_box(true)) { $faq->delete(); redirect(titania::$contrib->get_url('faq')); } else { titania::confirm_box(false, 'DELETE_FAQ', $faq->get_url('delete')); } redirect(titania::$contrib->get_url('faq')); break; case 'move_up': case 'move_down': if (!phpbb::$auth->acl_get('u_titania_mod_faq_mod') && !titania::$contrib->is_author && !titania::$contrib->is_active_coauthor) { titania::needs_auth(); } if (!$faq_id) { trigger_error('FAQ_NOT_FOUND'); } $sql = 'SELECT * FROM ' . TITANIA_CONTRIB_FAQ_TABLE . ' WHERE faq_id = ' . (int) $faq_id; $result = phpbb::$db->sql_query($sql); $row = phpbb::$db->sql_fetchrow($result); phpbb::$db->sql_freeresult($result);
$l_explain = isset(phpbb::$user->lang[$vars['lang'] . '_EXPLAIN']) ? phpbb::$user->lang[$vars['lang'] . '_EXPLAIN'] : ''; } } $content = build_cfg_template($type, $name, $vars); if (empty($content)) { continue; } phpbb::$template->assign_block_vars('options', array('KEY' => $name, 'TITLE' => isset(phpbb::$user->lang[$vars['lang']]) ? phpbb::$user->lang[$vars['lang']] : $vars['lang'], 'S_EXPLAIN' => $vars['explain'], 'TITLE_EXPLAIN' => $l_explain, 'CONTENT' => $content['tpl'], 'S_FIND_USER' => isset($content['find_user']) ? true : false, 'U_FIND_USER' => isset($content['find_user']) ? phpbb::append_sid('memberlist', array('mode' => 'searchuser', 'form' => 'select_user', 'field' => 'username', 'select_single' => 'true', 'form' => 'stk', 'field' => $content['find_user_field'])) : '')); } titania::page_footer(true, 'manage/tool_options.html'); } else { if (is_string($options)) { if (titania::confirm_box(true) || isset($_GET['submit']) && check_link_hash(request_var('hash', ''), 'manage')) { $tool->run_tool(); } else { titania::confirm_box(false, $options, titania_url::build_url('manage/administration', array('t' => $plugin->tool_id))); } } else { // The page should have been setup by the tool. We will exit to prevent the redirect from below. exit; } } } // Should never get here... redirect(titania_url::build_url('manage/administration')); } else { titania::page_header('ADMINISTRATION'); titania::page_footer(true, 'manage/administration.html'); } function trigger_back($message) {