로그인후 이용하라는 알람과 문구를 뜨게할려면 어떻게해야하나요?
본문
이 코드중에 리스트에 있는 게시판중에 하나를 클릭하면 들어가지않고 로그인후 이용해주십시요 알람이 켜지면서 로그인 쪽으로 넘어가게 하는 소스가 뭔가요?
로그인으로 넘어가게하는 소스 좀 찾아주세요
bbs/board.php
안에있는
if (isset($group['gr_use_access']) && $group['gr_use_access']) {
if ($is_guest) {
$msg = "로그인 후 이용해 보십시오";
alert($msg, './login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr));
}
// 그룹관리자 이상이라면 통과
if ($is_admin == "super" || $is_admin == "group") {
;
} else {
// 그룹접근
$sql = " select count(*) as cnt from {$g5['group_member_table']} where gr_id = '{$board['gr_id']}' and mb_id = '{$member['mb_id']}' ";
$row = sql_fetch($sql);
if (!$row['cnt']) {
alert("로그인 후 이용해 보십시오", G5_URL);
}
}
}
// 로그인된 회원의 권한이 설정된 읽기 권한보다 작다면
if ($member['mb_level'] < $board['bo_read_level']) {
if ($is_member)
alert(로그인 후 이용해 보십시오', G5_URL);
else
alert(로그인 후 이용해 보십시오', './login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr));
}
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
include_once($board_skin_path.'/skin.lib.php');
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/wookmark.css">', 0);
add_stylesheet('<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.css">', 0);
?>
<div class="fz_header">
<div class="fz_total_count"><span> Total <strong><?php echo number_format($total_count) ?></strong></span></div>
<? if ($rss_href) { ?><div class="fz_rss"><a class="list_btn btn_rss" href="<?=$rss_href?>" title="RSS">RSS</a></div><?php }?>
</div>
<br>
<form name="fboardlist" id="fboardlist" action="./board_list_update.php" onsubmit="return fboardlist_submit(this);" method="post">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="spt" value="<?php echo $spt ?>">
<input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="sw" value="">
<div id="loadingImage">
<img src="<?php echo $board_skin_url;?>/img/loading.gif"/>
</div>
<!-- loading image -->
<div role="main" style="margin-left:5px">
<ul class="gall_ul tiles-wrap animated" id="wookmark1">
<?php for ($i=0; $i<count($list); $i++) {
if($i>0 && ($i % $bo_gallery_cols == 0))
$style = 'clear:both;';
else
$style = '';
if ($i == 0) $k = 0;
$k += 1;
if ($k % $bo_gallery_cols == 0) $style .= "margin:0 !important;";
?>
<li data-link="<?php echo $list[$i]['href']?>">
<!--<?php if ($is_checkbox) { ?>
<?php if ($list_href || $is_checkbox || $write_href || $page !=1) { ?>
<div class="bo_fx">
<?php if ($is_checkbox) { ?>
<ul class="btn_bo_adm">
<!-- <li><input type="submit" name="btn_submit" value="선택삭제" onclick="document.pressed=this.value"></li>
<li><input type="submit" name="btn_submit" value="선택복사" onclick="document.pressed=this.value"></li>
<li><input type="submit" name="btn_submit" value="선택이동" onclick="document.pressed=this.value"></li>-->
</ul>
<?php } ?>
<?php if ($list_href || $write_href || $page !=1) { ?>
<ul class="btn_bo_user">
<?php if ($list_href) { ?><li><a href="<?php echo $list_href ?>" class="btn_b01">View All List</a></li><?php } ?>
<?php if ($page !=1 && !$list_href) { ?><li><a href="<?php echo G5_BBS_URL.'/board.php?bo_table='.$board['bo_table'];?>" class="btn_b01">View All List</a></li><?php } ?>
<!-- <?php if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="btn_b02">글쓰기</a></li><?php } ?>-->
</ul>
<?php } ?>
</div>
<?php } ?>
</form>
</div>
<script src="<?=$board_skin_url?>/wookmark.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
//사이드뷰 관련 함수
var qs_hide = false;
$('#wookmark1').on("click",".sv_member , .sv_guest",function() {
$(".sv").removeClass("qs_on");
$(this).closest(".sv_wrap").find(".sv").addClass("qs_on");
});
$('#wookmark1').on("mouseenter",".sv, .title",function(){
qs_hide = false;
});
$('#wookmark1').on("mouseleave", ".sv, .title",function(){
qs_hide = true;
});
$("#wookmark1").on("focusin",".sv a",function() {
qs_hide = false;
});
$("#wookmark1").on("focusout",".sv a",function() {
qs_hide = true;
});
$(document).click(function(){
if(qs_hide) {$(".sv").removeClass("qs_on");}
});
$.fn.hasScrollBar = function() {
return (this.prop("scrollHeight") == 0 && this.prop("clientHeight") == 0)
|| (this.prop("scrollHeight") > this.prop("clientHeight"));
};
var uri = '<?=G5_BBS_URL.'/board.php?bo_table='.$bo_table.$qstr.'&page=';?>';
var url = uri.replace(/&/g,"&");
var page = <?=$page;?>;
var nextPage = page+1;
var totalPage = <?=$total_page;?>;
var wookmark1 = new Wookmark('#wookmark1' , {
outerOffset:0,
itemWidth:parseInt(<?=$board['bo_gallery_width'];?>)+10
});
//$('#wookmark1 li:not(.empty_list)').click(function(){
// var page = $(this).data('link');
// location.href =page;
//});
/* 다음페이지 불러오기 */
function callContents(page) {
if(nextPage > totalPage) {
return page;
}else {
var npage=page;
page=page+1;
$.ajax({
url:url+npage,
success:function(data) {
var result =$(data).find('#wookmark1').html();
$('#wookmark1').append(result);
$('.tiles-wrap').removeClass('wookmark-initialised');
var wookmark1 = new Wookmark('#wookmark1' , {
outerOffset:0,
itemWidth:parseInt(<?=$board['bo_gallery_width'];?>)+10
});
$('.tiles-wrap').addClass('wookmark-initialised');
},
beforeSend:function() {
$("#loadingImage").css("display","block");
},
complete:function() {
$("#loadingImage").css("display","none");
},
error:function(e) {
alert("통신 실패");
console.log(e);
}
});
return page;
}
}
/* init */
function addGallery() {
// console.log("next : "+nextPage +", total : "+totalPage+", scroll : "+$('html').hasScrollBar());
if( (nextPage > totalPage) || $('html').hasScrollBar() ) {
clearInterval(galleryInit);
$("#loadingImage").css("display","none");
}else {
nextPage=callContents(nextPage);
$("#loadingImage").css("display","block");
}
}
/* scrolling 후 다음페이지 불러오기 */
$(window).scroll(function() {
if($(window).scrollTop() == $(document).height() - $(window).height()){
nextPage=callContents(nextPage);
}
});
$("#loadingImage").css("display","block");
var galleryInit = setInterval(addGallery, 1000);
});
</script>
<?php if($is_checkbox) { ?>
<noscript>
<p>자바스크립트를 사용하지 않는 경우<br>별도의 확인 절차 없이 바로 선택삭제 처리하므로 주의하시기 바랍니다.</p>
</noscript>
<?php } ?>
<!-- 페이지 -->
<!-- <?php echo $write_pages; ?> -->
<?php if ($is_checkbox) { ?>
<script>
function all_checked(sw) {
var f = document.fboardlist;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]")
f.elements[i].checked = sw;
}
}
function fboardlist_submit(f) {
var chk_count = 0;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
chk_count++;
}
if (!chk_count) {
alert(document.pressed + "할 게시물을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택복사") {
select_copy("copy");
return;
}
if(document.pressed == "선택이동") {
select_copy("move");
return;
}
if(document.pressed == "선택삭제") {
if (!confirm("Are you sure you want to delete the selected post?<br>(确定要删除选择的帖子吗?)\n\nOnce deleted it can not be recovered.<br>(一经删除将无法复原)\n\n\n"))
return false;
f.removeAttribute("target");
f.action = "./board_list_update.php";
}
return true;
}
// 선택한 게시물 복사 및 이동
function select_copy(sw) {
var f = document.fboardlist;
if (sw == 'copy')
str = "복사";
else
str = "이동";
var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = "./move.php";
f.submit();
}
</script>
<?php } ?>
<!-- } 게시판 목록 끝 -->