PDA

View Full Version : Attachments in private messages


Kentaurus
28 Jun 2005, 02:56
Last tested in 3.5.0 beta 4
Beta hack

With this hack you can send attachments inside private messages.
Sometimes you may want to send an image or file to another user, but
you just don't want to disclose your email or make the file public,
with this hack you can attach it to the private message.

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 (http://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.

==

I didn't think this could be done by plugins alone, but it was, although some sections were really tricky.

Please read the faq in the post below. Also please reply if you tested it and it worked for you :) much appreciated

v1.0.0
first release

v1.0.1
Fixed an elusive bug that deleted all your non-pm attachments.
Now in "valid file extensions" everything is correctly shown
Added vbulletin version check so you can't install the plugin in an unsupported version

Kentaurus
28 Jun 2005, 02:57
FAQ

I'm getting a:
Invalid Post specified. If you followed a valid link, please notify the administrator

That means the plugin was unable to get attachments permissions for the user. To solve it:



Locate a thread in your forum (one that shouldn't be deleted in a long time, it doesn't matter if it's closed). Remember it's threadid
Go to Plugin Manager and click on "private attachments - get posthash and allow attachments"
Find:
$_pmt = 1;


Replace the "1" with whatever thread id you selected in step 1, for example:
$_pmt = 560;

.Tim
28 Jun 2005, 03:37
Works just fine in IE but in Firefox the 'manage attachments' button does nothing when clicked. And after testing it out in IE the attachment doesn't show up, guess I should re-do the hack.

Kentaurus
28 Jun 2005, 04:48
Works just fine in IE but in Firefox the 'manage attachments' button does nothing when clicked. And after testing it out in IE the attachment doesn't show up, guess I should re-do the hack.
I'm using firefox myself, I never had a problem with the manage attachments button, it's the same template as the one in the new reply so if it works there....
The attachments should show up provided the hook for that is active, check in the plugins manager that the 4 hooks for the private attachments are currently active.

I forgot to say... I tested it in a blank, unmodified vb3.5 beta 3 installation

.Tim
28 Jun 2005, 05:03
The manage attachments button doesn't work at all in firefox.

eXtremeTim
28 Jun 2005, 06:07
I will install in the morning.

Dean C
28 Jun 2005, 07:27
Hey Kent, could you please reupload your attachments as one zip per file as per our new rule :) Thanks

Btw, great modification, was surprised when I saw this in plugins and not code mods ;)

Johannes de León
28 Jun 2005, 09:50
I'm using firefox myself, I never had a problem with the manage attachments button, it's the same template as the one in the new reply so if it works there....
The attachments should show up provided the hook for that is active, check in the plugins manager that the 4 hooks for the private attachments are currently active.

I forgot to say... I tested it in a blank, unmodified vb3.5 beta 3 installation
It works ok with FireFox here. Though, above the manage attachments button, the valid extensions are not shown; and the attachments fieldset is not shown either when a PM is received.

I've even tried to change the plugin's id in the database, but nothing changed.

Still, it does attach the file.

Jagged Tooth
28 Jun 2005, 12:56
Thanks Kentaurus you got me through that problem, but now some more problems.

When I do try to add a Attachment I get this

Warning: Invalid argument supplied for foreach() in \newattachment.php on line 545

the rest of the page comes out fine.

Then when I try to actually upload a file, I get this

Warning: Invalid argument supplied for foreach() in \newattachment.php on line 545

Any Ideas guys? Also I have the same problem as Johannes de León in that the list of valid extensions does not show in either in the new PM page or new Thread page.

--Jagged Tooth--

Andreas
28 Jun 2005, 13:11
Nice Hack.

One suggestion:
I think you can get rid of the Cron Script by using Hook cron_script_cleanup.

Dark_Wizard
28 Jun 2005, 15:48
Nice hack...suggestion for next version, how about per usergroup settings as to who can and cannot add attachments.

.Tim
28 Jun 2005, 22:48
The scheduled task for pm attachment clean up, wiped out all of my attachments. It first ran at 12:01am and every message with an attachment has an "edit by" message and the attachments are missing and the edit time is 12:01am, same as when the task first ran.

Kentaurus
29 Jun 2005, 00:09
.Tim, you seem to be having really strange problems, but I'll see if I can find a solution

