Update attachment

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Extensions Robot
Extensions Robot
Extensions Robot
Posts: 29220
Joined: Sat Aug 16, 2003 7:36 am

Update attachment

Post by Extensions Robot »

Modification name: Update attachment
Author: rxu
Modification description: This mod adds an "Update attachment" button to upload attachments form.
Modification version: 1.0.3
Tested on phpBB version: 3.0.1

Download file: Update_attachment_1.0.3.zip
File size: 30951 Bytes

Modification overview page: View

The phpBB Team is not responsible nor required to provide support for this modification. By installing this MOD, you acknowledge that the phpBB Support Team or phpBB Modifications Team may not be able to provide support.

-->Modification support<--
Last edited by Extensions Robot on Tue Feb 08, 2011 4:27 am, edited 5 times in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28619
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Update attachment

Post by Paul »

Modification validated/released

Notes:
rxu
Extensions Development Team
Posts: 3711
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Contact:

Update attachment

Post by rxu »

Thanks, Paul :)

The MOD adds an "Update attachment" button to the posting form. This button is to upload new versions of already uploaded attchmments so download/vew count and attachment id (download link) will be keeped.
This feature is similar to the one from File attachment MOD for phpBB2 by Acyd Burn.
Last edited by rxu on Thu May 22, 2008 12:54 pm, edited 2 times in total.
DaannO
Registered User
Posts: 86
Joined: Mon Sep 17, 2007 11:24 am

Re: Update attachment

Post by DaannO »

What does this do then?
User avatar
SAFFLEUR
Registered User
Posts: 323
Joined: Thu Nov 24, 2005 5:56 am
Location: Lenoir NC
Contact:

Re: Update attachment

Post by SAFFLEUR »

DaannO wrote:What does this do then?
This mod adds an "Update attachment" button to upload attachments form.

It let's you update the attachment on your post.
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Update attachment

Post by stokerpiller »

I am not sure that I get this?
Update attachment, why?

Can You attach a new zip file and keep the download count?
I am done with phpBB
User avatar
alecrust
Registered User
Posts: 348
Joined: Thu Mar 27, 2008 11:24 am
Location: London, UK
Contact:

Re: Update attachment

Post by alecrust »

I think I understand what it does, but if you could explain it better I'm sure it would be helpful for everyone.
rxu
Extensions Development Team
Posts: 3711
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Contact:

Re: Update attachment

Post by rxu »

User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: Update attachment

Post by karlsemple »

I think the confusion lies in the fact the update button is not added to the file upload box(obviously) and thus it does not appear there is way to attach a new file to 'update' the existing file.


If I understand right you need to browse and select a file in the normal upload manor and then click "update file" on the file you wish to be updated....?
Image
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Update attachment

Post by stokerpiller »

Okay, now it is testet and it is working GREAT :mrgreen:

This is exactly what it does:
You have a post with an attached file.
The file needs to be updated and You click the Edit button.

Click the Upload attachment, find the new file at Your computer BUT DONT click to add the file.
If You want You can change the description.
Click the Update file button instead, see pic:
Image

Then the file is updated.
Last edited by stokerpiller on Sat Jun 07, 2008 5:32 pm, edited 1 time in total.
I am done with phpBB
rxu
Extensions Development Team
Posts: 3711
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Contact:

Re: Update attachment

Post by rxu »

Sorry for the bad MOD description guys. :?
karlsemple wrote:If I understand right you need to browse and select a file in the normal upload manor and then click "update file" on the file you wish to be updated....?
Exactly, Karl :)
stokerpiller wrote:Okay, now it is testet and it is working GREAT
Thanks for the testing and explanation :D
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Update attachment

Post by stokerpiller »

When an administrator try to update a users attachment, we get this error:

Code: Select all

General Error
You are not allowed to access this file.
Please notify the board administrator or webmaster:......
I am done with phpBB
User avatar
ErnadoO
Registered User
Posts: 337
Joined: Thu Jun 08, 2006 2:32 pm
Location: France
Name: Erwan Nader
Contact:

Re: Update attachment

Post by ErnadoO »

Yes, because in this case, poster_id in phpbb_attachments is changed, and this query (in message_parser.php):

Code: Select all

        // Regenerate already posted attachments
        if (sizeof($not_orphan))
        {
            // Get the attachment data, based on the poster id...
            $sql = 'SELECT attach_id, is_orphan, real_filename, attach_comment
                FROM ' . ATTACHMENTS_TABLE . '
                WHERE ' . $db->sql_in_set('attach_id', array_keys($not_orphan)) . '
                    AND poster_id = ' . $check_user_id;
            $result = $db->sql_query($sql);

            while ($row = $db->sql_fetchrow($result))
            {
                $pos = $not_orphan[$row['attach_id']];
                $this->attachment_data[$pos] = $row;
                set_var($this->attachment_data[$pos]['attach_comment'], $_POST['attachment_data'][$pos]['attach_comment'], 'string', true);

                unset($not_orphan[$row['attach_id']]);
            }
            $db->sql_freeresult($result);
        }

        if (sizeof($not_orphan))
        {
            trigger_error('NO_ACCESS_ATTACHMENT', E_USER_ERROR);
        } 
not return all attached files.
So, $not_orphan is not empty after the loop => trigger_error() ;)
Former Administrator && MOD team leader on phpbb-fr.com
User avatar
mcdanielnc89
Registered User
Posts: 703
Joined: Tue Feb 06, 2007 10:49 pm
Location: Missouri
Contact:

Re: Update attachment

Post by mcdanielnc89 »

then why was this mod validated if that's kind of really a major error.
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Update attachment

Post by stokerpiller »

mcdanielnc89 wrote:then why was this mod validated if that's kind of really a major error.
Well, I like it to be fixed too.
But nobody promised me that Admins where able to update users attachments ;)
I am done with phpBB
Locked

Return to “[3.0.x] MOD Database Releases”