# Kirupa, can you add this hack?

**URL:** https://forum.kirupa.com/t/kirupa-can-you-add-this-hack/102247
**Category:** Uncategorized
**Created:** [February 21, 2004, 8:23am UTC](https://forum.kirupa.com/t/kirupa-can-you-add-this-hack/102247 "2004-02-21T08:23:23Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![eyezberg](https://avatars.discourse-cdn.com/v4/letter/e/77aa72/32.png) [@eyezberg](https://forum.kirupa.com/u/eyezberg)
#### Post date: [February 21, 2004, 8:23am UTC](https://forum.kirupa.com/t/kirupa-can-you-add-this-hack/102247/1 "2004-02-21T08:23:23Z")

</div>

```php
***********************************************************************
 ***********************************************************************
 ********
 ****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! :-)
 

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 10:16am UTC](https://forum.kirupa.com/t/kirupa-can-you-add-this-hack/102247/2 "2004-02-21T10:16:17Z")

</div>

useful 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 4:03pm UTC](https://forum.kirupa.com/t/kirupa-can-you-add-this-hack/102247/3 "2004-02-21T16:03:10Z")

</div>

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](http://vbulletin.org) or something 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 4:07pm UTC](https://forum.kirupa.com/t/kirupa-can-you-add-this-hack/102247/4 "2004-02-21T16:07:42Z")

</div>

Seems very useful 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 4:36pm UTC](https://forum.kirupa.com/t/kirupa-can-you-add-this-hack/102247/5 "2004-02-21T16:36:58Z")

</div>

Yep, that would be very nice. 🙂

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

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 5:46pm UTC](https://forum.kirupa.com/t/kirupa-can-you-add-this-hack/102247/6 "2004-02-21T17:46:41Z")

</div>

hehe 🙂 Besides, vBulletin 3 comes with a nifty attachment tool for edited posts. The [vbulletin.com/org](http://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:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 5:49pm UTC](https://forum.kirupa.com/t/kirupa-can-you-add-this-hack/102247/7 "2004-02-21T17:49:31Z")

</div>

LOL - I hope so too! 😛

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 6:00pm UTC](https://forum.kirupa.com/t/kirupa-can-you-add-this-hack/102247/8 "2004-02-21T18:00:51Z")

</div>

yeah - more than likely 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 6:33pm UTC](https://forum.kirupa.com/t/kirupa-can-you-add-this-hack/102247/9 "2004-02-21T18:33:24Z")

</div>

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