테스트 사이트 - 개발 중인 베타 버전입니다

알림 플러그인 이용중입니다. 채택완료

강낭콩콩이 4년 전 조회 1,413

https://sir.kr/g5_plugin/5467?sfl=wr_subject%7C%7Cwr_content&stx=%EC%95%8C%EB%A6%BC">https://sir.kr/g5_plugin/5467?sfl=wr_subject%7C%7Cwr_content&stx=%EC%95%8C%EB%A6%BC

위 링크 쪽지알림 플러그인 이용중입니다. 사용은 잘되는데.. 한번확인했던 알림. 그러니까 쪽지 를 한번만 보냈는데. 받는 사람이 동일한쪽지를 여러개 받은것처럼 알림이 됩니다. 실제로 쪽지함 가봐도 동일한쪽지가 초단위 분단위로 여러장 계속쌓이구요.. 확인을하였거나.  한번만 알람을 표시할순없을까요?ㅠㅠ  

</strong></p>

<p><?php

if (!defined('_GNUBOARD_')) exit; //개별 페이지 접근 불가

// 간격

//echo help('기본 60000ms, 밀리초(ms)는 천분의 1초. ex) 60초 = 60000ms');

$wset['delay'] = '60000';

$wset['delay'] = (isset($wset['delay']) && $wset['delay'] >= 60000) ? $wset['delay'] : 60000;

$alarm_url = G5_PLUGIN_URL."/alarm";

?></p>

<p><?php 

//특정 페이지에서 alarm 표시안함 

$except_alarm_page = array('memo.php',

                    'point.php',

                    'response.php',

                    'follow.php',

                    'scrap.php',

                    'mypost.php',

                    'myphoto.php',

                    'shopping.php',

                    'coupon.php',

                    'memo.php',

                    'board.php',

                    'memo_view.php',

                    'memo_form.php');

if (!in_array(basename($_SERVER['PHP_SELF']), $except_alarm_page)) 

{ 

    if ($member['mb_id'])

    {        

?></p>

<p><link rel="stylesheet" href="<?php echo $alarm_url ?>/alarm.css">

<script>

var memo_alarm_url = "<?php echo $alarm_url;?>";

var audio = new Audio("<?php echo $alarm_url;?>/memo_on.mp3");  // 임의 폴더 아래에 사운드 파일을 넣고 자바스크립트 동일경로 

</script>

<script src="<?php echo $alarm_url ?>/alarm.js"></script>

<script type="text/javascript">

    $(function() {

        setInterval(function() {

            check_alarm();

        }, <?php echo $wset['delay'] ?>);

        check_alarm();

    });

</script>

<?php } ?>

<?php } ?></p>

<p><strong>
 

 

 

 

</strong></p>

<p>var show_alarm_exist=false;</p>

<p>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{

            }                

        }

    });

}</p>

<p>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>";</p>

<p>    $('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('"','"');</p>

<p>    return tmp;

}</p>

<p> </p>

<p><strong>
 

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트

아래 댓글 다는 부분에서 문제가 있는것으로 보여지네요.

알림 부분만 모두 순정으로 셋팅하신 뒤에 다시 채크해보세요.

알림 플러그인 문제는 아닌것 같습니다.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인