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)
-   -   Prune PMs older than 30 days (https://vborg.vbsupport.ru/showthread.php?t=70573)

TTG 12-02-2004 10:03 AM

Very useful .. thanks for the hack.
Clicked install

wowthatnice 12-11-2004 09:24 AM

Quote:

Originally Posted by alkahf
I run it.
It is deleted PMs but the PM numbers count in Nav Bar not change :)!!
Do you see?:)

Regards

Do this, open cleanoldpm.php find
PHP Code:

$DB_site->free_result($oldpms); 

below add
PHP Code:

// update the pm counters for $bbuserinfo. Uha 12/10/2004
$bbuserinfo $DB_site->query_first("
        SELECT userid, pmtotal, pmunread
            FROM " 
TABLE_PREFIX "user
        "
);
            
    
$bbuserinfo['userid'] = intval($bbuserinfo['userid']);
    
$bbuserinfo['pmtotal'] = intval($bbuserinfo['pmtotal']);
    
$bbuserinfo['pmunread'] = intval($bbuserinfo['pmunread']);
    
$pmcount $DB_site->query_first("
        SELECT
            COUNT(pmid) AS pmtotal,
            SUM(IF(messageread = 0 AND folderid = 0, 1, 0)) AS pmunread
        FROM " 
TABLE_PREFIX "pm AS pm
        WHERE pm.userid = 
$bbuserinfo[userid]
    "
);

    
$pmcount['pmtotal'] = intval($pmcount['pmtotal']);
    
$pmcount['pmunread'] = intval($pmcount['pmunread']);
    
if (
$bbuserinfo['pmtotal'] != $pmcount['pmtotal'] OR $bbuserinfo['pmunread'] != $pmcount['pmunread'])
    {
        
$DB_site->query("
            UPDATE " 
TABLE_PREFIX "user SET
                pmtotal = 
$pmcount[pmtotal],
                pmunread = 
$pmcount[pmunread]
            WHERE userid = 
$bbuserinfo[userid]
        "
);
    }
    
$DB_site->free_result($bbuserinfo);
$DB_site->free_result($pmcount); 

My friend just fix that for me.

Have fun.

alkahf 12-11-2004 03:39 PM

Thankyou wowthatnice
I'll try this change.

Regards:)

alkahf 12-12-2004 03:25 AM

The same problem,
Not change PM's counters.
Is it working with you wowthatnice ?

wowthatnice 12-12-2004 04:36 AM

Yeah, I been test it out and it work great without any error. But what do you get? it not update at all? Let me ask him again becuase when I ask him he only take around 3 minutes to make it for me and he didn't even test it.

T3MEDIA 12-13-2004 08:37 AM

Please let us know. I would like to install this as well.

trackpads 12-13-2004 11:20 PM

Great work!! Thanks!!

T3MEDIA 12-21-2004 11:12 AM

Quote:

Originally Posted by T3MEDIA
Please let us know. I would like to install this as well.

::bump:: polite.

trackpads 12-22-2004 05:13 PM

Quote:

Originally Posted by T3MEDIA
::bump:: polite.

Any have any idea how to change it from 30 days? I want them pruned after 180 days for example.

thanks again,

-Jason

GenSec 12-23-2004 05:24 AM

Quote:

Originally Posted by trackpads
Any have any idea how to change it from 30 days? I want them pruned after 180 days for example.

thanks again,

-Jason

In cleanoldpm.php change
PHP Code:

        WHERE pmtext.dateline " . (TIMENOW - 2592000) . " 

to

PHP Code:

        WHERE pmtext.dateline " . (TIMENOW - 15552000) . " 



All times are GMT. The time now is 07:59 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.01096 seconds
  • Memory Usage 1,755KB
  • 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_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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