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
  #42  
Old 01-10-2004, 08:38 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very good idea, and well done. Should be standard in vB3 if you ask me.
Reply With Quote
  #43  
Old 01-10-2004, 09:27 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

kentaurus, did you chnage anything in the hack yesterday? OI noticed your firest post was updated with Hack Update.
Reply With Quote
  #44  
Old 01-10-2004, 02:38 PM
Kentaurus's Avatar
Kentaurus Kentaurus is offline
 
Join Date: Dec 2001
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
kentaurus, did you chnage anything in the hack yesterday? OI noticed your firest post was updated with Hack Update.
It's still the same hack, only I edited the edit reason because some people downloaded the old attachment. The only two updates I have done are the ones that are also commented in the forum, the delete the file when the attachment is deleted and the fix for the view attachments in cp.
Reply With Quote
  #45  
Old 01-11-2004, 08:59 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

kentaurus, found a major problem with this hack. When I reply to a message (haven't checked the forwarding out yet), it sends the attachments I have stored along with the message. On a new message, it works fine. Only on replies so far (or forwards, I haven't checked yet).
Reply With Quote
  #46  
Old 01-12-2004, 02:32 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I've narrowed it down a bit further. It seems the attachments get added to any message that is sent out with the Quick PM Reply hack. The regular reply works fine. Any way to fix this?
Reply With Quote
  #47  
Old 01-13-2004, 02:19 AM
Kentaurus's Avatar
Kentaurus Kentaurus is offline
 
Join Date: Dec 2001
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
Ok, I've narrowed it down a bit further. It seems the attachments get added to any message that is sent out with the Quick PM Reply hack. The regular reply works fine. Any way to fix this?
Is that a problem of the Quick PM reply hack or mine? In my forum it works well.
I'll install the Quick PM reply and see where to fix it.
Reply With Quote
  #48  
Old 01-13-2004, 02:22 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you, sir.

I told Erwin about it but he said he couldn't fix problems with other people's hacks. :tired:
Reply With Quote
  #49  
Old 01-13-2004, 02:57 AM
Kentaurus's Avatar
Kentaurus Kentaurus is offline
 
Join Date: Dec 2001
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
Thank you, sir.

I told Erwin about it but he said he couldn't fix problems with other people's hacks. :tired:
I could also say that I can't fix problems with other people's hacks
Reply With Quote
  #50  
Old 01-13-2004, 03:06 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If I had to make a choice, yours will stay.
Reply With Quote
  #51  
Old 01-13-2004, 03:40 AM
Kentaurus's Avatar
Kentaurus Kentaurus is offline
 
Join Date: Dec 2001
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
If I had to make a choice, yours will stay.
Well.. jokes away, this is something bad. If you have both hacks installed and use quick reply it would cause all attachments, not only the ones in that private message to belong to the new pm. That is a really really bad thing.

I was relying on the posthash for the attachments, the quick reply has no posthash (an empty one) so the code just assumes that all attachments with an empty posthash are for that message (ie - all other attachments in the forum).

I made a patch so this hack will work cooperative with the quick reply, I'll pm Erwin and see if he wants to update his hack also, either hack can be patched but I can only modify mine of course.

find this:

Code:
$attachcount = $DB_site->query_first("
				SELECT COUNT(*) AS count
				FROM " . TABLE_PREFIX . "attachment
				WHERE posthash = '" . addslashes($_POST['posthash']) . "'
				AND userid = $bbuserinfo[userid]
		");
		$totalattachments = $attachcount['count'];
		
		if ($totalattachments)
		{
				$DB_site->query("UPDATE " . TABLE_PREFIX . "pmtext SET attach='$totalattachments' WHERE pmtextid='$pmtextid'");
				$DB_site->query("
						UPDATE " . TABLE_PREFIX . "attachment
						SET private = $pmtextid, posthash = ''
						WHERE posthash = '" . addslashes($_POST['posthash']) . "' AND
								userid = $bbuserinfo[userid]
				");
		}
replace it with this:

Code:
if ($_POST['posthash']) {
  $attachcount = $DB_site->query_first("
				SELECT COUNT(*) AS count
				FROM " . TABLE_PREFIX . "attachment
				WHERE posthash = '" . addslashes($_POST['posthash']) . "' AND posthash<>''
				AND userid = $bbuserinfo[userid]
		");
		$totalattachments = $attachcount['count'];
		
		if ($totalattachments)
		{
				$DB_site->query("UPDATE " . TABLE_PREFIX . "pmtext SET attach='$totalattachments' WHERE pmtextid='$pmtextid'");
				$DB_site->query("
						UPDATE " . TABLE_PREFIX . "attachment
						SET private = $pmtextid, posthash = ''
						WHERE posthash = '" . addslashes($_POST['posthash']) . "' AND
								userid = $bbuserinfo[userid]
				");
		}
  }

TXT is updated also
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 08:37 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04882 seconds
  • Memory Usage 2,322KB
  • Queries Executed 27 (?)
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
  • (2)bbcode_code
  • (4)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_postinfo_query
  • fetch_postinfo
  • 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