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)

Erwin 01-10-2004 08:38 AM

Very good idea, and well done. :) Should be standard in vB3 if you ask me. ;)

Boofo 01-10-2004 09:27 AM

kentaurus, did you chnage anything in the hack yesterday? OI noticed your firest post was updated with Hack Update.

Kentaurus 01-10-2004 02:38 PM

Quote:

Originally Posted by Boofo
kentaurus, did you chnage anything in the hack yesterday? OI noticed your firest post was updated with Hack Update.

It's still the same hack, only I edited the edit reason because some people downloaded the old attachment. The only two updates I have done are the ones that are also commented in the forum, the delete the file when the attachment is deleted and the fix for the view attachments in cp.

Boofo 01-11-2004 08:59 PM

kentaurus, found a major problem with this hack. When I reply to a message (haven't checked the forwarding out yet), it sends the attachments I have stored along with the message. On a new message, it works fine. Only on replies so far (or forwards, I haven't checked yet).

Boofo 01-12-2004 02:32 PM

Ok, I've narrowed it down a bit further. It seems the attachments get added to any message that is sent out with the Quick PM Reply hack. The regular reply works fine. Any way to fix this?

Kentaurus 01-13-2004 02:19 AM

Quote:

Originally Posted by Boofo
Ok, I've narrowed it down a bit further. It seems the attachments get added to any message that is sent out with the Quick PM Reply hack. The regular reply works fine. Any way to fix this?

Is that a problem of the Quick PM reply hack or mine? In my forum it works well.
I'll install the Quick PM reply and see where to fix it.

Boofo 01-13-2004 02:22 AM

Thank you, sir. ;)

I told Erwin about it but he said he couldn't fix problems with other people's hacks. :tired:

Kentaurus 01-13-2004 02:57 AM

Quote:

Originally Posted by Boofo
Thank you, sir. ;)

I told Erwin about it but he said he couldn't fix problems with other people's hacks. :tired:

I could also say that I can't fix problems with other people's hacks ;)

Boofo 01-13-2004 03:06 AM

If I had to make a choice, yours will stay. ;)

Kentaurus 01-13-2004 03:40 AM

Quote:

Originally Posted by Boofo
If I had to make a choice, yours will stay. ;)

Well.. jokes away, this is something bad. If you have both hacks installed and use quick reply it would cause all attachments, not only the ones in that private message to belong to the new pm. That is a really really bad thing.

I was relying on the posthash for the attachments, the quick reply has no posthash (an empty one) so the code just assumes that all attachments with an empty posthash are for that message (ie - all other attachments in the forum).

I made a patch so this hack will work cooperative with the quick reply, I'll pm Erwin and see if he wants to update his hack also, either hack can be patched but I can only modify mine of course.

find this:

Code:

$attachcount = $DB_site->query_first("
                                SELECT COUNT(*) AS count
                                FROM " . TABLE_PREFIX . "attachment
                                WHERE posthash = '" . addslashes($_POST['posthash']) . "'
                                AND userid = $bbuserinfo[userid]
                ");
                $totalattachments = $attachcount['count'];
               
                if ($totalattachments)
                {
                                $DB_site->query("UPDATE " . TABLE_PREFIX . "pmtext SET attach='$totalattachments' WHERE pmtextid='$pmtextid'");
                                $DB_site->query("
                                                UPDATE " . TABLE_PREFIX . "attachment
                                                SET private = $pmtextid, posthash = ''
                                                WHERE posthash = '" . addslashes($_POST['posthash']) . "' AND
                                                                userid = $bbuserinfo[userid]
                                ");
                }

replace it with this:

Code:

if ($_POST['posthash']) {
  $attachcount = $DB_site->query_first("
                                SELECT COUNT(*) AS count
                                FROM " . TABLE_PREFIX . "attachment
                                WHERE posthash = '" . addslashes($_POST['posthash']) . "' AND posthash<>''
                                AND userid = $bbuserinfo[userid]
                ");
                $totalattachments = $attachcount['count'];
               
                if ($totalattachments)
                {
                                $DB_site->query("UPDATE " . TABLE_PREFIX . "pmtext SET attach='$totalattachments' WHERE pmtextid='$pmtextid'");
                                $DB_site->query("
                                                UPDATE " . TABLE_PREFIX . "attachment
                                                SET private = $pmtextid, posthash = ''
                                                WHERE posthash = '" . addslashes($_POST['posthash']) . "' AND
                                                                userid = $bbuserinfo[userid]
                                ");
                }
  }


TXT is updated also


All times are GMT. The time now is 09:13 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.01249 seconds
  • Memory Usage 1,750KB
  • 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_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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