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)

GenSec 10-13-2004 10:00 PM

Prune PMs older than 30 days
 
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.

Polo 10-14-2004 05:14 PM

mmm.. this hack may come in handy ;) thanks GenSec for sharing ;)

frankenberrie 10-15-2004 07:24 PM

This hack will be great for the Arcade mod - Most members never delete their old challenge pms-

dssstorm 10-28-2004 11:43 PM

He rock's

paulyy 11-21-2004 12:41 AM

Nice hack :)

alkahf 11-26-2004 03:30 PM

Hello GenSec
Before install hack
Private Messages: 2 Unread, Total 280.
After installed hack:
The same numbers: Private Messages: 2 Unread, Total 280.
But I have now only 5 PMs:).
How fix it ?

akahf

GenSec 11-27-2004 02:55 PM

Run the cron job :)

alkahf 11-28-2004 05:21 AM

Quote:

Originally Posted by GenSec
Run the cron job :)

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

Regards

Vman 11-28-2004 05:41 AM

This is great!.......Can't wait for more cron jobs to become available for download...

Thanks!

allhandl 12-01-2004 11:19 PM

if I PM a user and they dont logon on within the 30 days the PM is wiped off the server as the hack states. However when they logon the navbar states they have a message. When you go to inbox it says it is empty.

Whats worse is there is no way to delete it out of there?

Im a newbie but it almost looks like the PM is getting deleted however the 'messageread' table in db isnt being effected. This only happens when a user does not view the message within the 30 days. If I read a PM and leave in inbox it deletes with no problems.

Anyone having similar problem or has a solution?

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) . " 


T3MEDIA 12-23-2004 12:30 PM

hummm. ok.

T3MEDIA 12-23-2004 12:39 PM

Why this does not keep a log? I see G. was here but doesnt reply. I was intrested in this whole heartly.

No thanks.

Happy holidays.

trackpads 12-23-2004 01:48 PM

Quote:

Originally Posted by GenSec
In cleanoldpm.php change
PHP Code:

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

to

PHP Code:

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


THANKS!

cinq 12-23-2004 02:53 PM

have the problems for this hack been fixed ?
Would be a great addition ( in fact should come standard in vb ) :D

Vman 01-11-2005 05:01 AM

I have installed this a few months ago...And I have yet to see the cron job do its job! yet I get no errors on this...Why...

i.e.:
I have had 157 PM's and I still have 157 PM's after a month and 1/2...the cron did not work...

Vman 01-15-2005 06:03 AM

OK, Is there a way to change the 30 days to 15 days and how?

MrD 01-15-2005 03:14 PM

Hi,
Quote:

Originally Posted by BBCVman
OK, Is there a way to change the 30 days to 15 days and how?

https://vborg.vbsupport.ru/showpost....4&postcount=20

in this post, the User change the Time to 180 days

U must be change the timenow variable to your time :)

Vman 01-15-2005 05:13 PM

Thank You!!!!

+Fares+ 02-07-2005 03:30 PM

Quote:

Originally Posted by alkahf
Hello GenSec
Before install hack
Private Messages: 2 Unread, Total 280.
After installed hack:
The same numbers: Private Messages: 2 Unread, Total 280.
But I have now only 5 PMs:).
How fix it ?

akahf

Before install hack
Private Messages: 0 Unread, Total 916.
After installed hack:
The same numbers: Private Messages: 0 Unread, Total 916.
But I have now only 573 PMs:).
How fix it ?

MAK-upl 02-18-2005 02:25 PM

306 - clicks install

Rabbitoh Warren 04-16-2006 03:36 PM

If there is an equivalant mod like this for vB 3.5 someone please point me in the right direction.

Thanks.

DjJoschimo 04-16-2006 06:31 PM

yes, please me too :) ;)

jluerken 08-09-2006 01:59 PM

I am searching for such a sheduled task for vBulletin 3.6

Will this work?

Alphawolf83 05-20-2007 06:35 PM

Any equivalant Hack for 3.6 existing? :)

Shazz 05-20-2007 07:12 PM

Quote:

Originally Posted by Alphawolf83 (Post 1251602)
Any equivalant Hack for 3.6 existing? :)

Simular was released but the cron didn't work as ususal...


All times are GMT. The time now is 04:47 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.01826 seconds
  • Memory Usage 1,803KB
  • 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
  • (6)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (35)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete