Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

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
  #32  
Old 03-23-2002, 04:51 PM
kidney kidney is offline
 
Join Date: Mar 2002
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If I installed the hack from pnp, which makes all the attachment as files, will the private attachments be files too, or they will be in the database?
Reply With Quote
  #33  
Old 03-23-2002, 04:55 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

See Jawelin's posts, kidney.
Reply With Quote
  #34  
Old 03-23-2002, 05:42 PM
kidney kidney is offline
 
Join Date: Mar 2002
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I guess I should read more before posting questions, sorry.
Reply With Quote
  #35  
Old 03-23-2002, 10:41 PM
kidney kidney is offline
 
Join Date: Mar 2002
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hope this makes up for the stupid question I asked a couple of post earlier....
This modification will allow to have private attachment to work with file attachment hack by PNP.

PS you must have PNPs' hack before doing this.
https://vborg.vbsupport.ru/showthrea...threadid=35193

Follow the instruction as provided by the master hacker Firefly

But instead in attachment.php look for:
Quote:
if ($postid) {
$postid=verifyid("post",$postid);
} else {
$attachmentid=verifyid("attachment",$attachmentid) ;
}

$getforuminfo=$DB_site->query_first("SELECT forumid".
iif($postid,',attachmentid ','')."
FROM thread,post
WHERE post.threadid=thread.threadid ".
iif($postid,"AND post.postid='$postid'","AND post.attachmentid='$attachmentid'")."
");

$permissions=getpermissions($getforuminfo[forumid]);
if (!$permissions[canview] or !$permissions[cangetattachment]) {
show_nopermission();
}

if ($postid) {
$attachmentid=$getforuminfo[attachmentid];
}

if (!$attachmentinfo=$DB_site->query_first("SELECT filename,hash,filedata,dateline,visible
FROM attachment
WHERE attachmentid='$attachmentid'")){
$idname='attachment';
eval("standarderror(\"".gettemplate('error_invalid id')."\");");
exit;
}
and replace that by:
Quote:
if ($postid) {
$postid=verifyid("post",$postid);
} elseif($privatemessageid) {
$privatemessageid=verifyid("privatemessage",$priva temessageid);
} else {
$attachmentid=verifyid("attachment",$attachmentid) ;
}

if (!$privatemessageid) {
/* ### */
$getforuminfo=$DB_site->query_first("SELECT forumid".
iif($postid,',attachmentid ','')."
FROM thread,post
WHERE post.threadid=thread.threadid ".
iif($postid,"AND post.postid='$postid'","AND post.attachmentid='$attachmentid'")."
");

$permissions=getpermissions($getforuminfo[forumid]);
if (!$permissions[canview] or !$permissions[cangetattachment]) {
show_nopermission();
}

if ($postid) {
$attachmentid=$getforuminfo[attachmentid];
}
$privateok = 0;
/* ### */
} else {
/* ### */
$pminfo = $DB_site->query_first("SELECT * FROM privatemessage WHERE privatemessageid=$privatemessageid");
$attachmentid = $pminfo['attachmentid'];
if ($attachmentid == 0 or $pminfo['userid'] != $bbuserinfo['userid']) {
$idname='attachment';
eval("standarderror(\"".gettemplate('error_invalid id')."\");");
exit;
}
$privateok = 1;
/* ### */
}

if (!$attachmentinfo=$DB_site->query_first("SELECT filename,hash,filedata,dateline,visible
FROM attachment
WHERE attachmentid='$attachmentid'".iif($privateok==0, 'AND private=0', ''))){
$idname='attachment';
eval("standarderror(\"".gettemplate('error_invalid id')."\");");
exit;
}
also in function.php:
Quote:
$DB_site->query("INSERT INTO attachment (attachmentid,userid,dateline,filename,visible,has h) VALUES (NULL,$bbuserinfo[userid],".time().",'".addslashes($attachment_name)."','$v isible','$attachment_hash')");
and replace it with:
Quote:
$DB_site->query("INSERT INTO attachment (attachmentid,userid,dateline,filename,filedata,vi sible,hash,private) VALUES (NULL,$bbuserinfo[userid],".time().",'".addslashes($attachment_name)."','". addslashes($filestuff)."','$visible','$attachment_ hash','$private')");
This should do the trick...

Now if someone can help me figure out how to have the file removed with the deletion on the private message that be nice...

Keep in mind that I'm only beginner so there might be oversight, just let me know! :nervous:
Reply With Quote
  #36  
Old 03-23-2002, 11:28 PM
Austin Dea's Avatar
Austin Dea Austin Dea is offline
 
Join Date: Dec 2001
Location: Denver, CO, USA
Posts: 342
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bah, n/m...fixed it....
Reply With Quote
  #37  
Old 04-22-2002, 08:13 AM
sub's Avatar
sub sub is offline
 
Join Date: Apr 2002
Location: Va.
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome hack! Installed this for 2.2.5 had to improvise a template for it to work but other than that it went smoothly.
Reply With Quote
  #38  
Old 04-27-2002, 02:33 PM
Dark Odin Dark Odin is offline
 
Join Date: Jan 2002
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm. I get errors when I try to run the mySQL queries.

Quote:
Database error in vBulletin Control Panel 2.2.5:

Invalid SQL: ALTER TABLE attachment ADD private TINYINT(1) UNSIGNED DEFAULT
mysql error: You have an error in your SQL syntax near '' at line 1

mysql error number: 1064
Any ideas?
Reply With Quote
  #39  
Old 04-27-2002, 02:47 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You only ran part of the query, the full query is:
[codel]ALTER TABLE attachment ADD private TINYINT(1) UNSIGNED DEFAULT "0" NOT NULL AFTER visible;[/code]
Reply With Quote
  #40  
Old 04-27-2002, 06:10 PM
Dark Odin Dark Odin is offline
 
Join Date: Jan 2002
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay got it. I was trying to run both queries as one. :/
Reply With Quote
  #41  
Old 04-28-2002, 06:15 PM
Dark Odin Dark Odin is offline
 
Join Date: Jan 2002
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone know how to get this to work with attachment viewer?
Reply With Quote
Reply

Thread Tools

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 09:41 PM.


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.05403 seconds
  • Memory Usage 2,301KB
  • 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
  • (5)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
  • (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