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
  #72  
Old 11-05-2002, 05:29 PM
ontherun ontherun is offline
 
Join Date: Sep 2002
Location: 3rd Stone From The Sun
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have ran the
query(s):
ALTER TABLE attachment ADD private TINYINT(1) UNSIGNED DEFAULT "0" NOT NULL AFTER visible;

ALTER TABLE privatemessage ADD attachmentid SMALLINT(5) UNSIGNED NOT NULL;

Which produced these lines in the db.

Database dsstv_forum2 - table privatemessage

Field = attachmentid
Type = SMALLINT
Length/Values* = 5
Attributes = UNSIGNED
Null = not null
default = 0
Extra =

Database dsstv_forum2 - table attachment running on localhost

Field = private
Type = TINYINT
Length/Values* = 1
Attributes = UNSIGNED
Null = not null
Default = 0
Extra =

~ So much for not following the instructions ~
Reply With Quote
  #73  
Old 11-05-2002, 05:31 PM
Bison's Avatar
Bison Bison is offline
 
Join Date: Jun 2002
Location: Virginia Beach, Virginia
Posts: 522
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by VAN
Database error in vBulletin 2.2.6:

I'm getting the following error aftertrying to send a PM:

Invalid SQL: INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title ,message,dateline,showsignature,iconid,messageread ,folderid,receipt,attachmentid) VALUES (NULL,1,1,1,'hahah','ahaha',1036464302,'1','0',0,0 ,1,)<-- Here
mysql error: You have an error in your SQL syntax near ')' at line 1

mysql error number: 1064

Is Firefly still watching this thread?I Hope.
If what you added in this thread is the SQL error message you got then I can tell you that the 12 values you're trying to enter into the database doesn't match with amount of 13 tables you're trying to add the data to.

13 tables ... 12 Values
Reply With Quote
  #74  
Old 11-05-2002, 05:40 PM
Bison's Avatar
Bison Bison is offline
 
Join Date: Jun 2002
Location: Virginia Beach, Virginia
Posts: 522
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by ontherun
I have ran the
query(s):
ALTER TABLE attachment ADD private TINYINT(1) UNSIGNED DEFAULT "0" NOT NULL AFTER visible;

ALTER TABLE privatemessage ADD attachmentid SMALLINT(5) UNSIGNED NOT NULL;

Which produced these lines in the db.

Database dsstv_forum2 - table privatemessage

Field = attachmentid
Type = SMALLINT
Length/Values* = 5
Attributes = UNSIGNED
Null = not null
default = 0
Extra =


Database dsstv_forum2 - table attachment running on localhost

Field = private
Type = TINYINT
Length/Values* = 1
Attributes = UNSIGNED
Null = not null
Default = 0
Extra =

~ So much for not following the instructions ~
If you "Physically" see the column inside your database then you have a good case to debate ... if you haven't then that should be your next move.

Second, look at the attachment.php for that SQL INSERT string and look for anything that might not seem valid on or around the column name. Make sure that the column inside the database has the same name that the query is trying to enter data to ...
Reply With Quote
  #75  
Old 11-05-2002, 10:39 PM
VAN's Avatar
VAN VAN is offline
 
Join Date: Oct 2001
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Rolodex


If what you added in this thread is the SQL error message you got then I can tell you that the 12 values you're trying to enter into the database doesn't match with amount of 13 tables you're trying to add the data to.

13 tables ... 12 Values
Thanks for the push in the right direction, Rolodex. I've got it working now.

Now onto the next problem...

Nothing "major", but the paperclip.gif image is not appearing next to the PM title.

Here's what I have in Private.php:
PHP Code:
if (intval($privatemessage['attachmentid'])!=0) {
      
$attach '<img src="{images folder}/paperclip.gif" border="0" align="absmiddle">';
} else {
      
$attach ' ';

What am I missing?? (space in "{images folder}" added for example)
Reply With Quote
  #76  
Old 11-05-2002, 11:56 PM
Bison's Avatar
Bison Bison is offline
 
Join Date: Jun 2002
Location: Virginia Beach, Virginia
Posts: 522
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My Question ....

How many themes are you working with? Also, i'd check the spelling of the paperclip image for caps ... I had a simular problem like that and that was the problem.

Make sure it's in lower case!
Reply With Quote
  #77  
Old 11-06-2002, 04:59 AM
VAN's Avatar
VAN VAN is offline
 
Join Date: Oct 2001
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just a single theme on my test board, and the code I pasted is taken directly from my private.php file...paperclip.gif is in all lowercase. Just to cleare it up, I'm not getting a "broken image"...theres just nothing showing up where paperclip.gif should be. Weird.
Reply With Quote
  #78  
Old 11-06-2002, 10:14 PM
ontherun ontherun is offline
 
Join Date: Sep 2002
Location: 3rd Stone From The Sun
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Rolodex


If you "Physically" see the column inside your database then you have a good case to debate ... if you haven't then that should be your next move.

Second, look at the attachment.php for that SQL INSERT string and look for anything that might not seem valid on or around the column name. Make sure that the column inside the database has the same name that the query is trying to enter data to ...
I have removed the Altered Tables and re-ran the query's

I have gone back to the Org. php files and added all the lines need to them. I have added the new lines to Template and created the new template. Uploaded all files

And Im right back to the Org. error:

Database error in vBulletin 2.2.8:

Invalid SQL: INSERT INTO attachment (attachmentid,userid,dateline,filename,filedata,vi sible,private) VALUES (NULL,1,1036627824,'newbie guide.txt',','1','1')
mysql error: Unknown column 'private' in 'field list'

mysql error number: 1054

Date: Wednesday 06th of November 2002 05:10:24 PM
Script: http://dev.*********.com/private.php
Referer: http://dev.*********.com/private.php...age&userid=218

How do I fix this
And yes the tables where added to the DB.
Reply With Quote
  #79  
Old 11-19-2002, 06:02 PM
Mike11212 Mike11212 is offline
 
Join Date: Jul 2002
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I need help
I installed the hack fine with out any problems
but when someone clicks the attachments in the PM
they get the following error
Parse error: parse error in /home/mike1121/public_html/board/attachment.php on line 100

here are lines 89 to 102 in my attachments.php file
Code:
if ($extension=='gif') {
  header('Content-type: image/gif');
} elseif ($extension=='jpg' or $extension=='jpeg') {
  header('Content-type: image/jpeg');
} elseif ($extension=='png') {
  header('Content-type: image/png');
} elseif ($extension=='pdf') {
  header('Content-type: application/pdf');
} else {
  header('Content-type: unknown/unknown');
}
echo $attachmentinfo[filedata];

?>
Reply With Quote
  #80  
Old 11-20-2002, 02:21 AM
Mike11212 Mike11212 is offline
 
Join Date: Jul 2002
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone?
Reply With Quote
  #81  
Old 11-23-2002, 02:04 PM
maoz440 maoz440 is offline
 
Join Date: Nov 2002
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wonder if it is possible to limit this function to only certain user groups?
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 02:23 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.05025 seconds
  • Memory Usage 2,313KB
  • 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
  • (1)bbcode_code
  • (1)bbcode_php
  • (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
  • (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