I installed this hack on 2.2.9 AND have the hack that allows people to add attachments on editpost an ran into a small problem.
with a combination of this code from this hack and also the add attachment on edit post I was unable to add a 'new' attachment when editing a post. No problem replacing an attachment or deleting an attachment that was placed in the post via newthread or newreply.
Therefore I cam up with following few lines that fixed the problem in editpost.php
add this bit of code:
--------------------------
if ($attachment != '' and $attachmentaction < ' ')
{
$attachmentaction = "new";
$postinfo[attachmentid] = 999;
}
-----------------------
before:
-----------------------
if ($postinfo[attachmentid]!=0) {
// check attachment status
// keep, delete, update
-----------------------
Don't worry about the $postinfo[attachmentid] being set to 999 because a new ID is calculated later in in the code by calculating the next available key value in the attachment table primary index.
|