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)

Admin 07-25-2002 06:54 AM

Turn reg_globals on.

tkeil69575 07-28-2002 09:51 PM

Hallo Firefly,

i already posted about this problem before, but didnt get any feedback yet. I rechecked the hack installation today and updated it to the current version, but it hasnt made any difference to my problem.

At first all seems to work fine, the attachment can be added and shows up in the receveivers and senders pm's. However after about 30 min. the icon and link for the attachment download disappears aswell at the number for the amount of times it was downloaded. Its really weird.

Im attaching a screenshot, of how the pm looks after 30 min or so. Would appreciate any help.

Tina

Admin 07-29-2002 07:01 AM

Do you have my hack of keeping attachments on preview post?

tkeil69575 07-29-2002 07:14 AM

No chen, I dont have a hack for keeping PM attachments installed (only for the normal postings).
Tina

Admin 07-29-2002 07:15 AM

That's not what I'm talking about. Do you have this hack installed?
https://vborg.vbsupport.ru/showthrea...threadid=38995

tkeil69575 07-29-2002 07:16 AM

Yes I have that installed.

Admin 07-29-2002 07:33 AM

In newreply.php and newthread.php replace this:
PHP Code:

// **************************************** \\
// *** Keep attachments when previewing *** \\
// **************************************** \\
$postinfo $DB_site->query_first('
    SELECT attachmentid, filename FROM attachment
    WHERE attachmentid = '
.intval($HTTP_POST_VARS['attachmentid']).' AND visible = 0
'
);
if (
intval($HTTP_POST_VARS['attachmentid']) != and $postinfo) {
    
$oldattachid $postinfo['attachmentid'];
} else {
    unset(
$oldattachid);
}

if (
$orphans $DB_site->query("SELECT a.attachmentid FROM attachment AS a LEFT JOIN post USING (attachmentid) WHERE postid IS NULL") and $DB_site->num_rows($orphans) > 0) {
    
$orphanids '0';
    while (
$orphan $DB_site->fetch_array($orphans)) {
        
$orphanids .= ",$orphan[attachmentid]";
    }
    
$DB_site->query("DELETE FROM attachment WHERE attachmentid IN ($orphanids) AND dateline < ".(time() - (60*15))." AND attachmentid <> ".intval($oldattachid));
}
// **************************************** \\
// *** Keep attachments when previewing *** \\
// **************************************** \\ 

With this:
PHP Code:

// **************************************** \\
// *** Keep attachments when previewing *** \\
// **************************************** \\
$postinfo $DB_site->query_first('
    SELECT attachmentid, filename FROM attachment
    WHERE attachmentid = '
.intval($HTTP_POST_VARS['attachmentid']).' AND visible = 0
'
);
if (
intval($HTTP_POST_VARS['attachmentid']) != and $postinfo) {
    
$oldattachid $postinfo['attachmentid'];
} else {
    unset(
$oldattachid);
}

if (
$orphans $DB_site->query("
        SELECT a.attachmentid
        FROM attachment AS a
        LEFT JOIN post ON (post.attachmentid = a.attachmentid)
        LEFT JOIN privatemessage ON (privatemessage.attachmentid = a.attachmentid)
        WHERE postid IS NULL AND privatemessageid IS NULL
    "
) and $DB_site->num_rows($orphans) > 0) {
    
$orphanids '0';
    while (
$orphan $DB_site->fetch_array($orphans)) {
        
$orphanids .= ",$orphan[attachmentid]";
    }
    
$DB_site->query("DELETE FROM attachment WHERE attachmentid IN ($orphanids) AND dateline < ".(time() - (60*15))." AND attachmentid <> ".intval($oldattachid));
}
// **************************************** \\
// *** Keep attachments when previewing *** \\
// **************************************** \\ 


tkeil69575 07-29-2002 08:33 AM

Thank you chen!!!
Looks like that has solved my Problem :)

Tina

CJi 08-04-2002 10:34 AM

bravo firefly, another fantastic hack :)

Hellburn 08-10-2002 09:50 AM

Have everybody make this one:
"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"
i want that only mods and admins can posting attachements. Can everybody help me?


All times are GMT. The time now is 11:03 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.04185 seconds
  • Memory Usage 1,757KB
  • 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_php_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