라이믹스 알림센터가 따로 있는지 등
CMS/프레임워크 | Rhymix 2.0 |
---|---|
개발 언어 | PHP 7.3 |
문제 페이지 주소 | 비공개 (작성 후 5일 경과) |
1
알림 센터 라이트에서 알림은 정상적으로 오는데 알림을 클릭하면, 잘못된 요청이라도 나올때가 많습니다.
이때 주소를 보면 아래와 같습니다.
https://scorefactory.io/index.php?act=procNcenterliteRedirect&notify=02e433522386e1cacc2e407fdea87a14
amp; 가 수상하여 지워보니 제대로 이동합니다. 왜 생기는 것일까요? 어떻게 해결할 수 있을까요?
2
그리고 이 문제를 해결하고자 일단 최신 버젼(3.0.9)를 설치했는데 라이믹스 순정 알림센터를 사용하라고 합니다.
라이믹스 순정 알림센터는 어디서 받을 수 있을까요?
스코스코
Lv. 5
댓글 30
1.번은 저 링크를 어디서 제공하는지 알수 없지만 그 스킨의 문제일 가능성이 있어 보이구요.
2.번은 당연히 따로 설치하시면 안됩니다. 내장되어 있는 것을 덮어 씌우는 것이니 현재 라이믹스 코어 버전에 포함된 라이믹스로 다시 덮어 씌우시길 바랍니다.
스킨 문제군요.. 어떻게 해결해야 할지 실마리를 주셔서 감사합니다.
& 이 붙는 항목은 제가 그때 보니까 getUrl 으로 setRedirectUrl 함수를 사용하는 부분을 getNotEncoededUrl 함수이던가 그걸로 고치셔야 할거예요.
지금 겉으로 보이기에는 comely 레이아웃을 개조하신 것 같습니다.
해당 레이아웃 폴더에
/notify.html 파일을 열어보세요.
저희 사이트의 경우는
<li loop="$ncenterList => $o">
href="{$o->url}
</li>
이런식으로 따로 인코딩이나 그런것 없이 바로 사용하게 되어있네요.
그리고 지금 6번째 부터 이상해 진다고 하는 부분이 php 부분이 아니고 오히려 js 측에서 링크를 표시해 주는 부분에서 문제를 일으킬 수도 있다고 보여질 수도 있습니다.
해당 링크를 생성하는 곳을 찾아 js 까지 살펴보셔야 할 수도 있습니다.
님 알림센터에서 알림 가져오는게 아닌데요?
getNotifications 함수를 사용하는 부분이 알림센터에 없습니다 -_-;
타 모듈에서 알림센터의 데이터를 처리해서 가져오는것 같은데 위 타 모듈의 내용을 고쳐야 합니다.
위에도 설명드렷다 시피 내부 코드상에서 getUrl으로 막 코딩한 링크들이 문제입니다.
스킨을 사용하지 않고 레이아웃에서 처리 방법을 이용했을 겁니다.
지금 사용하는 개조된 레이아웃의 원본 레이아웃에 알림센터의 알림을 가져오는 코드가 있습니다.
레이아웃에서 이 데이터를 직접 출력하는데 개조를 하셨다고 하는데 어떤 부분에서 잘못된 개조를 했거나 혹은 원래 부터 오류가 있었을 지도요..
순정상태에서는 php 단에서
$oNcenterliteModel = getModel('ncenterlite');
$ncenterCount = $oNcenterliteModel->getMyNotifyList()->total_count;
$ncenterList = $oNcenterliteModel->getMyNotifyList()->data;
$ncenterList 로 데이터를 가져온 후
이것을 html에서 출력해 주고 있는데 지금 오류가 나는 것입니다.
레이아웃 출력 부분에서 얼마자 수정을 했는지는 저희가 모르기에 지금 원인을 알려드릴 수 없는 상황이구요.
<li loop="$ncenterList => $o">
href="{$o->url}
</li>
이 상태이긴 한데...
순정상태에서는 더보기로 더 불러오고 하는 등에서 js가 관여를 합니다.
그런데 지금 접속해서 테스트 계정으로 접속해 보면 더보기 관련 부분도 없어지고 그냥 5개가 넘는 부분도 한꺼번에 출력하는거 같기도 하고 그런 상황이네요.
질문하신 분께서 현재 레이아웃에서 개조된 부분의 코드를 보여주셔야 할 필요가 있어 보입니다.
관련있어보이는 내용을 찾아보았습니다. 아래 두 화일모두 레이아웃 폴더에 있습니다.
notify.html 일부
<div class="inner notify_list ncenter scrollbar-macosx">
{@
$ncenterList = getModel('ncenterlite')->getMyNotifyList(null, 1, false)->data;
// var_dump($ncenterList);
}
<!--@if($ncenterList)-->
<ul>
<li loop="$ncenterList => $o">
<img src="/download_content/red_dot_xs.png" alt="new" title="new" style="right: unset; top: 11px; left: 50px; margin-left: 3px; border: 0px solid #F6F6F6; border-radius: 10px;" class="menu_new" cond="$o->readed == 'N'">
<a class="list_link" href="{$o->url}"></a>
<span class="pf small lined"><img src="{$o->profileImage}" class="pf_img" cond="$o->profileImage" alt="profile_image" /></span>
<div class="msg">{$o->text}</div><div class="ago">{@ echo wstToAgo($o->regdate); }</div>
</li>
</ul>
<!--@else-->
<div class="no_notify" cond="$_is_mobile">
새로운 알림이 없습니다.<br />No New Notifications
</div>
<!--@end-->
</div>
ncenter.lib.php 일부
if(!function_exists('wstGetNoticeList'))
{
function wstGetNoticeList()
{
$addon_info = getAdminModel('addon')->getAddonInfoXml('sejin7940_all_notice', 0, 'site');
$notice_document_srl = '';
foreach($addon_info->extra_vars as $ev)
{
if($ev->name == 'notice_document_srl')
{
$notice_document_srl = $ev->value;
break;
}
}
$d = $notice_document_srl;
$d = explode(',', str_replace(' ', '', $d));
$notice_list = [];
$oDocumentModel = getModel('document');
foreach($d as $srl)
{
$notice_list[] = $oDocumentModel->getDocument($srl);
}
return $notice_list;
}
}
레이아웃내 querise 폴더내 getNoticeList.xml
<query id="getNoticeList" action="select">
<tables>
<table name="documents" />
</tables>
<columns>
<column name="document_srl" />
</columns>
<conditions>
<condition operation="in" column="module_srl" var="module_srls" />
<condition operation="more" column="document_srl" var="min_srl" pipe="and" />
</conditions>
</query>
notify.html 내부에 있는 스크립트는 아래와 같습니다.
//<![CDATA[
(function($){
$(document).ready(function(){
var $n = $("#notify");
var $nc = $n.find(".notify_list.ncenter");
var $lw = $nc.find('ul');
var page = 2;
function btMore(){
var $item = $('<li><a class="list_link"></a><span class="pf small lined"></span><div class="msg"></div><div class="ago"></div></li>');
var $profile = $('<img class="pf_img" alt="profile image" />');
$.get(default_url.setQuery('ajax', '1').setQuery('type', 'getNotifications').setQuery('page', page), function(ret){
if(!ret.list.data){
return;
}
for(var i in ret.list.data){
if(ret.list.data.hasOwnProperty(i)){
var item = ret.list.data[i];
var $html = $item.clone();
var $img = $profile.clone();
if(!item.profileImage){
item.profileImage = request_uri + 'layouts/comely_layout/images/profile.png';
}
$img.attr('src', item.profileImage);
$html.find('.pf').prepend($img);
$html.find('.msg').html(item.text);
$html.find('.ago').html(item.ago);
$html.find('a').attr('href', item.url);
if(i == 0){
$html.attr('id', 'ncenterlite_page_' + ret.list.page.cur_page).addClass('notify_page');
}
$lw.append($html);
}
}
$n.parent().scrollTop($n.parent()[0].scrollHeight);
});
page++;
return false;
}
if($('.inner-notify').height() < $('#notify').height()){
btMore();
}
$('#notify').on('scroll touchstart', function(){
if($('#notify').scrollTop() >= $('.inner-notify').height() - $('#notify').height() - 10){
btMore();
}
});
window.openAllNotifications = function(){
$.get(default_url.setQuery('ajax', '1').setQuery('type', 'openNotifications'));
};
});
})(jQuery);
//]]>
</script>
이부분에서 문제가 생기는 것 같아요.
getNotifications 이 포함된 부분은
1. 레이아웃폴더 내 ncenter.lib.php
case 'getNotifications':
$ncenterList = getModel('ncenterlite')->getMyNotifyList(null, Context::get('page'), false);
$struct['list'] = $ncenterList;
break;
2. 레이아웃폴더 내 notify.html
$type = Context::get('type');
switch($type)
{
case 'getNotifications':
$ncenterList = getModel('ncenterlite')->getMyNotifyList(null, Context::get('page'), false);
$struct['list'] = $ncenterList;
break;
case 'openNotifications':
getController('ncenterlite')->procNcenterliteNotifyReadAll();
$d = Context::get('sejin7940_all_notice_config')->notice_document_srl;
$d = explode(',', str_replace(' ', '', $d));
$v = max($d);
wstSetNcenterNoticeCache($v);
break;
}
입니다.. $type 변수가 전달될때 로딩되는 파일은 어떻게 확인하는지 모르겠어요..
getMyNotifyList 를 getMyNotifyListTpl 함수로 호출하도록 바꿔보세요.
함수스팩에 맞춰 코드 변경하셔야 하고요.
어디까지나 정석은 외부에서 호출하는게 아니라 직접 함수를 exec_json으로 호출해야합니다.-_-;
지금 고치신게 너무 많아 완전히 달라져서 어려울 것 같은데요. 수정해주신 분께 연락을 해보시던지...
편법이라도 이거 한번 시도를..
notify.html 의 스크립트 중
$html.find('a').attr('href', item.url);
를
$html.find('a').attr('href', item.url.replace(/&/g, "&"));
될지도 모르겠고 완전 땜빵이고 부작용이 있을지도 모르겠습니다.
추가로 알림을 더 가지고 오는 경우 스크립트에서 불러오는데 불러올때 잘못된 방법이 사용된 듯 하네요. 람보님 답변에 의하면요..
먼저도 말씀 드렸지만 임시방편으로 땜빵해주는거라 구조적인 저 문제를 발생시키는 원인은 해결되지 않았으니 모니터링을 좀더 해 보시고 다른 형태의 부작용이 생기는지 확인해 보세요.
저희 사용자들이 수정등의 의뢰를 맡겨도 잘못된 방법이 사용된 건지 알 수 없어 이런 점은 리스크라고 해야겠네요.
$.exec_json('ncenterlite.getMyNotifyListTpl', { 'page':page }, function(ret) {
}
위와 같이 사용했는데
코드 상당부분을 다른 것으로 바꿔서 지금 같은 url 문제가 발생하고 있네요.
수정작업 해주신 분이 해결 할 수 있을 것 같습니다.