The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Private Attachments! (Attachments in Private Messages) Details »» | |||||||||||||||||||||||||||
Private Attachments! (Attachments in Private Messages)
Developer Last Online: Nov 2024
*drums*
This hack is now out of beta! Safe to use. My latest and one of the more extensive hacks -- Private Attachments! This huge (I ain't kidding, it's pretty big) hack will allow your members to send private messages with attachments in them, so they don't need to use e-mail for that. Since this hack requires a large number of edits, this is how I recommend installing it: (a) Run the queries. (b) Edit all the files, offline. (c) When you are done with (b) upload all the files at once. (d) Perform the template edits. If you do all actions in this order your users shouldn't notice you are installing the hack. All feature requests (except for limiting this for usergroups -- if you want that do it yourself it's not hard but I'm tired of adding permissions to the dreaded usergroup.php) are welcome before this goes out of beta. As always, have fun. Show Your Support
|
Comments |
#102
|
|||
|
|||
Wow. Now i got a problem. Want to kill the attachment when the pm is killed. Problem:
If someone sends a multiple message to more than one users. While the first kills his pm, the attachment is killed, too. Seems another query is needed: count pms with attachmentid = x, if > 0, dont kill the file: (Query after killing the first pm, while query before must be >1) and so on. Will do it in a minute ... |
#103
|
|||
|
|||
Seems something forgotten:
In template privfolder_bit, you have to insert $attach bevore Code:
<normalfont><a href="private.php?s=$session[sessionhash]&action=show&privatemessageid=$privatemessage[privatemessageid]">$privatemessage[title]</a></normalfont> |
#104
|
|||
|
|||
ok. Here we go:
find in private.php this line: Code:
if ($what=="delete") { with this code. Code:
if ($what=="delete") { if (is_array($privatemessage)) { while(list($key,$val)=each($privatemessage)) { // for every pm get the attachmentid first ! $ata = array(); $atas = array(); echo "SELECT attachmentid FROM privatemessage WHERE privatemessageid=".intval($key)." AND userid=$bbuserinfo[userid] LIMIT 1"; $ata = $DB_site->query_first("SELECT attachmentid FROM privatemessage WHERE privatemessageid=".intval($key)." AND userid=$bbuserinfo[userid]"); // then look if there are more than one if ($ata[0] != '') { $ataid = $ata[0]; // Count if there are more than one ! $atas = $DB_site->query_first("SELECT COUNT(*) FROM privatemessage WHERE attachmentid = $ataid"); echo "<br>SELECT COUNT(*) FROM attachment WHERE attachmentid = $ataid"; // If there is only 1, delete it ! if ($atas[0] == '1') { $atasid = $atas[0]; echo"<br>$atas[0]<br>DELETE FROM attachment WHERE attachmentid = $ataid"; $DB_site->query("DELETE FROM attachment WHERE attachmentid = $ataid"); } // else make error message ! } // $DB_site->query("DELETE FROM privatemessage WHERE privatemessageid=".intval($key)." AND userid=$bbuserinfo[userid]"); } //end while |
#105
|
|||
|
|||
Hmm. Is there any query to ask:
How many attachmentids in table with attachmentid like the one where x=y and t=o ? I really hate it to make more than one query if not needed ;-) Maybe it´s really time to go to bed, 8:30 now at morning ;-( |
#106
|
|||
|
|||
Hehe. Last words for this day. Im really happy that the upload runs with the same function from functions.php, so my mogrify resizes pics greater than the allowed value and no +++++ of user could destroy the tables with to heavy stuff uploaded ;-)
Maybe in two or three days i could show my HotOrNot-Hack with all the same functions from the original and some more. If someone is interested pm me, think i will not have the time to make clear instructions on this. |
#107
|
||||
|
||||
The edit button is your friend..
Thanks for your contribution towards making the mod work how others have requested though! |
#108
|
|||
|
|||
I already fixed the problem where the private attachment stayed on the server even when the private messsage is deleted. It also checks to see if theres more them one private message that has it.
See the following post: https://vborg.vbsupport.ru/showthrea...835#post360835 |
#109
|
|||
|
|||
I seem to have a small problem with this...
I installed this great hack about 6 months ago and it ran fine. Until 4 days ago. It just seemed to stop. I never installed the delete attachment fix, so could there be an issue with there being too many files hanging around? If so, how can I change this? If that is not the case then, how can I go about correcting this problem. Any suggestions would be great. Cheers. |
#110
|
||||
|
||||
Quote:
How was this fixed? |
#111
|
|||
|
|||
Sorry, dont know your code and be very in hassle with some other stuff, the error comes from the last value not set
see: ... 0,0,1,) It seems there is no attachmentid passed, try to set the variable in '', so if nothing is here, it will be a 0 because of the default in mysql. *removed links as they contained adult pics* |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|