Warning: The author of this contribution does not provide support for it anymore.

ReIMG Image Resizer

ReIMG and jQuery Quick Edit - ReIMG Image Resizer

ReIMG and jQuery Quick Edit

by sucofin » Sat Aug 06, 2011 2:58 pm

Hi, I use the jQuery Quick Edit 1.0.0 mod and unfortunately the pictures are not reduced (use latest version of ReIMG), when I used those. Is there a solution? heartfelt thanks and sorry for the English poor, have used a translator.
sucofin
Registered User
Posts: 8
Joined: Sat Aug 06, 2011 12:12 pm
Contact:

Re: ReIMG and jQuery Quick Edit

by DavidIQ » Sun Aug 07, 2011 3:46 am

Far as I know there is no conflict with jQuery and this MOD. You'll need to provide an example of where it is not resizing the image.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17069
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: ReIMG and jQuery Quick Edit

by sucofin » Sun Aug 07, 2011 2:34 pm

hello, thank you for the quick response. Please go on and make a contribution sl1000.de embedded with an image. then please go to change contribution, change him, just to write one word and you will see that the image is not reduced again, but only after full reload the page.

name: test
password: test
sucofin
Registered User
Posts: 8
Joined: Sat Aug 06, 2011 12:12 pm
Contact:

Re: ReIMG and jQuery Quick Edit

by DavidIQ » Sun Aug 07, 2011 2:59 pm

If you're talking about the review panel that is a known issue.

If not then that is something you will need to talk to the person that wrote that other MOD about.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17069
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: ReIMG and jQuery Quick Edit

by sucofin » Sun Aug 07, 2011 3:14 pm

Thank you for responding. The problem seems to be that of the other mod uses ajax and thus held no page reload. Although the article is thus changed, but the image of image resize does not shrink back. because they can not help me further?
sucofin
Registered User
Posts: 8
Joined: Sat Aug 06, 2011 12:12 pm
Contact:

Re: ReIMG and jQuery Quick Edit

by DavidIQ » Mon Aug 08, 2011 2:24 am

The solution would be to call the resize function for that specific image after the post is updated. I don't know anything about the AJAX quick edit MOD and is why the MOD author would need to either provide a code block of where the post gets updated so I can maybe indicate where it needs to be called or fix it on their own.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17069
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: ReIMG and jQuery Quick Edit

by sucofin » Mon Aug 08, 2011 6:26 pm

Herzlichen Dank für Ihre Antwort. Leider habe ich absolut keine Ahnung von Ajax und Mods erstellen, deshalb habe ich das Problem auch an den anderen Autor gemeldet und zwar hier: http://goo.gl/acdhG . Thank you.
sucofin
Registered User
Posts: 8
Joined: Sat Aug 06, 2011 12:12 pm
Contact:

Re: ReIMG and jQuery Quick Edit

by Marc » Mon Aug 08, 2011 7:39 pm

@sucofin: Please speak English.

@David: This is the code that submits the post data and also generates the "submitted" post:

