vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   [VB3 RC3] Attachments in private messages (https://vborg.vbsupport.ru/showthread.php?t=59840)

luroca 04-13-2004 08:10 AM

Perhaps this hack would be in beta releases ...

-Luroca clicks uninstall-

trinitym 04-14-2004 03:04 AM

I just wanted to add that I'm in the process of upgrading my forum to vB3 Gold [*twitches*], so I'm obviously "hacking" away and I got this one to work perfectly fine. The only bump I ran into was when I got to the one big code modification for the sql query in "profile.php" at that point I just followed the original vb3 code line for line and compared it with the replacement code in the install text file and made the changes that way and it seemed to work for me. I did test by sending to and from a dummy "regular" user account and etc and so far, perfecto - no permission errors and such.

*clicks install*

Boofo 04-14-2004 03:28 AM

Quote:

Originally Posted by trinitym
I just wanted to add that I'm in the process of upgrading my forum to vB3 Gold [*twitches*], so I'm obviously "hacking" away and I got this one to work perfectly fine. The only bump I ran into was when I got to the one big code modification for the sql query in "profile.php" at that point I just followed the original vb3 code line for line and compared it with the replacement code in the install text file and made the changes that way and it seemed to work for me. I did test by sending to and from a dummy "regular" user account and etc and so far, perfecto - no permission errors and such.

*clicks install*

Can you post the changes that need to be made for vB3 Gold?

trinitym 04-14-2004 03:38 AM

Quote:

Originally Posted by Boofo
Can you post the changes that need to be made for vB3 Gold?

Sure, but no garauntees, maybe I just got lucky. ;)

This is the vB 3.0.0 Gold original profile.php:

PHP Code:

        // Get attachment info
        
$attachments $DB_site->query("
            SELECT thread.forumid, post.postid, post.threadid AS p_threadid, post.title AS p_title, post.dateline AS p_dateline, attachment.attachmentid,
                thread.title AS t_title, attachment.filename, attachment.counter, attachment.filesize AS size, IF(thumbnail = '', 0, 1) AS hasthumbnail,
                user.username, thread.open, attachment.userid " 
iif($userid==$bbuserinfo['userid'], ", IF(attachment.postid = 0, 1, 0) AS inprogress") . "
            FROM " 
TABLE_PREFIX "attachment AS attachment
            LEFT JOIN " 
TABLE_PREFIX "post AS post ON (post.postid = attachment.postid)
            LEFT JOIN " 
TABLE_PREFIX "thread AS thread ON (post.threadid = thread.threadid)
            LEFT JOIN " 
TABLE_PREFIX "deletionlog AS deletionlog ON(attachment.postid = deletionlog.primaryid AND type = 'post')
            LEFT JOIN " 
TABLE_PREFIX "user AS user ON (attachment.userid = user.userid)
            WHERE attachment.userid = 
$userid
                AND ((forumid IN (0
$forumids) AND thread.visible = 1 AND post.visible = 1 AND deletionlog.primaryid IS NULL) " iif($userid==$bbuserinfo['userid'], "OR attachment.postid = 0") . ")
            ORDER BY attachment.attachmentid DESC
            LIMIT " 
. ($limitlower 1) . ", $perpage
        "
); 

And this is what I replaced it with based off of the install .txt [profile.php]:

PHP Code:

        // Get attachment info
        
