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

Reply
 
Thread Tools
[VB3 RC3] Attachments in private messages Details »»
[VB3 RC3] Attachments in private messages
Version: 1.00, by Kentaurus Kentaurus is offline
Developer Last Online: Jul 2014 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 01-06-2004 Last Update: Never Installs: 134
 
No support by the author.

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

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

Comments
  #32  
Old 01-08-2004, 10:28 PM
hagi hagi is offline
 
Join Date: Jan 2002
Location: Chi-town
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I set it up and it caused my PM to stop working. So I un-installed the hack and now this is what I get when I click on my normal attachments.

------------------------------------
Database error in vBulletin 3.0.0 Release Candidate 2:

Invalid SQL:
SELECT filename, filesize, postid, attachment.userid,
filedata,
dateline,
visible, mimetype, NOT ISNULL(deletionlog.primaryid) AS isdeleted, private
FROM vb3_attachment AS attachment
LEFT JOIN vb3_attachmenttype AS attachmenttype ON(attachmenttype.extension = SUBSTRING_INDEX(attachment.filename, '.', -1))
LEFT JOIN vb3_deletionlog AS deletionlog ON(attachment.postid = deletionlog.primaryid AND type = 'post')
WHERE attachmentid = 1

mysql error: Unknown column 'private' in 'field list'

mysql error number: 1054
---------------------------------

Any idea to at least fix my attachment table so I can try again?
Reply With Quote
  #33  
Old 01-09-2004, 12:25 AM
Kentaurus's Avatar
Kentaurus Kentaurus is offline
 
Join Date: Dec 2001
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hagi
I set it up and it caused my PM to stop working. So I un-installed the hack and now this is what I get when I click on my normal attachments.

------------------------------------
Database error in vBulletin 3.0.0 Release Candidate 2:

Invalid SQL:
SELECT filename, filesize, postid, attachment.userid,
filedata,
dateline,
visible, mimetype, NOT ISNULL(deletionlog.primaryid) AS isdeleted, private
FROM vb3_attachment AS attachment
LEFT JOIN vb3_attachmenttype AS attachmenttype ON(attachmenttype.extension = SUBSTRING_INDEX(attachment.filename, '.', -1))
LEFT JOIN vb3_deletionlog AS deletionlog ON(attachment.postid = deletionlog.primaryid AND type = 'post')
WHERE attachmentid = 1

mysql error: Unknown column 'private' in 'field list'

mysql error number: 1054
---------------------------------

Any idea to at least fix my attachment table so I can try again?
Did you run the queries almost at the end of the file. You are trying to select a "private" column, but your database doesn't have one, until you add the columns there would be some database errors. These are the queries:

ALTER TABLE attachment add private int not null;
ALTER TABLE pmtext add attach int not null;
ALTER TABLE attachment add index (private);

You can run any query in the admin control panel, almost at the end in a section called "Execute SQL Query", for you to be able to run any query in the config.php you should have a line like $canrunqueries = '1';

changing that 1 for whatever your userid is, that is. Or, if your host provides you with phpmyadmin then you can run queries from that.

Please be aware that depending on the size of your attachment table the first query can take a while.
Reply With Quote
  #34  
Old 01-09-2004, 12:29 AM
hagi hagi is offline
 
Join Date: Jan 2002
Location: Chi-town
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I will redo everything. I think I messed up because that was the first file and not the updated version. Will tell you if everything works
Reply With Quote
  #35  
Old 01-09-2004, 12:32 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How about who it is from? And the title (if there's room)?
Reply With Quote
  #36  
Old 01-09-2004, 01:03 AM
hagi hagi is offline
 
Join Date: Jan 2002
Location: Chi-town
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Edit: Yay it works now. I think it was the way I was executing the queries. I did them one by one instead of my usual all at once and it worked. Works like a charm My post attachments have also started to work fine again. Nice hack *clicks install*

thx for the help also
Reply With Quote
  #37  
Old 01-09-2004, 09:42 PM
SloppyGoat's Avatar
SloppyGoat SloppyGoat is offline
 
Join Date: Feb 2002
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wouldn't mind installing this, but only if the attachments are deleted after they download them. I sure don't want my db getting abused like that.
Reply With Quote
  #38  
Old 01-09-2004, 11:06 PM
Nmidia Nmidia is offline
 
Join Date: Jan 2004
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent. I was wondering why it didn't work the first time....I was so intent on not making any mistakes as this was my first sql query update that I forgot to upload the files. Yes, stop laughing at me now.

Works first time. Excellent instructions, for a very useful hack!
Reply With Quote
  #39  
Old 01-10-2004, 02:29 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this hack follow what you have set for the attchment storage as far as where they are stored? I have mine stored on the disk and not the db.
Reply With Quote
  #40  
Old 01-10-2004, 08:35 AM
Kentaurus's Avatar
Kentaurus Kentaurus is offline
 
Join Date: Dec 2001
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SloppyGoat
I wouldn't mind installing this, but only if the attachments are deleted after they download them. I sure don't want my db getting abused like that.
Wouldn't that be a little hard on your users? I usually download an attachment more than once, and after I download it I expect it to remain there. That would seem a little un(user-friendly) to me.

This hack uses the same quotas and options that you have already defined for your attachments so if you have a quota for each user no matter if they attach files to posts or private message once they reach their limit they would have to delete some to continue attaching files.
Reply With Quote
  #41  
Old 01-10-2004, 08:37 AM
Kentaurus's Avatar
Kentaurus Kentaurus is offline
 
Join Date: Dec 2001
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
Does this hack follow what you have set for the attchment storage as far as where they are stored? I have mine stored on the disk and not the db.
It should. It uses the same code that normal posts use for attachments, I just moved that feature to private messages. I tested both the file and db storage and they seemed to be working.
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:15 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.08141 seconds
  • Memory Usage 2,312KB
  • 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_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
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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