Code: Select all

      $uid = $bitfield = '';
      
      // start parsing the text for the database
      $message_parser = new parse_message();
      
      $message_parser->message = $post_text;
      
      // Always check if the submitted attachment data is valid and belongs to the user.
      // Further down (especially in submit_post()) we do not check this again.
      $message_parser->get_submitted_attachment_data($post_data['poster_id']);

      if ($post_data['post_attachment'])
      {
         // Do not change to SELECT *
         $sql = 'SELECT attach_id, is_orphan, attach_comment, real_filename
            FROM ' . ATTACHMENTS_TABLE . '
            WHERE post_msg_id = ' . (int)$post_id . '
               AND in_message = 0
               AND is_orphan = 0
            ORDER BY filetime DESC';
         $result = $db->sql_query($sql);
         $message_parser->attachment_data = array_merge($message_parser->attachment_data, $db->sql_fetchrowset($result));
         $db->sql_freeresult($result);
      }
      
      if(isset($post_data['bbcode_uid']) && $post_data['bbcode_uid'] > 0)
      {
         $message_parser->bbcode_uid = $post_data['bbcode_uid'];
      }

      // this will tell us if there are any errors with the post
      $message_parser->parse($bbcode_status, ($url_status) ? $post_data['enable_magic_url'] : false, $smilies_status, $img_status, $flash_status, $quote_status, $config['allow_post_links'], true);
      
      // insert info into the sql_ary
      $uid = $message_parser->bbcode_uid;
      $bitfield = $message_parser->bbcode_bitfield;
      
      //now check if we need to set the edit time and edit count
      if (!$auth->acl_get('m_edit', $post_data['forum_id']))
      {
         $edit_time = time();
         $edit_count = $post_data['post_edit_count'] + 1;
         $edit_user = $user->data['user_id'];
      }
      elseif ($auth->acl_get('m_edit', $post_data['forum_id']) && $post_data['post_edit_reason'] && $post_data['post_edit_user'] == $user->data['user_id'])
      {
         $edit_time = time();
         $edit_count = $post_data['post_edit_count'] + 1;
         $edit_user = $user->data['user_id'];
      }
      else
      {
         $edit_time = (isset($post_data['post_edit_time'])) ? $post_data['post_edit_time'] : 0;
         $edit_user = (isset($post_data['post_edit_user'])) ? $post_data['post_edit_user'] : 0;
         $edit_count = (isset($post_data['post_edit_count'])) ? $post_data['post_edit_count'] : 0;
      }
      
      // Create the data array for submit_post
      $data = array(
          // General Posting Settings
          'forum_id'             => $post_data['forum_id'],
          'topic_id'             => $post_data['topic_id'],
          'icon_id'              => $post_data['post_icon_id'],
          'post_id'         => $post_data['post_id'],
          'poster_id'         => $post_data['poster_id'],
          'topic_replies'      => $post_data['topic_replies'],
          'topic_replies_real'   => $post_data['topic_replies_real'],
          'topic_first_post_id'   => $post_data['topic_first_post_id'],
          'topic_last_post_id'   => $post_data['topic_last_post_id'],
          'post_edit_user'      => $edit_user,
          'forum_parents'      => $post_data['forum_parents'],
          'forum_name'      => $post_data['forum_name'],
          'topic_poster'      => $post_data['topic_poster'],
      
          // Defining Post Options
          'enable_bbcode'    => $post_data['enable_bbcode'],
          'enable_smilies'    => $post_data['enable_smilies'],
          'enable_urls'       => $post_data['enable_magic_url'],
          'enable_sig'        => $post_data['enable_sig'],
          'topic_attachment'   => (isset($post_data['topic_attachment'])) ? (int) $post_data['topic_attachment'] : 0,
          'poster_ip'         => (isset($post_data['poster_ip'])) ? $post_data['poster_ip'] : $user->ip,
          'attachment_data'   => $message_parser->attachment_data,
          'filename_data'      => $message_parser->filename_data,
      
          // Message Body
          'message'           => $message_parser->message,
          'message_md5'      => md5($message_parser->message),
      
          // Values from generate_text_for_storage()
          'bbcode_bitfield'   => $bitfield,
          'bbcode_uid'        => $uid,
      
          // Other Options
          'post_edit_locked'  => $post_data['post_edit_locked'],
          'post_edit_reason'   => ($post_data['post_edit_reason']) ? $post_data['post_edit_reason'] : '',
          'topic_title'       => $post_data['topic_title'],
          'topic_time_limit'   => ($post_data['topic_time_limit']) ? $post_data['topic_time_limit'] : 0,
      
          // Email Notification Settings
          'notify_set'        => false,
          'notify'            => false,
          'post_time'         => 0,
          'forum_name'        => $post_data['forum_name'],
      
          // Indexing
          'enable_indexing'   => true,
      
          // 3.0.6
          'force_approved_state'  => true, // post has already been approved
      );

      $poll = array(
          'poll_title'   => $post_data['poll_title'],
          'poll_length'   => $post_data['poll_length'],
          'poll_start'   => $post_data['poll_start'],
          'poll_max_options'   => $post_data['poll_max_options'],
          'poll_vote_change'   => $post_data['poll_vote_change'],
      );

      // Get Poll Data
      if ($poll['poll_start'])
      {
         $sql = 'SELECT poll_option_text
            FROM ' . POLL_OPTIONS_TABLE . "
            WHERE topic_id = {$data['topic_id']}
            ORDER BY poll_option_id";
         $result = $db->sql_query($sql);

         while ($row = $db->sql_fetchrow($result))
         {
            $poll['poll_options'][] = trim($row['poll_option_text']);
         }
         $db->sql_freeresult($result);
      }
      
      // Always check if the submitted attachment data is valid and belongs to the user.
      // Further down (especially in submit_post()) we do not check this again.
      $message_parser->get_submitted_attachment_data($post_data['poster_id']);

      if ($post_data['post_attachment'])
      {
         // Do not change to SELECT *
         $sql = 'SELECT attach_id, is_orphan, attach_comment, real_filename
            FROM ' . ATTACHMENTS_TABLE . '
            WHERE post_msg_id = ' . (int)$post_id . '
               AND in_message = 0
               AND is_orphan = 0
            ORDER BY filetime DESC';
         $result = $db->sql_query($sql);
         $message_parser->attachment_data = array_merge($message_parser->attachment_data, $db->sql_fetchrowset($result));
         $db->sql_freeresult($result);
      }
      
      $qe_error .= implode('<br />', $message_parser->warn_msg);
      $qe_action = (strlen($qe_action) > 0) ? $qe_action : 'return'; // don't overwrite already existing qe_action
      
      
      // Don't execute all that if we already have errors
      if($qe_error == '')
      {
         /**
         * Start parsing the message for displaying the post
         * we only do this if there is no error or else we might just do useless database queries
         * Pull attachment data
         * @copyright (c) 2005 phpBB Group
         */
         if ($post_data['post_attachment'] && $config['allow_attachments'])
         {
            $attach_list[] = (int) $post_data['post_id'];
         }
         else
         {
            $attach_list = array();
         }
         
         if (sizeof($attach_list))
         {
            if ($auth->acl_get('u_download') && (empty($post_data['forum_id']) || $auth->acl_get('f_download', $post_data['forum_id'])))
            {
               $sql = 'SELECT *
                  FROM ' . ATTACHMENTS_TABLE . '
                  WHERE ' . $db->sql_in_set('post_msg_id', $attach_list) . '
                     AND in_message = 0
                  ORDER BY filetime DESC, post_msg_id ASC';
               $result = $db->sql_query($sql);

               while ($row = $db->sql_fetchrow($result))
               {
                  $attachments[$row['post_msg_id']][] = $row;
               }
               $db->sql_freeresult($result);

               // No attachments exist, but post table thinks they do so go ahead and reset post_attach flags
               if (!sizeof($attachments))
               {
                  $sql = 'UPDATE ' . POSTS_TABLE . '
                     SET post_attachment = 0
                     WHERE ' . $db->sql_in_set('post_id', $attach_list);
                  $db->sql_query($sql);

               }
            }
         }
         // Add up the flag options...
         $bbcode_options = (($post_data['enable_bbcode']) ? OPTION_FLAG_BBCODE : 0) + (($post_data['enable_smilies']) ? OPTION_FLAG_SMILIES : 0) + (($post_data['enable_magic_url']) ? OPTION_FLAG_LINKS : 0);
         // Parse the post
         $text = generate_text_for_display($data['message'], $data['bbcode_uid'], $data['bbcode_bitfield'], $bbcode_options);

         // Parse attachments
         if (!empty($attachments[$post_data['post_id']]))
         {
            parse_attachments($post_data['forum_id'], $text, $attachments[$post_data['post_id']], $update_count);
         }
         
         if (!$auth->acl_get('m_edit', $post_data['forum_id']))
         {
            $user->add_lang('viewtopic');
            
            $display_username = get_username_string('full', $post_data['poster_id'], $post_data['username'], $post_data['user_colour'], $post_data['post_username']);

            $l_edit_time_total = ($post_data['post_edit_count'] == 1) ? $user->lang['EDITED_TIME_TOTAL'] : $user->lang['EDITED_TIMES_TOTAL'];
            $l_edited_by = sprintf($l_edit_time_total, $display_username, $user->format_date($post_data['post_edit_time'], false, true), $edit_count);
            if($post_data['post_edit_reason'])
            {
               $l_edited_by .= '<br /><strong>' . $user->lang['REASON'] . ':</strong> <em>' . $post_data['post_edit_reason'] . '</em>';
            }
         }
         elseif ($auth->acl_get('m_edit', $post_data['forum_id']) && $post_data['post_edit_reason'] && $post_data['post_edit_user'] == $user->data['user_id'])
         {
            $user->add_lang('viewtopic');
            
            $display_username = get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour'], $user->data['username']);

            $l_edit_time_total = ($post_data['post_edit_count'] == 1) ? $user->lang['EDITED_TIME_TOTAL'] : $user->lang['EDITED_TIMES_TOTAL'];
            $l_edited_by = sprintf($l_edit_time_total, $display_username, $user->format_date($post_data['post_edit_time'], false, true), $edit_count);
            if($post_data['post_edit_reason'])
            {
               $l_edited_by .= '<br /><strong>' . $user->lang['REASON'] . ':</strong> <em>' . $post_data['post_edit_reason'] . '</em>';
            }
         }
         else
         {
            $l_edited_by = '0';
         }
      
         /*
         * {/qe_seperator} seperates the values for javascript
         * qe_error{/qe_seperator}qe_action{/qe_seperator}edited_by_info{/qe_seperator}message
         * since qe_error is empty, qe_action is also set to empty in the return variable
         */
         $return = "0{/qe_seperator}0{/qe_seperator}$l_edited_by{/qe_seperator}$text";
         /*
         * Don't run submit_post before we checked for errors
         * $mode is always edit as we just edit a post with this MOD
         * $username is set to $user->data['username'] as we don't need the clean username for the logs
         */
         submit_post('edit', $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data);
         echo($return); // this is needed in order to send the info back to the javascript backend
      }
User avatar
Marc
Development Team Leader
Development Team Leader
Posts: 5413
Joined: Tue Oct 30, 2007 10:57 pm
Location: Munich, Germany
Name: Marc
Contact:

Re: ReIMG and jQuery Quick Edit

by DavidIQ » Tue Aug 09, 2011 3:54 pm

Thanks Marc. Actually I need the javascript portion of it where it puts the updated message back on the page.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17069
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: ReIMG and jQuery Quick Edit

by Yosiah » Thu Oct 13, 2011 4:28 pm

Has this issue been resolved? And, if so, what is the fix?

And thanks for the awesome MOD. :)
Yosiah
Registered User
Posts: 38
Joined: Sat Oct 01, 2011 4:27 pm