Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

message_get()

Parameters

ColumnTypeDefaultDescription
&$messages
$user
$get_all false
$sort_desc false

Location

include/message_functions.php lines 8 to 19

Definition

 
function message_get(&$messages,$user,$get_all=false,$sort_desc=false)
    {
    
$messages=sql_query("SELECT user_message.ref, user.username AS owner, user_message.seen, message.created, message.expires, message.message, message.url " .
        
"FROM `user_message`
        INNER JOIN `message` ON user_message.message=message.ref " 
.
        
"LEFT OUTER JOIN `user` ON message.owner=user.ref " .
        
"WHERE user_message.user='{$user}'" .
        (
$get_all " " " AND message.expires > NOW()") .
        (
$get_all " " " AND user_message.seen='0'") .
        
" ORDER BY user_message.ref " . ($sort_desc "DESC" "ASC"));
    return(
count($messages) > 0);
    }

This article was last updated 10th July 2020 21:05 Europe/London time based on the source file dated 2nd July 2020 09:49 Europe/London time.