Do you have a pop-up blocker or some configuration alike in your computer?
What vbulletin version are you running the hack in?
Do you have other hacks / plugins installed?

Also, have you tried testing the hack in a fresh, unmodified 3.5 beta 3 installation?

.Tim
29 Jun 2005, 00:28
.Tim, you seem to be having really strange problems, but I'll see if I can find a solution

Do you have a pop-up blocker or some configuration alike in your computer?
What vbulletin version are you running the hack in?
Do you have other hacks / plugins installed?

Also, have you tried testing the hack in a fresh, unmodified 3.5 beta 3 installation?

Thanks, any help is appreciated.

No, I don't have anything like that, plus the attachments were working just fine before. Yes, I have a few others installed but nothing involving attachments or pm's.

No, I haven't tried that, after I lost my attachments getting this hack working has kind of taken a back seat.

Kentaurus
29 Jun 2005, 02:42
Thanks, any help is appreciated.

No, I don't have anything like that, plus the attachments were working just fine before. Yes, I have a few others installed but nothing involving attachments or pm's.

No, I haven't tried that, after I lost my attachments getting this hack working has kind of taken a back seat.
It doesn't matter if the other hacks are pm or attachments related, could you list them to me? I'm trying to reproduce the scenario so I can fix the problem.

.Tim
29 Jun 2005, 02:58
It doesn't matter if the other hacks are pm or attachments related, could you list them to me? I'm trying to reproduce the scenario so I can fix the problem.

ucash
last seen online
new posts and reputation comments
arcade
custom wol
who visited today

coffeefix
03 Jul 2005, 06:49
when recieving a pm inwhich a file has been attached, there is no option to view the attachment, as a matter of fact the attachment doesn't show up at all.

coffeefix
06 Jul 2005, 16:50
any word on this?

theArchitect
13 Jul 2005, 03:41
It doesn't matter if the other hacks are pm or attachments related, could you list them to me? I'm trying to reproduce the scenario so I can fix the problem.
I am getting the problem that it attaches the document fine. And when it arrives there is a little paperclip to say that there is an attachment. But when I open the message there is no attachment to click on.

kwopper
15 Jul 2005, 02:17
Same issue as everyone else with viewing the attachment. It didnt matter whether it was stored in database or file folder.

Once that issue is solved this will be an excelent hack and very easy to install.

Kentaurus
17 Jul 2005, 18:57
I uploaded a new version. For upgrading please:
In the "plugin manager" delete all plugins that have "private attachments - " as a prefix, there are 4 of them
re-upload privateattachments.xml from download/update plugins
re-upload privateattachments.php in your includes/cron folder

Thanks to .Tim for the help in debugging this, I'm terribly sorry about the bug in deleting attachments, it's finally fixed.

I am now trying to find why the attachments wouldn't be displayed, they show fine in my installation, I tried sending a pm with attachments from "user1" to "user2", mixing images and documents.... didn't have any issues, user2 can see the attachments in the pm just fine.

Does the fieldset that says "attached images" and "attached files" appears, or does nothing appears at all? Could you also try seeing the pm in the "sent items" folders and check if the attachments show there?

theArchitect
18 Jul 2005, 01:12
I uploaded a new version. For upgrading please:
In the "plugin manager" delete all plugins that have "private attachments - " as a prefix, there are 4 of them
re-upload privateattachments.xml from download/update plugins
re-upload privateattachments.php in your includes/cron folder

Thanks to .Tim for the help in debugging this, I'm terribly sorry about the bug in deleting attachments, it's finally fixed.

I am now trying to find why the attachments wouldn't be displayed, they show fine in my installation, I tried sending a pm with attachments from "user1" to "user2", mixing images and documents.... didn't have any issues, user2 can see the attachments in the pm just fine.

Does the fieldset that says "attached images" and "attached files" appears, or does nothing appears at all? Could you also try seeing the pm in the "sent items" folders and check if the attachments show there?

Just in case I am missing something what template displays the recieved message?

I get the little paper clip in the general inbox view, but I can't see the attachment when I open the PM. All I can think is that I have missed a template mod.

.Tim
18 Jul 2005, 03:14
Thanks to .Tim for the help in debugging this, I'm terribly sorry about the bug in deleting attachments, it's finally fixed.

Now if you can just help me finish building this time machine so I can go back in time and hit myself over the head with a chair before I attempt to install this without backing up my database first.

