<?php
/**
* Replaces occurences of the form #filter:user_login-asdfas# with a personal message link
*/

function smarty_outputfilter_eF_template_formatLogins($compiled, &$smarty) {
    if($_SESSION['s_role_options']['personal_messages'] == 1){
        $new = preg_replace("/#filter:user_login-(.*)#/U", "<a href = \"forum/new_message.php?recipient=\$1\" onclick = \"eF_js_showDivPopup('"._NEWMESSAGE."', new Array('650px', '450px'))\" title=\"\\1\" target = \"POPUP_FRAME\"><img alt=\"\\1\" border=0 src=\"images/16x16/user1.png\"/></a>", $compiled);
        $new = preg_replace("/#filter:user_loginNoIcon-(.*)#/U", "<a href = \"forum/new_message.php?recipient=\$1\" onclick = \"eF_js_showDivPopup('"._NEWMESSAGE."', new Array('650px','450px'))\" title=\"\\1\" target = \"POPUP_FRAME\">\\1</a>", $new);
    }else{
        $new = preg_replace("/#filter:user_login-(.*)#/U", "<img alt=\"\\1\" border=0 title=\"\\1\" src=\"images/16x16/user1_gray.png\"/>", $compiled);
        $new = preg_replace("/#filter:user_loginNoIcon-(.*)#/U", "\\1", $new);  
    }
    return $new;
}

?>