$attachments $DB_site->query("
            SELECT thread.forumid, post.postid, post.threadid AS p_threadid, post.title AS p_title, if(post.postid,post.dateline,pmtext.dateline) AS p_dateline, attachment.attachmentid,
                thread.title AS t_title, attachment.filename, attachment.counter, attachment.filesize AS size, IF(thumbnail = '', 0, 1) AS hasthumbnail,
                user.username, thread.open, attachment.userid, attachment.private, pmtext.title, pm.pmid " 
iif($userid==$bbuserinfo['userid'], ", IF(attachment.postid = 0, 1, 0) AS inprogress") . "
            FROM " 
TABLE_PREFIX "attachment AS attachment
            LEFT JOIN " 
TABLE_PREFIX "post AS post ON (post.postid = attachment.postid)
                LEFT JOIN " 
TABLE_PREFIX "pmtext AS pmtext ON (pmtext.pmtextid = attachment.private)
                LEFT JOIN " 
TABLE_PREFIX "pm AS pm ON (pmtext.pmtextid=pm.pmtextid AND pm.userid=$userid)
            LEFT JOIN " 
TABLE_PREFIX "thread AS thread ON (post.threadid = thread.threadid)
            LEFT JOIN " 
TABLE_PREFIX "deletionlog AS deletionlog ON(attachment.postid = deletionlog.primaryid AND type = 'post')
            LEFT JOIN " 
TABLE_PREFIX "user AS user ON (attachment.userid = user.userid)
            WHERE attachment.userid = 
$userid
                AND ((forumid IN (0
$forumids) AND thread.visible = 1 AND post.visible = 1 AND deletionlog.primaryid IS NULL) " iif($userid==$bbuserinfo['userid'], "OR attachment.postid = 0") . ")
            ORDER BY attachment.attachmentid DESC
            LIMIT " 
. ($limitlower 1) . ", $perpage
        "
); 

Before anyone goes to my site and points out that it still says RC2 - I cloned my database and am upgrading from a test location. I'm that anal/paranoid. *rolls eyes* I tested on the right version.

Boofo 04-14-2004 04:31 PM

Quote:

Originally Posted by trinitym
Sure, but no garauntees, maybe I just got lucky. ;)

This is the vB 3.0.0 Gold original profile.php:

PHP Code:

        // Get attachment info
        
$attachments $DB_site->query("
            SELECT thread.forumid, post.postid, post.threadid AS p_threadid, post.title AS p_title, post.dateline AS p_dateline, attachment.attachmentid,
                thread.title AS t_title, attachment.filename, attachment.counter, attachment.filesize AS size, IF(thumbnail = '', 0, 1) AS hasthumbnail,
                user.username, thread.open, attachment.userid " 
iif($userid==$bbuserinfo['userid'], ", IF(attachment.postid = 0, 1, 0) AS inprogress") . "
            FROM " 
TABLE_PREFIX "attachment AS attachment
            LEFT JOIN " 
TABLE_PREFIX "post AS post ON (post.postid = attachment.postid)
            LEFT JOIN " 
TABLE_PREFIX "thread AS thread ON (post.threadid = thread.threadid)
            LEFT JOIN " 
TABLE_PREFIX "deletionlog AS deletionlog ON(attachment.postid = deletionlog.primaryid AND type = 'post')
            LEFT JOIN " 
TABLE_PREFIX "user AS user ON (attachment.userid = user.userid)
            WHERE attachment.userid = 
$userid
                AND ((forumid IN (0
$forumids) AND thread.visible = 1 AND post.visible = 1 AND deletionlog.primaryid IS NULL) " iif($userid==$bbuserinfo['userid'], "OR attachment.postid = 0") . ")
            ORDER BY attachment.attachmentid DESC
            LIMIT " 
. ($limitlower 1) . ", $perpage
        "
); 

And this is what I replaced it with based off of the install .txt [profile.php]:

PHP Code:

        // Get attachment info
        
