Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

render_message()

Parameters

ColumnTypeDefaultDescription
$message ""

Location

include/render_functions.php lines 5867 to 5918

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='" escape($sendername) . "' aria-hidden='true' class='fa fa-user fa-fw fa-lg ProfileImage'></i>";  // %%PROFILEIMAGE%%
            
}
        else
            {
            
$msgdata[] = "<img title='" escape($sendername) . "' alt='" escape($sendername) . "' class='ProfileImage' src='" $pimage "'>";  // %%PROFILEIMAGE%%
            
}  
        
$msgdata[] = escape($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 4th December 2024 08:35 Europe/London time based on the source file dated 3rd December 2024 11:55 Europe/London time.