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

update_resource_type_field_order()

Parameters

ColumnTypeDefaultDescription
$neworder

Location

include/admin_functions.php lines 9 to 26

Definition

 
function update_resource_type_field_order($neworder)
    {
    global 
$lang;
    if (!
is_array($neworder)) {
        exit (
"Error: invalid input to update_resource_type_field_order function.");
    }

    
$updatesql"update resource_type_field set order_by=(case ref ";
    
$counter 10;
    foreach (
$neworder as $restype){
        
$updatesql.= "when '$restype' then '$counter' ";
        
$counter $counter 10;
    }
    
$updatesql.= "else order_by END)";
    
sql_query($updatesql);
    
clear_query_cache("schema");
    
log_activity($lang['resourcetypefieldreordered'],LOG_CODE_REORDERED,implode(', ',$neworder),'resource_type_field','order_by');
    }

This article was last updated 30th November 2020 20:05 Europe/London time based on the source file dated 17th July 2020 12:03 Europe/London time.