Database Pruning

Clean old profile views ( days ): 
I have it set to 1 day but the records are still kept in the db any ides why?.

Cron job is set right (New install.)

 
Quote · 21 Sep 2011

Actually this option is not used anymore - http://www.boonex.com/trac/dolphin/ticket/2657

To clean old views you need to change this line:

define ('BX_OLD_VIEWS', 3*86400); // views older than this number of seconds will be deleted automatically

in inc/classes/BxDolViews.php file, but it will prune all views objects, not only profile views.

Rules → http://www.boonex.com/terms
Quote · 22 Sep 2011

No no no.. that's not an option for me, anyway if its not used it shouldn't be there.
in settings theres this option "Track all profile views. Later a member can manage these "views"." Where do we manage these views?...

I have a mod that's using "sys_profile_views_track" and  i need it to empty the table once a week or so
i think the BxDolCronCmd.php needs to be modified to get it back to work with something like....

function clean_database()
    {
       $db_clean_views = (int) getParam("db_clean_views");

 //clear from `sys_profile_views_track`
  if (db_res("DELETE FROM `sys_profile_views_track` WHERE `Date` < UNIX_TIMESTAMP( NOW() - INTERVAL $db_clean_views DAY )"))
            db_res("OPTIMIZE TABLE `sys_profile_views_track`");

    }
        }

am i going the wrong direction lol....

Quote · 22 Sep 2011

 The views are deleted on cron by the following code:

 

        // clean old views

        bx_import('BxDolViews');

        $oBxViews = new BxDolViews('', 0);

        $iDeletedViews = $oBxViews->maintenance ();

But your code should work too, it will not interfere with above code, if your period is shorter than 3*86400 seconds.

 

No no no.. that's not an option for me, anyway if its not used it shouldn't be there.
in settings theres this option "Track all profile views. Later a member can manage these "views"." Where do we manage these views?...

I have a mod that's using "sys_profile_views_track" and  i need it to empty the table once a week or so
i think the BxDolCronCmd.php needs to be modified to get it back to work with something like....

function clean_database()
    {
       $db_clean_views = (int) getParam("db_clean_views");

 //clear from `sys_profile_views_track`
  if (db_res("DELETE FROM `sys_profile_views_track` WHERE `Date` < UNIX_TIMESTAMP( NOW() - INTERVAL $db_clean_views DAY )"))
            db_res("OPTIMIZE TABLE `sys_profile_views_track`");

    }
        }

am i going the wrong direction lol....

 

Rules → http://www.boonex.com/terms
Quote · 22 Sep 2011

Ok sounds good ill give it a try. Thank you Alex

Quote · 22 Sep 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.