$attachments $DB_site->query("
            SELECT thread.forumid, post.postid, post.threadid AS p_threadid, post.title AS p_title, if(post.postid,post.dateline,pmtext.dateline) AS p_dateline, attachment.attachmentid,
                thread.title AS t_title, attachment.filename, attachment.counter, attachment.filesize AS size, IF(thumbnail = '', 0, 1) AS hasthumbnail,
                user.username, thread.open, attachment.userid, attachment.private, pmtext.title, pm.pmid " 
iif($userid==$bbuserinfo['userid'], ", IF(attachment.postid = 0, 1, 0) AS inprogress") . "
            FROM " 
TABLE_PREFIX "attachment AS attachment
            LEFT JOIN " 
TABLE_PREFIX "post AS post ON (post.postid = attachment.postid)
                LEFT JOIN " 
TABLE_PREFIX "pmtext AS pmtext ON (pmtext.pmtextid = attachment.private)
                LEFT JOIN " 
TABLE_PREFIX "pm AS pm ON (pmtext.pmtextid=pm.pmtextid AND pm.userid=$userid)
            LEFT JOIN " 
TABLE_PREFIX "thread AS thread ON (post.threadid = thread.threadid)
            LEFT JOIN " 
TABLE_PREFIX "deletionlog AS deletionlog ON(attachment.postid = deletionlog.primaryid AND type = 'post')
            LEFT JOIN " 
TABLE_PREFIX "user AS user ON (attachment.userid = user.userid)
            WHERE attachment.userid = 
$userid
                AND ((forumid IN (0
$forumids) AND thread.visible = 1 AND post.visible = 1 AND deletionlog.primaryid IS NULL) " iif($userid==$bbuserinfo['userid'], "OR attachment.postid = 0") . ")
            ORDER BY attachment.attachmentid DESC
            LIMIT " 
. ($limitlower 1) . ", $perpage
        "
); 

Before anyone goes to my site and points out that it still says RC2 - I cloned my database and am upgrading from a test location. I'm that anal/paranoid. *rolls eyes* I tested on the right version.

Is that the only change you had to make to get it to work in GOLD? Everything else was right on in the install file, then? ;l)

trinitym 04-14-2004 05:29 PM

Quote:

Originally Posted by Boofo
Is that the only change you had to make to get it to work in GOLD? Everything else was right on in the install file, then? ;l)

Yep. Well, the first edit on the "private.php" page was different but it wasn't complex. The first edit "at line 25..." the gold code is only different because they've added the "rankphp" under "banemail" so I just added "rankphp" to the edits. I figured that a monkey could work that one out so I didn't mention it. ;)

Other than that, I don't remember having any other problems.

Boofo 04-14-2004 05:44 PM

Well, not all newbies would understand that, that is why I asked you if you could post all of the changes. Otherwise, you will probably get swamped with "what does this mean" and what do you do here" type questions. ;)

DivisionByZero 04-16-2004 02:16 PM

umm... ok, doesn't anyone think it's time for a new release?

It's hard for me to flip through all these pages of modifications and implement each one.

JaNa 04-21-2004 09:32 PM

Awesome!

NexVision 04-22-2004 06:57 AM

Quote:

Originally Posted by Boofo
Well, not all newbies would understand that, that is why I asked you if you could post all of the changes. Otherwise, you will probably get swamped with "what does this mean" and what do you do here" type questions. ;)

there is only 1 modification thats diff and i believe its on page 10

Boofo 04-22-2004 07:14 AM

Can someone please make an install file compatible with vb3.0.1 somehow? ;)

DivisionByZero 05-10-2004 06:20 PM

Quote:

Originally Posted by Boofo
Can someone please make an install file compatible with vb3.0.1 somehow? ;)

YES, PLEASE!!!! I messed up 3 times lol

luroca 05-12-2004 10:25 AM

I am very interested too :)

Kentaurus 05-16-2004 06:51 AM

I wrote an updated version for 3.0.1, I tested it in a blank copy of vbulletin with attachments in the database and attachments as files and it worked ok :) If you find any bugs please let me know, it has been running on my forum for some time now anyway.

It is in the first post of this thread of course :)

Boofo 05-16-2004 07:06 AM

Quote:

Originally Posted by Kentaurus
I wrote an updated version for 3.0.1, I tested it in a blank copy of vbulletin with attachments in the database and attachments as files and it worked ok :) If you find any bugs please let me know, it has been running on my forum for some time now anyway.

It is in the first post of this thread of course :)

Welcome back, my friend. ;)

Kentaurus 05-16-2004 08:13 AM

Quote:

Originally Posted by Boofo
Welcome back, my friend. ;)

Thanks :) And expect all my hacks to be updated for 3.0.1 very very soon.