Kentaurus
18 Jul 2005, 04:47
Now if you can just help me finish building this time machine so I can go back in time and hit myself over the head with a chair before I attempt to install this without backing up my database first.

Can't help you with that I'm afraid....
I did add a giant "Beta Hack" legend to the first post.... before it was just the tiny little checkbox to the right. Wish I could do something to help you recover your attachments.

Johannes de León
18 Jul 2005, 13:17
It still doesn't show up when one is reading a message. See attachments.

theArchitect
18 Jul 2005, 22:35
It still doesn't show up when one is reading a message. See attachments.

Yep. That is exactly what I am getting.

burnist
19 Jul 2005, 10:58
Well, its working for me :)

Only thing is its templates are un cached, not saying its your fault but we really need to work out some way of adding to those arrays.

fabrizio
19 Jul 2005, 18:42
Hello here.

Do you know if this modification works well on vBulletn 3.0.7 (the latest one)?

Thank you for any information.

Fab.

Johannes de León
19 Jul 2005, 19:06
Hello here.

Do you know if this modification works well on vBulletn 3.0.7 (the latest one)?

Thank you for any information.

Fab.
No, it will not work, it is a plugin, vB 3.0.7 doesn't support plugins.

Kentaurus
22 Jul 2005, 13:06
Hello here.

Do you know if this modification works well on vBulletn 3.0.7 (the latest one)?

Thank you for any information.

Fab.

Only in vbulletin 3.5 beta 4

Boofo
25 Jul 2005, 15:38
In my sent items, the message has a paperclip but there is no attachment showing when viewing the message.

Neutral Singh
26 Jul 2005, 10:49
Same here, no attachement showing when viewing the message. :( I needed this mod desperately. Any way through this problem ?

theArchitect
26 Jul 2005, 11:11
Kentaurus, I know you are very busy, but I too (as already stated) would love to be able to use this mod on my forum, but am having the same problem.

I know it is hard fixing a bug you can't re-create, but any assistance would be apprecaited.

BamaStangGuy
28 Jul 2005, 03:34
Def doesnt work for RC1 (atleast for me)

Boofo
28 Jul 2005, 05:35
Ok, I've narrowed it down a little further. ;)

The paperclip shows when listing private messages. It does NOT show the attachment in the sent messages and the person who the attachment was sent to does NOT get an attachment in their pm. But when viewing the attachments listing in the Admin CP, the attachment is there.

Hope this helps in tracking it down. ;)

BamaStangGuy
31 Jul 2005, 05:12
bump... would be nice to get this updated :)

FleaBag
31 Jul 2005, 13:10
Kentaurus... Any idea if it'll work with RC1 with the current install info. Normally I'd go ahead and install but I don't like the look of the bug that deleted all attachments lol!

kwopper
01 Aug 2005, 15:28
Kentaurus... Any idea if it'll work with RC1 with the current install info. Normally I'd go ahead and install but I don't like the look of the bug that deleted all attachments lol!


This doesnt work with RC1. Comes up with error stating needs Beta4 and found RC1. Will not allow access to pms. Hopefully this hack will be updated.

southernlady
02 Aug 2005, 16:03
Yeap, I lost this one as well when I upgraded to RC1. Would love to get it back as soon as you figure it out. Liz

Boofo
02 Aug 2005, 16:23
This doesnt work with RC1. Comes up with error stating needs Beta4 and found RC1. Will not allow access to pms. Hopefully this hack will be updated.

Bypassing the error is easy. It just doesn't work as it should yet.

kwopper
02 Aug 2005, 21:44
Bypassing the error is easy. It just doesn't work as it should yet.


Thanks Boofo...any inside info about an update? :nervous:

gonzo0815
12 Aug 2005, 08:55
Comes here a new Version for RC2?

Thx Gonzo

Fjörgyn
12 Aug 2005, 22:37
How can I deinstalled it?

Become 3.5.0 Beta 4 is needed for private attachments plugin, found 3.5.0 Release Candidate 2

Fjörgyn
12 Aug 2005, 22:58
Nothing is going anymore :ermm:

showthread.php?
private.php?do=newpm

3.5.0 Beta 4 is needed for private attachments plugin, found 3.5.0 Release Candidate 2

Barakat
12 Aug 2005, 23:16
you need to delete all the private attachement_prefix and to remove the changeing in the template so as the board return to work .... or just unselect the plugin hack so it will work again ... til the problem fixed.....

