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

add_usergroup_dash_tile()

Parameters

ColumnTypeDefaultDescription
$usergroup
$tile
$default_order_by

Location

include/dash_functions.php lines 738 to 777

Definition

 
function add_usergroup_dash_tile($usergroup$tile$default_order_by)
    {
    if(!
is_numeric($usergroup) || !is_numeric($tile))
        {
        return 
false;
        }

    
$reorder true;
    if(!
is_numeric($default_order_by))
        {
        
$default_order_by append_usergroup_position($usergroup);
        
$reorder          false;
        }

    
$existing ps_query(
        
"SELECT ref, usergroup, dash_tile, default_order_by, order_by
            FROM usergroup_dash_tile
            WHERE usergroup = ? AND dash_tile = ?"
,
        [
'i'$usergroup'i'$tile]
    );
    if(!
$existing)
        {
        
ps_query(
            
"INSERT INTO usergroup_dash_tile (usergroup, dash_tile, default_order_by)
            VALUES (?, ?, ?)"
,
            [
'i'$usergroup'i'$tile'i'$default_order_by]
        );
        }
    else
        {
        return 
$existing;
        }

    if(
$reorder)
        {
        
reorder_usergroup_dash($usergroup);
        }

    return 
true;
    }

This article was last updated 29th May 2024 11:35 Europe/London time based on the source file dated 22nd May 2024 00:00 Europe/London time.