Log in

View Full Version : Attachments in private messages


Kentaurus
06-27-2005, 10:00 PM
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
06-28-2005, 01:57 AM
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
06-28-2005, 02:37 AM
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
06-28-2005, 03:48 AM
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
06-28-2005, 04:03 AM
The manage attachments button doesn't work at all in firefox.

eXtremeTim
06-28-2005, 05:07 AM
I will install in the morning.

Dean C
06-28-2005, 06:27 AM
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
06-28-2005, 08:50 AM
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
06-28-2005, 11:56 AM
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
06-28-2005, 12:11 PM
Nice Hack.

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

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

.Tim
06-28-2005, 09:48 PM
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
06-28-2005, 11:09 PM
.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
06-28-2005, 11:28 PM
.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
06-29-2005, 01:42 AM
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
06-29-2005, 01:58 AM
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
07-03-2005, 05:49 AM
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
07-06-2005, 03:50 PM
any word on this?

theArchitect
07-13-2005, 02:41 AM
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
07-15-2005, 01:17 AM
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
07-17-2005, 05:57 PM
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
07-18-2005, 12:12 AM
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
07-18-2005, 02:14 AM
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
07-18-2005, 03:47 AM
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
07-18-2005, 12:17 PM
It still doesn't show up when one is reading a message. See attachments.

theArchitect
07-18-2005, 09:35 PM
It still doesn't show up when one is reading a message. See attachments.

Yep. That is exactly what I am getting.

burnist
07-19-2005, 09:58 AM
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
07-19-2005, 05:42 PM
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
07-19-2005, 06:06 PM
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
07-22-2005, 12:06 PM
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
07-25-2005, 02:38 PM
In my sent items, the message has a paperclip but there is no attachment showing when viewing the message.

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

theArchitect
07-26-2005, 10:11 AM
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
07-28-2005, 02:34 AM
Def doesnt work for RC1 (atleast for me)

Boofo
07-28-2005, 04:35 AM
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
07-31-2005, 04:12 AM
bump... would be nice to get this updated :)

FleaBag
07-31-2005, 12:10 PM
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
08-01-2005, 02:28 PM
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
08-02-2005, 03:03 PM
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
08-02-2005, 03:23 PM
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
08-02-2005, 08:44 PM
Bypassing the error is easy. It just doesn't work as it should yet.


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

gonzo0815
08-12-2005, 07:55 AM
Comes here a new Version for RC2?

Thx Gonzo

Fj?rgyn
08-12-2005, 09:37 PM
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
08-12-2005, 09:58 PM
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
08-12-2005, 10:16 PM
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
08-31-2005, 10:09 PM
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
09-01-2005, 12:49 AM
Dude just read this thread and the answer is in here

Aeolian
09-28-2005, 11:51 PM
this ia a great addon.. :)

is it compatible with vb 3.5 gold..

thanx~

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

lordnex
10-01-2005, 06:10 PM
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
10-01-2005, 08:38 PM
This one works with 3.5 gold.

https://vborg.vbsupport.ru/showthread.php?t=95477

:Judge:
10-10-2005, 05:04 AM
Works fine for me 3.5 Gold

cbr929rrerion
10-27-2005, 11:29 PM
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
10-28-2005, 07:52 AM
I think you have to be given permission to do so specifically in the config file.

cbr929rrerion
10-28-2005, 01:11 PM
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
10-29-2005, 09:44 AM
3.5.0 Beta 4 is needed for private attachments plugin, found 3.5.0

can someone post the answer for this issue

OmekaTeam
10-29-2005, 04:38 PM
Error:3.5.0 Beta 4 is needed for private attachments plugin, found 3.5.0.
Why?

nicedreams
01-26-2006, 08:24 PM
Doesn't work in 3.5.3

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

Jim

baileysemt123
02-16-2006, 05:16 PM
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
03-29-2006, 04:06 AM
The code does exist, you have to look for it.

ffevo
03-29-2006, 08:02 PM
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
03-29-2006, 08:12 PM
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
03-29-2006, 11:57 PM
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:


Remember to prefix the table, if you do not know what is a prefix or
you don't use it then you can run the queries without any changes

--------------------------------------------------------

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


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:
https://vborg.vbsupport.ru/showthread.php?t=95477&highlight=%5D+Attachments+in+private+messages+fixe d

Working for me on 3.5.4.

yoyoyoyo
12-06-2006, 09:10 PM
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
12-06-2006, 10:10 PM
Installed and running.Thanks

ag24
01-19-2010, 10:25 AM
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:((