Forumi Shqiptar
31 Aug 2005, 23:09
3.5.0 Beta 4 is needed for private attachments plugin, found 3.5.0 Release Candidate 2


get that message when i installed it any clues ?

BamaStangGuy
01 Sep 2005, 01:49
Dude just read this thread and the answer is in here

Aeolian
29 Sep 2005, 00:51
this ia a great addon.. :)

is it compatible with vb 3.5 gold..

thanx~

southernlady
29 Sep 2005, 14:41
I went to Gold last night and lost it. So no, I'm guessing it's not compatible. Liz

lordnex
01 Oct 2005, 19:10
it's not compatable.

I got the error message
"3.5.0 Beta 4 is needed for private attachments plugin, found 3.5.0"

looks like it needs to be updated.

.Tim
01 Oct 2005, 21:38
This one works with 3.5 gold.

http://www.vbulletin.org/forum/showthread.php?t=95477

:Judge:
10 Oct 2005, 06:04
Works fine for me 3.5 Gold

cbr929rrerion
28 Oct 2005, 00:29
how do you do the sql query, and is it a must?

I tried it said I dont have permission.. and im signed in as admin..

Milesian
28 Oct 2005, 08:52
I think you have to be given permission to do so specifically in the config file.

cbr929rrerion
28 Oct 2005, 14:11
Works perfectly, Changed the image size setting to allow larger images, set to open them in a new window and also to display a thumbnail..

I am running VB 3.5 Gold and CMPS 2.0

Works awesome..

VBUsers
29 Oct 2005, 10:44
3.5.0 Beta 4 is needed for private attachments plugin, found 3.5.0

can someone post the answer for this issue

OmekaTeam
29 Oct 2005, 17:38
Error:3.5.0 Beta 4 is needed for private attachments plugin, found 3.5.0.
Why?

nicedreams
26 Jan 2006, 21:24
Doesn't work in 3.5.3

3.5.0 Beta 4 is needed for private attachments plugin, found 3.5.0

Jim

baileysemt123
16 Feb 2006, 18:16
Confirming this does not work in vBulletin 3.5.3

Not the least problem is that the template hacks necessary, can't be done. E.g.,

###################################################################
# Template modifications in template "pm_newpm"
###################################################################

-------------------------------------------------------------------
search for this:
-------------------------------------------------------------------

<fieldset class="fieldset">
<legend>$vbphrase[miscellaneous_options]</legend>

That code doesn't even exist, in order to replace it with something else.

Hopefully I can save someone else from wasting their time downloading and trying to install it. If you run current vBulletin, this is a no-go.

:)

gcphost
29 Mar 2006, 05:06
The code does exist, you have to look for it.

ffevo
29 Mar 2006, 21:02
An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';
ALTER TABLE attachment add itemid int not null;
ALTER TABLE pmtext add attac' at line 1


can anyone fix this?

ffevo
29 Mar 2006, 21:12
Is there anyway i can undo the database changes it has already done? 3.5.0 Beta 4 is needed for private attachments plugin, found 3.5.3

gcphost
30 Mar 2006, 00:57
If you always got the above error theres nothing you need to undo as it didnt work. To be sure load up a mysql editor and check it out.

You have to modify the prefix to the table as it says:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



I'm using vb_ as my prefix so its like:

ALTER TABLE vb_attachment add usedin varchar(30) not null;
ALTER TABLE vb_attachment add itemid int not null;
ALTER TABLE vb_pmtext add attach int not null;
ALTER TABLE vb_attachment add index (usedin,itemid);


Heres the "fixed" version:
http://www.vbulletin.org/forum/showthread.php?t=95477&highlight=%5D+Attachments+in+private+messages+fixed

Working for me on 3.5.4.

yoyoyoyo
06 Dec 2006, 22:10
I just did a version check and it said that version 1.5.5 was out for this hack, yet I only see 1.5.3 - does anyone know where to get the latest version?

MrPHD
06 Dec 2006, 23:10
Installed and running.Thanks

ag24
19 Jan 2010, 11:25
what is this:
Fatal error: Call to undefined function compile_template() in /home/net20617/domains/parsipeople.com/public_html/forum/global.php(1091) : eval()'d code on line 12
?
when i active this modification my forum give this eror:((