쪽지알람 팝업창 클릭시 받은 쪽지함으로 이동...

쪽지알람 팝업창 클릭시 받은 쪽지함으로 이동...

QA

쪽지알람 팝업창 클릭시 받은 쪽지함으로 이동...

본문

https://sir.kr/g5_plugin/5467

 

위 게시물을 참고하고 적용시켰는데요..

 

쪽지가 오면 소리도 나고 팝업까지 잘 뜹니다..

 

쪽지함은 현재 새창이 아닌 현재창에서 뜨도록 되어있어요.

 

여기서 팝업을 누르면 받은 쪽지함으로 바로 가게하려면 어디를 어떻게 수정해야하는지 좀 알려주세요.

 

 

alarm.js 소스 첨부합니다ㅜㅜ

 

 

var show_alarm_exist=false;

function check_alarm(){
    $.ajax({
        type:'POST',
        data : ({act : 'alarm'}),
        url: memo_alarm_url + '/get-events.php',
        dataType:'json',
        async:true,
        cache:false,
        success:function(result){
            if(result.msg=='SUCCESS'){
                show_alarm(result.title, result.content, result.url, result.me_id);
            }else{
            }                
        }
    });
}

function show_alarm(title,content,url,me_id){
    if(show_alarm_exist) hide_alarm();
    show_alarm_exist=true;
    var html = "";
    audio.play();
    html = "<div id='alarm_layer' class='wrapper-notification bottom right side' style='display:none'>";
    html += "<div class='notification notification-primary notification-msg animated bounceInUp' id='" + me_id + "'>";
    html += "<div class='notification-icon'><i class='fa fa-envelope'></i></div>";
    html += "<div class='notification-close'>";
    html += "<button class='close' onclick='hide_alarm()'><i class='fa fa-times fa-lg'></i></button>";
    html += "</div>";
    html += "<div class='notification-option'><button class='notification-check' data-toggle='tooltip' data-trigger='hover' data-html='true' data-placement='top' data-original-title='읽음' onclick='set_recv_memo(" + me_id + ")'><i class='fa fa-check'></i></button></div>";
    html += "<div class='notification-heading'>" + RemoveTag(title) + "</div>";
    html += "<div class='notification-content'><a onclick=\"win_memo('" + url + "');\" class=\"cursor\">" + content  + "</a></div>";
    html += "</div>";
    html += "</div>";

    $('body').prepend(html);
    $('#alarm_layer').fadeIn();
    setTimeout(function(){ hide_alarm(); }, 30000);
    
}
function hide_alarm(){
    if(show_alarm_exist){
        show_alarm_exist=false;
        $("#alarm_layer").fadeOut(400,function(){
            $('#alarm_layer').remove();
        });
        
    }
}
function set_recv_memo(me_id){
    $.ajax({
        type:'POST',
        data : ({act : 'recv_memo', me_id : me_id}),
        url: memo_alarm_url + '/get-events.php',
        dataType:'json',
        async:true,
        cache:false,
        success:function(result){
            if(result.msg=='SUCCESS'){
                hide_alarm();
            }else{
            }                
        }
    });
}
function RemoveTag(s){
    var tmp = '';
    tmp = s;
    tmp = tmp.replace('<','<');
    tmp = tmp.replace('>','>');
    tmp = tmp.replace('"','"');

    return tmp;
}

이 질문에 댓글 쓰기 :

답변 2

<a onclick=\"win_memo('" + url + "');\" class=\"cursor\">" + content  + "</a> 이게 쪽지 링크인데...

잘 안되면 onclick=\"win_memo('" + url + "');\" 를 onclick=\"href='" +me_link + "' 로 바꿔보세요

머시기거시기님 늦은시간에 답변 감사드립니다.
알려주신대로 <a onclick=\"href='" +me_link + "' class=\"cursor\">" + content  + "</a>
이렇게 수정했더니 팝업은 안뜨고 소리만 나네요..ㅜㅜ

그게 뭔가 적용이 어려웠던 기억이...ㅎ나도 고친거 같아요

지금 하고자 하는 버전은 5.4라 다르네요..

 

+ url +를 + me_id + 또는 me_subject, me_content, me_memo 등등으로 바꿔보세요

머시기거시기님 어제부터 친절한 답변 감사드립니다^^
me_id로 변경하니까 팝업은 뜨는데 눌러도 아무 반응없이 증상은 동일하구요
me_subject, me_content, me_memo 이 세개는 아예 팝업창이 안뜨네요..
이 작업이 이렇게 힘든건지 오늘 또 배웠습니다..

답변을 작성하시기 전에 로그인 해주세요.
전체 98
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT