Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Prune PMs older than 30 days Details »»
Prune PMs older than 30 days
Version: 1.00, by GenSec GenSec is offline
Developer Last Online: Jun 2010 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 10-13-2004 Last Update: Never Installs: 20
 
No support by the author.

These hack adds a cron job to prune old PMs for vBulletin 3.

======================
Upload the attached .php file
======================

includes/cron directory
cleanoldpm.php

========================
Make a vB-Cron entry
========================

Go to admin controlpanel

1) Scheduled Tasks
2) Add New Scheduled Task with the following data

Titel: Prune PMs older 30 days
weekday: *
day of month: *
hour: 0
minute: 0
enable log: no
filename: ./includes/cron/cleanoldpm.php


Thats all.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 12-02-2004, 10:03 AM
TTG's Avatar
TTG TTG is offline
 
Join Date: May 2004
Location: Sth London
Posts: 1,042
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very useful .. thanks for the hack.
Clicked install
Reply With Quote
  #13  
Old 12-11-2004, 09:24 AM
wowthatnice wowthatnice is offline
 
Join Date: Jan 2003
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #14  
Old 12-11-2004, 03:39 PM
alkahf alkahf is offline
 
Join Date: Mar 2004
Location: Moscow
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thankyou wowthatnice
I'll try this change.

Regards
Reply With Quote
  #15  
Old 12-12-2004, 03:25 AM
alkahf alkahf is offline
 
Join Date: Mar 2004
Location: Moscow
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The same problem,
Not change PM's counters.
Is it working with you wowthatnice ?
Reply With Quote
  #16  
Old 12-12-2004, 04:36 AM
wowthatnice wowthatnice is offline
 
Join Date: Jan 2003
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #17  
Old 12-13-2004, 08:37 AM
T3MEDIA T3MEDIA is offline
 
Join Date: Dec 2004
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please let us know. I would like to install this as well.
Reply With Quote
  #18  
Old 12-13-2004, 11:20 PM
trackpads's Avatar
trackpads trackpads is offline
 
Join Date: Aug 2003
Location: Armyville
Posts: 1,074
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great work!! Thanks!!
Reply With Quote
  #19  
Old 12-21-2004, 11:12 AM
T3MEDIA T3MEDIA is offline
 
Join Date: Dec 2004
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by T3MEDIA
Please let us know. I would like to install this as well.
::bump:: polite.
Reply With Quote
  #20  
Old 12-22-2004, 05:13 PM
trackpads's Avatar
trackpads trackpads is offline
 
Join Date: Aug 2003
Location: Armyville
Posts: 1,074
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #21  
Old 12-23-2004, 05:24 AM
GenSec GenSec is offline
 
Join Date: Oct 2001
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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) . " 
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:27 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04842 seconds
  • Memory Usage 2,323KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete