Collections functions
General functions
Render functions
Theme permission functions
Resource functions

render_message()

Parameters

ColumnTypeDefaultDescription
$message ""

Location

include/render_functions.php lines 5637 to 5688

Definition

 
function render_message($message="")
    {
    global 
$userref;
    
$msgdata = array();
    if(
$message == "")
        {
        
// Template
        
$msgdata[] = "%%CLASSES%%"// %%CLASSES%%
        
$msgdata[] = ""// EXTRA 
        
$msgdata[] = "%%PROFILEIMAGE%%";  // %%PROFILEIMAGE%%
        
$msgdata[] = "%%MESSAGE%%"// %%MESSAGE%%
        
}
    else
        {
        
$udata get_user($message["owner"]);
        if(
$udata["ref"] == $userref)
            {
            
$msgdata[] = "user_message own_message"// %%CLASSES%%
            
}
        else
            {
            
$msgdata[] = "user_message"// %%CLASSES%%
            
}
        
$sendername = isset($udata["fullname"]) && trim($udata["fullname"]) != "" $udata["fullname"] : $udata["username"];

        
$msgdata[] = ""// EXTRA 

        
$pimage get_profile_image($message["owner"]);
        if(
$pimage == "")
            {
            
$msgdata[] = "<i title='" htmlspecialchars($sendername) . "' aria-hidden='true' class='fa fa-user fa-fw fa-lg ProfileImage'></i>";  // %%PROFILEIMAGE%%
            
}
        else
            {
            
$msgdata[] = "<img title='" htmlspecialchars($sendername) . "' alt='" htmlspecialchars($sendername) . "' class='ProfileImage' src='" $pimage "'>";  // %%PROFILEIMAGE%%
            
}  
        
$msgdata[] = htmlspecialchars($message["message"]);  // %%MESSAGE%%     
        
}

    
$messagehtml "<div class='%%CLASSES%%' %%EXTRA%%>
        <div class='message_content'>
            <div class='profileimage'>
            %%PROFILEIMAGE%%
            </div>
            <div class='user_message_text'>%%MESSAGE%%</div>
        </div>
        <div class='clearerleft'></div>
    </div>"
;


    echo 
str_replace(array("%%CLASSES%%","%%EXTRA%%","%%PROFILEIMAGE%%","%%MESSAGE%%"),$msgdata,$messagehtml);
    }

This article was last updated 3rd October 2022 13:35 Europe/London time based on the source file dated 22nd September 2022 16:20 Europe/London time.