The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
![]() |
|||||||||||||||||||||||||||
[VB3 RC3] Attachments in private messages
![]() Developer Last Online: Jul 2014 ![]() ![]()
Unsupported. VB3.5 version is here:
https://vborg.vbsupport.ru/showthread.php?t=91220 Tested on 3.0.3 This hack enables you to send attachments in a private message. This feature was really useful to me in vb2 and I kind of missed it on vb3 so I rehacked it myself. When a user writes a private message they will be given the option to add an attachment, the same as when writing a post. It uses the same rules you have defined for a convencional attachment including file types, quotas, etc. It is only an extension for attachments to be used in private messages. As always it is advised to backup your files before hacking in case you want to go back, this is some big hack including modification of multiple files, some templates and adding two extra columns in the database tables. Instructions are provided in the txt, and some screenshots on where the attachment option appears. Info for hackers: You may modify, improve, upgrade, redistribute this hack, include it in another hack or yours or translate it provided you do it free of charge and you distribute it in www.vbulletin.org at least, there is no need to pm me asking for permission Some portions of the code are (c) Jelsoft Enterprises Ltd. Edit by MarcoH64: Because of multiple requests to make this hack work on vB3.0.7 i created upgrade instructions. These upgrade instructions can be followed after the original instructions (the 3.0.3 version). The original coder can not be held responsible for my modification. Show Your Support
|
Comments |
#122
|
||||
|
||||
![]()
Shouldn't the attachment show above that button without having to click the manage attachments button to see it?
|
#123
|
||||
|
||||
![]()
It should. That way it is very similar to the normal preview way of doing it. Here is the fix.
find this: Code:
'newpost_attachment' ); Code:
'newpost_attachment', 'newpost_attachmentbit' ); Code:
eval('$attachmentoption = "' . fetch_template('newpost_attachment') . '";'); Code:
$currentattaches = $DB_site->query(" SELECT filename, filesize, attachmentid FROM " . TABLE_PREFIX . "attachment WHERE posthash = '$posthash' AND userid = $bbuserinfo[userid] "); $attachcount = 0; while ($attach = $DB_site->fetch_array($currentattaches)) { $attachcount++; $attach['extension'] = strtolower(file_extension($attach['filename'])); $attach['filename'] = htmlspecialchars_uni($attach['filename']); $attach['filesize'] = vb_number_format($attach['filesize'], 1, true); $show['attachmentlist'] = true; eval('$attachments .= "' . fetch_template('newpost_attachmentbit') . '";'); } eval('$attachmentoption = "' . fetch_template('newpost_attachment') . '";'); |
#124
|
||||
|
||||
![]()
Works great! Thanks!
![]() Is the first post updated? How would we add the attachments ability to Erwin's Quick Peply hack? ![]() |
#125
|
||||
|
||||
![]() Quote:
![]() It should be possible to add them, I'll take a look at it. |
#126
|
||||
|
||||
![]()
Can you pm me with your edits for the textarea and submit button?
![]() |
#127
|
|||
|
|||
![]()
Can you allow only certain usergroups to use this function?
|
#128
|
||||
|
||||
![]() Quote:
Anyway, what is this obsession with everything being usergroup based lately? (Second hack I get asked) With around 10 usergroups in my forum it is becoming a nightmare for me checking that every option is right.... |
#129
|
|||
|
|||
![]()
Can you just point me to the right area, and I can do the editing? I am pretty comfortable with PHP.
|
#130
|
||||
|
||||
![]() Quote:
I've installed the hack on 3/1/04 and everything seems to be working fine, except some little bug, where I'll describe in a new post! |
#131
|
||||
|
||||
![]()
Now, my problem with the hack is that the recipient clicks the attachment link, and gets an error message of: "No Post Defined". HELP
|
#132
|
||||
|
||||
![]() Quote:
Please keep in mind that if you save a copy in your sent folder that counts as a pm, so the attachment wouldn't be deleted until both the recipient's pm and your copy of the pm are deleted. It is the first time I have seen that "No post defined" error... do you have any other hack that deals with pm's or attachments installed? |
#133
|
||||
|
||||
![]()
No, I do not. Your hack is the only one I've installed at all. I went back and double checked everything. However, when I get down to the SQL, I did have problems running those. I ran each individually and it did create the three tables. Though the ALTER TABLE attachment add index (private) query gave me problems though, but I eventually did create the table manually.
|
#134
|
||||
|
||||
![]()
ok, BIG problem...... I just found out that someone can easily go to your attachment.php page in the browser and just browse through attachments! they can do this by:
attachment.php?attachmentid=1 attachment.php?attachmentid=2 attachment.php?attachmentid=3 Is there a way you can re-release this hack and change the way vBulletin handles attachments? I would suggest md5summing the attachment upon upload and assigning the checksum as the attachment ID. I certainly don't want someone browsing through my members' private attachments!!! ![]() |
#135
|
||||
|
||||
![]() Quote:
|
#136
|
||||
|
||||
![]()
Can you update the first post with all of the changes up until now, please?
![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|