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)

Boofo 02-29-2004 10:35 PM

Shouldn't the attachment show above that button without having to click the manage attachments button to see it?

Kentaurus 02-29-2004 11:04 PM

It should. That way it is very similar to the normal preview way of doing it. Here is the fix.

find this:

Code:

        'newpost_attachment'       
);

replace it with:
Code:

        'newpost_attachment',
        'newpost_attachmentbit'
);

find this:

Code:

eval('$attachmentoption = "' . fetch_template('newpost_attachment') . '";');
replace it with:

Code:

$currentattaches = $DB_site->query("
        SELECT filename, filesize, attachmentid
        FROM " . TABLE_PREFIX . "attachment
        WHERE posthash = '$posthash'
                AND userid = $bbuserinfo[userid]
");


$attachcount = 0;
while ($attach = $DB_site->fetch_array($currentattaches))
{
        $attachcount++;
        $attach['extension'] = strtolower(file_extension($attach['filename']));
        $attach['filename'] = htmlspecialchars_uni($attach['filename']);
        $attach['filesize'] = vb_number_format($attach['filesize'], 1, true);
        $show['attachmentlist'] = true;
        eval('$attachments .= "' . fetch_template('newpost_attachmentbit') . '";');
}



eval('$attachmentoption = "' . fetch_template('newpost_attachment') . '";');


Boofo 02-29-2004 11:14 PM

Works great! Thanks! ;)

Is the first post updated?

How would we add the attachments ability to Erwin's Quick Peply hack? ;)

Kentaurus 02-29-2004 11:48 PM

Quote:

Originally Posted by Boofo
Works great! Thanks! ;)

Is the first post updated?

How would we add the attachments ability to Erwin's Quick Peply hack? ;)

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.

Boofo 03-01-2004 05:22 AM

Can you pm me with your edits for the textarea and submit button? ;)

portion 03-01-2004 12:20 PM

Can you allow only certain usergroups to use this function?

Kentaurus 03-01-2004 12:24 PM

Quote:

Originally Posted by portion
Can you allow only certain usergroups to use this function?

That would need further hacking.. and right now I have no use for it.

Anyway, what is this obsession with everything being usergroup based lately? (Second hack I get asked) With around 10 usergroups in my forum it is becoming a nightmare for me checking that every option is right....

portion 03-01-2004 12:56 PM

Can you just point me to the right area, and I can do the editing? I am pretty comfortable with PHP.

DivisionByZero 03-01-2004 08:22 PM

Quote:

Originally Posted by Kentaurus
Wouldn't that be a little hard on your users? I usually download an attachment more than once, and after I download it I expect it to remain there. That would seem a little un(user-friendly) to me.

This hack uses the same quotas and options that you have already defined for your attachments so if you have a quota for each user no matter if they attach files to posts or private message once they reach their limit they would have to delete some to continue attaching files.

How about automatically deleting the attachment(s) when the recipient actually DELETES the PM? That seems logical, since you wouldn't want orphaned attachments hogging your quota. That would be a waste of space and DB optimization.

I've installed the hack on 3/1/04 and everything seems to be working fine, except some little bug, where I'll describe in a new post!

DivisionByZero 03-01-2004 08:24 PM

Now, my problem with the hack is that the recipient clicks the attachment link, and gets an error message of: "No Post Defined". HELP


All times are GMT. The time now is 02:48 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.01272 seconds
  • Memory Usage 1,745KB
  • 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
  • (4)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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