Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

reorder_user_dash()

Parameters

ColumnTypeDefaultDescription
$user

Location

include/dash_functions.php lines 987 to 1004

Definition

 
function reorder_user_dash($user)
    {
    
$user_tiles sql_query("SELECT user_dash_tile.ref FROM user_dash_tile LEFT JOIN dash_tile ON user_dash_tile.dash_tile = dash_tile.ref WHERE user_dash_tile.user='".$user."' ORDER BY user_dash_tile.order_by");
    if (
count($user_tiles) < 2)
        {
        return;    
        }
    
$order_by=10 count($user_tiles);
    
    
$sql="UPDATE user_dash_tile SET order_by = (CASE ";
    for(
$i=count($user_tiles)-1;$i>=0;$i--)
        {
        
$sql.=" WHEN ref='" $user_tiles[$i]["ref"] . "' THEN '" $order_by "' ";
        
$order_by-=10;
        }
    
$sql.=" END) WHERE user='" $user "'";
    
sql_query($sql);
    }

This article was last updated 23rd November 2020 18:35 Europe/London time based on the source file dated 3rd November 2020 16:55 Europe/London time.