모든 게시판의 글에 쓴 특정 아이디의 멤버의 글만 보여지게 하려면 어캐할까요?
본문
안녕하세요.
가령 mb_id가 'meber1'이라고 하는데
홈페이지 상단에 특정 input 박스를 만들어서 거기에 meber1이라고 넣어 검색하면
그게 세션이든지 쿠키든지가 되어서
모든 메뉴에 링크된 게시판을 열 때
해당 게시판에 쓴 member1이 쓴 글 만 목록에 보여지게 하려면 어캐하면 좋을까요?
답변 3
게시판검색에서 글쓴이 선택 후 특정 닉네임 넣으면 해당 닉네임 유저의 글만 리스트에 노출됩니다.
PS. 배추베이직 게시판 스킨에 mb_id 검색 기능도 있으니 해당 스킨 받아서 분석해 보세요.
답변 채택 완료한 질문이지만....
잘 안되면 다음 절차대로 하세요
1. 홈페이지 상단에 특정 input 박스
<?php
$schid=get_session('schid');
?>
<input id='schid' value='<?php echo $schid?>' onblur="schid_save(this.value)">
2. 자바스크립트 추가
<script>
function schid_save(mb_id){
if(!mb_id) return;
$.post('schid_save.php','schid='+mb_id, function(req){
if(req=='OK') alert('검색 아이디 저장완료'); else alert(req)
});
}
</script>
3. /schid_save.php 생성
<?php
include "_common.php";
$schid=trim($schid);
//$mb= get_member('mb_id', $schid);
$row=sql_fetch("select count(*) as cnt from {$g5['member_table']} where mb_id = '{$schid}' ");
if (!$row['mb_id']) die('존재하지않는 아이디');
set_session('schid','$schid');
die('OK');
4. extend/user.config.php 생성
if($bo_table){
$schid=get_session('schid');
if($schid) {$sfl='mb_id'; $stx= $schid; }
}
/bbs/list.php
에 커리 돌아가는 것을 중간에 조건문을로 추가해서 개발 하면 되는데.
여러 가지 환경적 변수가있씁니다