Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

empty_user_dash()

Parameters

ColumnTypeDefaultDescription
$user
$purge true

Location

include/dash_functions.php lines 1004 to 1021

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 21st May 2024 21:35 Europe/London time based on the source file dated 25th April 2024 16:15 Europe/London time.