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

그룹별[그룹접근설정후] 메인페이지 달리적용하기

· 13년 전 · 5591 · 1
일단 레인님께 진심으로 감사드립니다.
로직은 회원가입받을때  그룹별로 등록하게 하였고   그룹별로 메인 index.php 페이지를 달리 적용하게끔 구현하고 싶었습니니다.
 
로그인후  접근그룹이 a그룹이면  =>  홈페이지주소/bbs/index1.php
                접근그룹이 b그룹이면  =>  홈페이지주소/bbs/index2.php
 
그리고 한가지 더 추가를 하면 로그인할시 레벨이 3등급이하면 로그인페이지로 돌아가게 하라..
 
일단 홈페이지주소/bbs/index.php를  상단에서  ~   <!-- 메인화면 최신글 시작 -->  중간부분에
아래와 같은 소스를 삽입하시면 될겁니다.
 
 
 
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");
 
$gr_b= sql_fetch("select gr_id from g4_group_member where mb_id = '$member[mb_id]'and gr_id='tc' limit 1");

if($gr_b[gr_id]) { $file='index1.php';
} else { $file='index2.php';
}
 
 

if (!$member[mb_id])
goto_url ("$g4[bbs_path]/login.php?url=" . urlencode("$_SERVER[PHP_SELF]?w=$w&mb_id=$mb_id"));
else if($member[mb_level] < 3) { //3레벨 미만이면 홈페이지 메인으로 튕겨주기*^^*
alert("접근권한이 없습니다! 담당자에게 전화문의하세요!", "http://홈페이지주소/bbs/bbs/logout.php");
}
 
else if ($is_admin != "super") {
$auth = array();
$sql = " select au_menu, au_auth from $g4[auth_table] where mb_id = '$member[mb_id]'  ";
$result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) {
$auth[$row[au_menu]] = $row[au_auth];
}}
$g4['title'] = "";
include_once("./_head.php")
?>
 
<script type="text/javascript">
location.href="홈페이지주소/bbs/<?=$file?>";
</script>
 
그리고 나서 index1.php 와 index2.php  페이지는 입맛에 맞게 작성하시면 되구요..^^
 
정말 감사합니다.  레인님!  쌀쌀한 날씨에  감기조심하세요^^
 
 

댓글 작성

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

로그인하기

댓글 1개

감사합니다. 접근 그룹이 겹치지 않는다는 조건하의 소스입니다.

게시글 목록

번호 제목
34706
34693
34563
34536
34521
34480
34479
34466
34437
34436
34435
34406
34398
34387
34382
34375
34364
34336
34294
34293