Kirupa, can you add this hack?

***********************************************************************
***********************************************************************
****                                                               ****
****  ADD ATTACHMENT ON EDIT POST HACK version 1.0 - by Tommy Boy  ****
****                                                               ****
***********************************************************************
***********************************************************************

Description:
--------------------------------------------------------------------------------
After installing this hack, you will be able to post new attachment when
editing posts, even if these posts did not have a prior attachment.
--------------------------------------------------------------------------------

  
Open editpost.php, and look for:
--------------------------------------------------------------------------------
require("./global.php");
--------------------------------------------------------------------------------

Before it, add:
--------------------------------------------------------------------------------
$templatesused.=",newpost_attachment"; // Add attachment on edit post hack
--------------------------------------------------------------------------------


Still in editpost.php, look for:
--------------------------------------------------------------------------------
    eval("\$editattachment = \"".gettemplate("editpost_attachment")."\";");
  }
--------------------------------------------------------------------------------

After it, add:
--------------------------------------------------------------------------------
  // Add attachment on edit post hack (start)
  else
  {
    $maxattachsize_temp = getmaxattachsize ();
    eval("\$editattachment = \"".gettemplate("newpost_attachment")."\";");
  }
  // Add attachment on edit post hack (end)
--------------------------------------------------------------------------------


Still in editpost.php, look for:
--------------------------------------------------------------------------------
              $DB_site->query("DELETE FROM attachment WHERE attachmentid=$postinfo[attachmentid]");
			}
    }
  }
--------------------------------------------------------------------------------

After it, add:
--------------------------------------------------------------------------------
  // Add attachment on edit post hack (start)
  elseif (trim($attachment)!="none" and trim($attachment)!="" and trim($attachment_name)!="")
  {
    $attachmentid=acceptupload($foruminfo[moderateattach]);
    $attachmentsql=",attachmentid='$attachmentid'";
  }
  // Add attachment on edit post hack (end)
--------------------------------------------------------------------------------


There you go! :-)
 

useful :slight_smile:

Just wondering eyez, would it be possible for you to give me the exact link where you got this code from? I am usually a little skeptical of installing 3rd party hacks that haven’t been verified as good by vbulletin.org or something :slight_smile:

Seems very useful :slight_smile:

Yep, that would be very nice. :slight_smile:

And just go and install the hack, Kirupa. If the forums get all screwed up, then we’ll know it wasn’t that good. :stuck_out_tongue:

…Just kidding. It’s always best to be sure about these things. :wink:

hehe :slight_smile: Besides, vBulletin 3 comes with a nifty attachment tool for edited posts. The vbulletin.com/org sites have been down for the past few days. I hope it’s because they have released vb3 and everyone crashed their servers by downloading it :beam:

LOL - I hope so too! :stuck_out_tongue:

Will you install vB3 as soon as the “final” version is available, Kirupa? :slight_smile:

yeah - more than likely :slight_smile:

Good. I can’t wait, I love all those new features! :love: