vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Attachments in private messages (https://vborg.vbsupport.ru/showthread.php?t=91220)

Kentaurus 06-27-2005 10:00 PM

Attachments in private messages
 
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 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:

  1. 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
  2. Go to Plugin Manager and click on "private attachments - get posthash and allow attachments"
  3. 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

Quote:

Originally Posted by .Tim
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

Quote:

Originally Posted by Kentaurus
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.


All times are GMT. The time now is 01:47 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.01241 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete