Ejemplo n.º 1
0
    if ($change_owner_id !== ANONYMOUS && $change_owner_id) {
        titania::$contrib->set_contrib_user_id($change_owner_id);
        titania::$contrib->load(utf8_normalize_nfc(request_var('c', '', true)));
        // Reload the contrib (to make sure the authors list is updated)
        $submit = false;
        // Set submit as false to keep the main stuff from being resubmitted again
        redirect(titania::$contrib->get_url());
    }
}
/**
* ---------------------------- Main Page ----------------------------
*/
// Load the message object
$message = new titania_message(titania::$contrib);
$message->set_auth(array('bbcode' => phpbb::$auth->acl_get('u_titania_bbcode'), 'smilies' => phpbb::$auth->acl_get('u_titania_smilies'), 'edit_subject' => titania_types::$types[titania::$contrib->contrib_type]->acl_get('moderate')));
$message->set_settings(array('display_error' => false, 'display_subject' => false, 'subject_name' => 'name'));
// Screenshots
$screenshot = new titania_attachment(TITANIA_SCREENSHOT, titania::$contrib->contrib_id);
$screenshot->load_attachments();
$screenshot->upload(175);
$error = array_merge($error, $screenshot->error);
if ($screenshot->uploaded || isset($_POST['preview']) || $submit) {
    titania::$contrib->post_data($message);
    titania::$contrib->__set_array(array('contrib_demo' => titania::$config->can_modify_style_demo_url || titania_types::$types[TITANIA_TYPE_STYLE]->acl_get('moderate') || titania::$contrib->contrib_type != TITANIA_TYPE_STYLE ? $contrib_demo : titania::$contrib->contrib_demo, 'contrib_local_name' => utf8_normalize_nfc(request_var('contrib_local_name', '', true)), 'contrib_iso_code' => request_var('contrib_iso_code', '')));
}
if (isset($_POST['preview'])) {
    $message->preview();
} else {
    if ($submit) {
        // Handle the deletion routine
        if (isset($_POST['delete']) && phpbb::$auth->acl_get('u_titania_admin')) {
Ejemplo n.º 2
0
 /**
  * Reply to an existing topic
  *
  * @param mixed $topic_id
  */
 public function reply($topic_id, $quote_post_id = false)
 {
     if (!phpbb::$auth->acl_get('u_titania_post')) {
         titania::needs_auth();
     }
     // Load the stuff we need
     $topic = $this->load_topic($topic_id);
     $post_object = new titania_post($topic->topic_type, $topic);
     // Check permissions
     if (!$post_object->acl_get('reply')) {
         titania::needs_auth();
     }
     // Quoting?
     if ($quote_post_id !== false && $post_object->post_text == '') {
         $quote = $this->load_post($quote_post_id);
         // Permission check
         if (titania::$access_level <= min($quote->post_access, $quote->topic->topic_access) && (phpbb::$auth->acl_get('u_titania_mod_post_mod') || $quote->post_approved && (!$quote->post_deleted || $quote->post_deleted == phpbb::$user->data['user_id']))) {
             $for_edit = $quote->generate_text_for_edit();
             $post_object->post_text = '[quote="' . users_overlord::get_user($quote->post_user_id, '_username', true) . '"]' . $for_edit['text'] . '[/quote]';
         }
     }
     // Load the message object
     $message_object = new titania_message($post_object);
     $message_object->set_auth(array('bbcode' => phpbb::$auth->acl_get('u_titania_bbcode'), 'smilies' => phpbb::$auth->acl_get('u_titania_smilies'), 'lock_topic' => phpbb::$auth->acl_get('u_titania_mod_post_mod') || (phpbb::$auth->acl_get('u_titania_post_mod_own') && is_object(titania::$contrib) && titania::$contrib->contrib_id == $post_object->topic->parent_id && titania::$contrib->is_author || titania::$contrib->is_active_coauthor) ? true : false, 'attachments' => phpbb::$auth->acl_get('u_titania_post_attach')));
     $message_object->set_settings(array('display_captcha' => !phpbb::$user->data['is_registered'] ? true : false, 'subject_default_override' => 'Re: ' . $post_object->topic->topic_subject));
     // Call our common posting handler
     $this->common_post('reply', $post_object, $message_object);
     // Setup the sort tool
     $topic_sort = posts_overlord::build_sort();
     $topic_sort->set_defaults(false, false, 'd');
     // Display the posts for review
     posts_overlord::display_topic($post_object->topic, $topic_sort);
     // Common stuff
     phpbb::$template->assign_vars(array('S_POST_ACTION' => $post_object->topic->get_url('reply', titania_url::$current_page_url), 'L_POST_A' => phpbb::$user->lang['POST_REPLY'], 'S_DISPLAY_REVIEW' => true));
     titania::page_header('POST_REPLY');
 }
Ejemplo n.º 3
0
     titania::page_footer(true, 'manage/queue_post.html');
     break;
 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();
Ejemplo n.º 4
0
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
 */
/**
* @ignore
*/
if (!defined('IN_TITANIA')) {
    exit;
}
titania::$author->load();
if (titania::$author->user_id != phpbb::$user->data['user_id'] && !phpbb::$auth->acl_get('u_titania_mod_author_mod')) {
    trigger_error('NOT_AUTHORISED');
}
$message = new titania_message(titania::$author);
$message->set_auth(array('bbcode' => phpbb::$auth->acl_get('u_titania_bbcode'), 'smilies' => phpbb::$auth->acl_get('u_titania_smilies')));
$message->set_settings(array('display_error' => false, 'display_subject' => false));
$submit = isset($_POST['submit']) ? true : false;
if ($submit) {
    titania::$author->post_data($message);
    titania::$author->__set_array(array('author_realname' => utf8_normalize_nfc(request_var('realname', '', true)), 'author_website' => request_var('website', '')));
    $error = titania::$author->validate();
    if (($validate_form_key = $message->validate_form_key()) !== false) {
        $error[] = $validate_form_key;
    }
    if (!sizeof($error)) {
        // Enhanced editor data is stored in the users table
        $titania_enhanced_editor = isset($_POST['enhanced_editor']) ? true : false;
        if (titania::$author->user_id == phpbb::$user->data['user_id'] && $titania_enhanced_editor != phpbb::$user->data['titania_enhanced_editor']) {
            $sql = 'UPDATE ' . USERS_TABLE . '
				SET titania_enhanced_editor = ' . (int) $titania_enhanced_editor . '
				WHERE user_id = ' . phpbb::$user->data['user_id'];