DivisionByZero 05-17-2004 07:39 PM

OH my god, I'm getting these errors again... recipient gets an error page saying they do not have permission to view the attachment. WHAT am I donig wrong? I started on a clean VB installation, copied everything right, and think I did the SQL queries correctly... HELP!

DivisionByZero 05-17-2004 07:47 PM

Here's what I got for the sql queries... here's what it setup on my database:

Code:


Table                  Field Name        Type        Allow Nulls          Key                Default Value
attachment  private                  int(11)  No                                Indexed        0
pmtext                attach                  int(11)  No                                None                0
attachment  private                  int(11)  No                          Indexed        0

somebody please tell me what I got wrong here? :(

msimplay 05-17-2004 07:47 PM

Quote:

Originally Posted by ThePowerPig
OH my god, I'm getting these errors again... recipient gets an error page saying they do not have permission to view the attachment. WHAT am I donig wrong? I started on a clean VB installation, copied everything right, and think I did the SQL queries correctly... HELP!

are you using attachments as files
because it doesn't work with them as of vbulletin 3.0

i had to move my attachments back into the database before they started to work again

if thats not it then i hope you have a good backup :nervous:

DivisionByZero 05-17-2004 07:49 PM

my attachments are in the DB

Kentaurus 05-17-2004 11:37 PM

Quote:

Originally Posted by ThePowerPig
OH my god, I'm getting these errors again... recipient gets an error page saying they do not have permission to view the attachment. WHAT am I donig wrong? I started on a clean VB installation, copied everything right, and think I did the SQL queries correctly... HELP!

Seems more like your problem is in attachment.php, since that is the one that deals with the permissions to view the attachment, if you edited it correctly then it should work.

DivisionByZero 05-17-2004 11:45 PM

i believe it is done correctly. I will do it one more time just to be sure

DivisionByZero 05-20-2004 02:33 AM

Ok, so I did EVERYTHING again, very slowly, step by step! Nothing! nada! still the same problem.. the recipient has no permission to view the attachments.

I need serious help here lol.

luroca 05-21-2004 08:20 PM

3.0.1 clean installation with attachment in files, OK

**Install** :)

sketch42 06-01-2004 10:19 AM

disregard this post... im an idiot
edits where made to the wrong line... :nervous:

sketch42 06-01-2004 10:48 AM

Quote:

Originally Posted by Kentaurus
I am still wondering if Erwin's is a quick pm.... he has all the pm reply screen there! :) Actually in my forum I edited it to only show the textarea and the submit button....

It should be possible to add them, I'll take a look at it.

Kentaurus can u please post this info... pleeeeeeeeeeeeeeeaaaaaaaase :)

Keyser S?ze 06-07-2004 05:01 AM

odd, i installed the hack fine and everything works ok, when i send a attachment i see the attachment icon before the title but when i open the Pm there no attachment

i rewent over the hack again and everything is done correctly, anyone know what the problem is?

thanks

sketch42 06-25-2004 03:25 AM

Quote:

Originally Posted by IceMalee
odd, i installed the hack fine and everything works ok, when i send a attachment i see the attachment icon before the title but when i open the Pm there no attachment

i rewent over the hack again and everything is done correctly, anyone know what the problem is?

thanks

my users are reporting this same problem as well vb3.0.1
anything???

paulomt1 06-27-2004 12:08 PM

Quote:

Originally Posted by IceMalee
odd, i installed the hack fine and everything works ok, when i send a attachment i see the attachment icon before the title but when i open the Pm there no attachment

i rewent over the hack again and everything is done correctly, anyone know what the problem is?

thanks

I have the same problem here.

luroca 06-28-2004 09:01 PM

I am having this problem too. I send a private with attachment, I receive it ok but later the attachment "disappears"

Some users never see the attachment.

SnowBot 06-29-2004 12:35 AM

Any updates in getting this to show and work in Erwins quick reply pm hack? I know it was mensioned but i have read the thread and couldnt find anything. I know Boofo has it on his site so please :)

