Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Private Attachments! (Attachments in Private Messages) Details »»
Private Attachments! (Attachments in Private Messages)
Version: 1.00, by Admin (Coder) Admin is offline
Developer Last Online: Nov 2024 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 03-01-2002 Last Update: Never Installs: 54
 
No support by the author.

*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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #102  
Old 08-19-2003, 04:55 AM
Robert9 Robert9 is offline
 
Join Date: Oct 2001
Location: super
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ...
Reply With Quote
  #103  
Old 08-19-2003, 05:04 AM
Robert9 Robert9 is offline
 
Join Date: Oct 2001
Location: super
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #104  
Old 08-19-2003, 05:18 AM
Robert9 Robert9 is offline
 
Join Date: Oct 2001
Location: super
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok. Here we go:

find in private.php this line:
Code:
if ($what=="delete") {
then substitute the whole block till // end while
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
Im no programer at all, maybe something to improve ?
Reply With Quote
  #105  
Old 08-19-2003, 05:20 AM
Robert9 Robert9 is offline
 
Join Date: Oct 2001
Location: super
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ;-(
Reply With Quote
  #106  
Old 08-19-2003, 05:25 AM
Robert9 Robert9 is offline
 
Join Date: Oct 2001
Location: super
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #107  
Old 08-19-2003, 06:40 AM
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Location: Sheffield, UK
Posts: 1,757
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The edit button is your friend..
Thanks for your contribution towards making the mod work how others have requested though!
Reply With Quote
  #108  
Old 08-19-2003, 05:07 PM
Slynderdale Slynderdale is offline
 
Join Date: Mar 2002
Location: New York State
Posts: 576
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #109  
Old 08-29-2003, 01:47 AM
glenmax glenmax is offline
 
Join Date: Aug 2002
Location: Great White North
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #110  
Old 08-30-2003, 06:24 PM
gengar003's Avatar
gengar003 gengar003 is offline
 
Join Date: Apr 2002
Location: .::|The Matrix|::.
Posts: 181
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
09-28-02 at 01:48 PM TheComputerGuy said this in Post #65
Hi I am having the same problem as IceMalee...I get some database errors at line 1
PHP Code:
Invalid SQLINSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title,message,dateline,showsignature,iconid,messageread,folderid,receipt,attachmentidVALUES (NULL,1,1,1,'test','test',1033217057,'0','0',0,0,1,)
mysql errorYou have an error in your SQL syntax near ')' at line 1 
Any help would be great.

How was this fixed?
Reply With Quote
  #111  
Old 09-01-2003, 11:12 PM
Robert9 Robert9 is offline
 
Join Date: Oct 2001
Location: super
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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*
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:46 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04930 seconds
  • Memory Usage 2,320KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete