Collections functions
General functions
Render functions
Theme permission functions
Resource functions

empty_user_dash()

Parameters

ColumnTypeDefaultDescription
$user
$purge true

Location

include/dash_functions.php lines 1015 to 1032

Definition

 
function empty_user_dash($user,$purge=true)
    {
    global 
$lang;
    
$usertiles ps_query("SELECT dash_tile FROM user_dash_tile WHERE user_dash_tile.user= ?", ['i'$user]);
    
ps_query("DELETE FROM user_dash_tile WHERE user= ?", ['i'$user]);
    if(
$purge)
        {
        foreach(
$usertiles as $tile)
            {
            
$existing ps_query("SELECT count(*) as 'count' FROM user_dash_tile WHERE dash_tile= ?", ['i'$tile['dash_tile']]);
            if(
$existing[0]["count"]<1)
                {
                
delete_dash_tile($tile["dash_tile"]);
                
log_activity($lang['manage_all_dash'],LOG_CODE_DELETED,$tile["title"],'dash_tile',NULL,$tile["dash_tile"]);
                }
            }
        }    
    }

This article was last updated 3rd October 2022 12:05 Europe/London time based on the source file dated 27th September 2022 15:05 Europe/London time.