Thanks

luroca 07-03-2004 12:53 PM

With the changes in 3.0.2 this hack needs changes too :)

Boofo 07-03-2004 01:16 PM

Quote:

Originally Posted by SnowBot
Any updates in getting this to show and work in Erwins quick reply pm hack? I know it was mensioned but i have read the thread and couldnt find anything. I know Boofo has it on his site so please :)

Thanks

Check the thread for Erwin's hack. It is in there.

sketch42 07-03-2004 11:09 PM

Boofo... have you gotten this hack to work with 3.0.1??

Boofo 07-04-2004 12:33 AM

Quote:

Originally Posted by sketch42
Boofo... have you gotten this hack to work with 3.0.1??

I don't run 3.0.1. I still run RC3. Sorry. :(

sketch42 07-04-2004 01:04 AM

Quote:

Originally Posted by Boofo
I don't run 3.0.1. I still run RC3. Sorry. :(

can someone update this for 3.0.1??

Ganon 07-09-2004 02:43 AM

The hack worked fine for me on 3.0.0, but I've recently upgraded to 3.0.3, and it is incompatable. Some of the file edits no longer work (searching for the code brings no result), and my best guesses to fix it don't work. I can attach files to PM's, but it brings up an error message when the user tries to view those files.

luroca 07-09-2004 09:57 AM

Yes, this very useful hack is not compatible with 3.0.3 :(

PKRWUD 07-14-2004 03:06 PM

I am using 3.0.0, and am getting the following error when I try to view the attachment (both in the PM and in my CP)...

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/pkrwud/public_html/vbulletin/attachment.php on line 79

Any thoughts?

TTG 07-15-2004 10:48 AM

Was hoping to get this working in 3.0.1 :ermm:

Got stuck with this :-

# Code modifications in file "attachment.php"
search for this code:

Code:

if (!$attachmentinfo = $DB_site->query_first("
        SELECT filename, filesize, postid, attachment.userid,
                " . iif(!$vboptions['attachfile'] AND !$thumb, 'filedata,') . "
                " . iif($thumb, 'thumbnail, thumbnail_dateline AS dateline,', 'dateline,') . "
                visible, mimetype, NOT ISNULL(deletionlog.primaryid) AS isdeleted
        FROM " . TABLE_PREFIX . "attachment AS attachment
        LEFT JOIN " . TABLE_PREFIX . "attachmenttype AS attachmenttype ON(attachmenttype.extension = SUBSTRING_INDEX(attachment.filename, '.', -1))
        LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(attachment.postid = deletionlog.primaryid AND type = 'post')
        WHERE attachmentid = $attachmentid
"))

Here's the nearest I could find in attachment.php

Code:

if (!$attachmentinfo = $DB_site->query_first("
        SELECT filename, attachment.postid, attachment.userid, attachmentid,
                " . iif($thumb, 'thumbnail AS filedata, thumbnail_dateline AS dateline, thumbnail_filesize AS filesize,', 'attachment.dateline, filedata, filesize,') . "
                attachment.visible, mimetype, NOT ISNULL(deletionlog.primaryid) AS isdeleted,
                thread.forumid, forum.password, thread.threadid
        FROM " . TABLE_PREFIX . "attachment AS attachment
        LEFT JOIN " . TABLE_PREFIX . "attachmenttype AS attachmenttype ON(attachmenttype.extension = SUBSTRING_INDEX(attachment.filename, '.', -1))
        LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(attachment.postid = deletionlog.primaryid AND type = 'post')
        LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = attachment.postid)
        LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON (post.threadid = thread.threadid)
        LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON (forum.forumid = thread.forumid)
        " . iif($postid, "WHERE attachment.postid = $postid", "WHERE attachmentid = $attachmentid") . "
"))



All times are GMT. The time now is 08:14 AM.

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.01714 seconds
  • Memory Usage 1,895KB
  • 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
  • (3)bbcode_code_printable
  • (4)bbcode_php_printable
  • (16)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
  • (40)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