vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Private Attachments! (Attachments in Private Messages) (https://vborg.vbsupport.ru/showthread.php?t=35593)

ontherun 11-05-2002 05:29 PM

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 ~

Bison 11-05-2002 05:31 PM

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

Bison 11-05-2002 05:40 PM

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 ...

VAN 11-05-2002 10:39 PM

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)

Bison 11-05-2002 11:56 PM

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!

VAN 11-06-2002 04:59 AM

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.

ontherun 11-06-2002 10:14 PM

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.

Mike11212 11-19-2002 06:02 PM

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];

?>


Mike11212 11-20-2002 02:21 AM

anyone?

maoz440 11-23-2002 02:04 PM

I wonder if it is possible to limit this function to only certain user groups? :)


All times are GMT. The time now is 01:06 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.01196 seconds
  • Memory Usage 1,752KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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