Mukho

Divide board

module.exports=(function(){
return{
board:{
notice_board:{
host:'localhost',
port:3306,
user:'root',
password:'',
database:'singer_composer'
},
composer_board:{
host:'localhost',
port:3306,
user:'root',
password:'',
database:'singer_composer'
},
singer_board:{
host:'localhost',
port:3306,
user:'root',
password:'',
database:'singer_composer'
},
free_board:{
host:'localhost',
port:3306,
user:'root',
password:'',
database:'singer_composer'
},
suggestion_board:{
host:'localhost',
port:3306,
user:'root',
......
......@@ -22,7 +22,7 @@
<a class="navbar-brand" href="/main">묵호의 놀이터</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
<li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/chat" class="nav-link px-2 link-dark">채팅</a></li>
<li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
</ul>
......
......@@ -22,7 +22,7 @@
<a class="navbar-brand" href="/main">묵호의 놀이터</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
<li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/chat" class="nav-link px-2 link-dark">채팅</a></li>
<li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
</ul>
......@@ -32,6 +32,24 @@
</div>
</div>
</nav>
<div class ="wrap">
<div class="list_board">
<a class="board_btn" href="/board/list/notice">
공지사항
</a>
<a class="board_btn" href="/board/list/composer">
작곡가 구인
</a>
<a class="board_btn" href="/board/list/singer">
가수 구인
</a>
<a class="board_btn" href="/board/list/free">
자유게시판
</a>
<a class="board_btn" href="/board/list/suggestion">
건의사항
</a>
</div>
<!-- Footer-->
<footer class="footer bg-light">
<div class="container">
......
......@@ -21,7 +21,7 @@
<a class="navbar-brand" href="/main">묵호의 놀이터</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
<li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/chat" class="nav-link px-2 link-dark">채팅</a></li>
<li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
</ul>
......
......@@ -22,7 +22,7 @@
<a class="navbar-brand" href="/main">묵호의 놀이터</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
<li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/chat" class="nav-link px-2 link-dark">채팅</a></li>
<li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
</ul>
......
......@@ -22,7 +22,7 @@
<a class="navbar-brand" href="/main">묵호의 놀이터</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
<li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/chat" class="nav-link px-2 link-dark">채팅</a></li>
<li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
</ul>
......
......@@ -36,7 +36,7 @@ create table userdb(
profilepic varchar(300) unique
)engine=innodb;
create table board(
create table _board(
idx int not null primary key auto_increment,
nickname varchar(50) not null,
title varchar(50) not null,
......@@ -47,13 +47,13 @@ create table board(
ID varchar(20) not null
)engine=innodb;
create table comment(
create table _comment(
idx int auto_increment primary key,
ID varchar(20) not null,
nickname varchar(50) not null,
comment mediumtext not null,
bulletin_id int not null,
foreign key (bulletin_id) references board(idx) on delete cascade
foreign key (bulletin_id) references _board(idx) on delete cascade
)engine=innodb;
```
......@@ -69,8 +69,15 @@ create table comment(
>SET @COUNT = 0;<br>
>UPDATE board SET idx = @COUNT:=@COUNT+1;
- 게시판 추가 DB 이름(댓글은 board 대신 comment)
>공지사항: notice_board
>작곡가 구인: composer_board
>가수 구인: singer_board
>자유게시판: free_board
>건의사항: suggestion_board
---
### 최종 수정: 2021-11-29 19:47<br>
### 최종 수정: 2021-12-01 01:22<br>
### 수정 내용:
1. 채팅 구현(팝업)
2. 시간 실시간 반영
......@@ -82,4 +89,5 @@ create table comment(
8. 버그 수정
9. 댓글 등록, 열람, 삭제 기능 구현 및 버그 픽스
10. 채팅 중 서버 재시작시 기존 참여자들 리셋시킴
11. 요소 좌우 길이 80%로 조절
\ No newline at end of file
11. 요소 좌우 길이 80%로 조절
12. 게시판 [공지사항/작곡가 구인/가수 구인/자유게시판/건의사항]으로 분화
\ No newline at end of file
......
This diff is collapsed. Click to expand it.
......@@ -22,7 +22,7 @@
<a class="navbar-brand" href="/main">묵호의 놀이터</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
<li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/board class="nav-link px-2 link-dark">게시판</a></li>
<li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
<li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
</ul>
......
......@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>묵호 - 게시판</title>
<title>묵호 - <%= title %></title>
<!-- Favicon-->
<link rel="icon" type="image/x-icon" href="../assets/favicon.ico" />
<!-- Bootstrap icons-->
......@@ -23,7 +23,7 @@
<a class="navbar-brand" href="/main">묵호의 놀이터</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
<li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
<li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
</ul>
......@@ -35,25 +35,49 @@
</nav>
<div class ="wrap">
<div class="list_board">
<a class="board_btn" href="/board/list">
<a class="board_btn" href="/board/list/notice">
공지사항
</a>
<a class="board_btn" href="/board/list">
<a class="board_btn" href="/board/list/composer">
작곡가 구인
</a>
<a class="board_btn" href="/board/list">
<a class="board_btn" href="/board/list/singer">
가수 구인
</a>
<a class="board_btn" href="/board/list">
<a class="board_btn" href="/board/list/free">
자유게시판
</a>
<a class="board_btn" href="/board/list">
<a class="board_btn" href="/board/list/suggestion">
건의사항
</a>
</div>
<div class="container px-5 my-5">
<h1><%= title %></h1>
<%
var addr;
%>
<%
switch(title){
case '공지사항':
addr = 'notice';
break;
case '작곡가 구인':
addr = 'composer';
break;
case '가수 구인':
addr = 'singer';
break;
case '자유게시판':
addr = 'free';
break;
case '건의사항':
addr = 'suggestion';
break;
%>
<%
}
%>
<table border="1">
<tr>
<td>번호</td>
......@@ -73,7 +97,7 @@
<tr>
<td><%=data.idx%></td>
<td><%=data.nickname%></td>
<td><a href="/board/read/<%=data.idx%>"><%=data.title%></a></td>
<td><a href="/board/read/<%=addr%>/<%=data.idx%>"><%=data.title%></a></td>
<td><%=data.hit%></td>
<td><%=data.modidate%></td>
<td><%=data.regdate%></td>
......@@ -84,10 +108,9 @@
<tr>
<td colspan="6">
<%
for(var j = 0; j < rows.length/page_num ; j++){
%>
[<a href="/board/list/<%= j + 1 %>"><%= j+1 %></a>]
[<a href="/board/<%=addr%>/list/<%= j + 1 %>"><%= j+1 %></a>]
<%
}
%>
......@@ -95,7 +118,7 @@
</tr>
</table>
<nav class="navbar">
<a class="btn btn-outline-primary me-2" href="/board/write">글쓰기</a>
<a class="btn btn-outline-primary me-2" href="/board/write/<%=addr%>">글쓰기</a>
</nav>
</div>
</div>
......
......@@ -22,7 +22,7 @@
<a class="navbar-brand" href="/main">묵호의 놀이터</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
<li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
<li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
</ul>
......
......@@ -22,7 +22,7 @@
<a class="navbar-brand" href="/main">묵호의 놀이터</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
<li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
<li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
</ul>
......
......@@ -21,7 +21,7 @@
<a class="navbar-brand" href="/main">묵호의 놀이터</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
<li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
<li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
</ul>
......
......@@ -22,7 +22,7 @@
<a class="navbar-brand" href="/main">묵호의 놀이터</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
<li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
<li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
</ul>
......
......@@ -22,7 +22,7 @@
<a class="navbar-brand" href="/main">묵호의 놀이터</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
<li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
<li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
</ul>
......
......@@ -19,7 +19,7 @@
<a class="navbar-brand" href="/main">묵호의 놀이터</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
<li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
<li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
</ul>
......@@ -29,16 +29,40 @@
</div>
</div>
</nav>
<%
var addr;
%>
<div class="container px-5 my-5">
<h1><%= title %></h1>
<%
switch(title){
case '공지사항 글 상세':
addr = 'notice';
break;
case '작곡가 구인 글 상세':
addr = 'composer';
break;
case '가수 구인 글 상세':
addr = 'singer';
break;
case '자유게시판 글 상세':
addr = 'free';
break;
case '건의사항 글 상세':
addr = 'suggestion';
break;
%>
<%
}
%>
<script>
function submit2(frm){
frm.action="/board/delete";
frm.action="/board/delete/<%=addr%>";
frm.submit();
return true;
}
</script>
<form action="/board/update" method="post">
<form action="/board/update/<%=addr%>" method="post">
<table border="1">
<input type="hidden" name="idx" value="<%=row.idx%>"/>
<tr>
......@@ -69,7 +93,7 @@
<td colspan="3">
<button type="submit">글 수정</button>
<button type="summit" onclick="return submit2(this.form);">글 삭제</button>
<a href="/board/list">
<a href="/board/<%=addr%>/list">
<input type="button" value="목록">
</a>
</td>
......@@ -81,7 +105,7 @@
<h1>댓글</h1>
<script>
function submit3(frm){
frm.action="/board/read/commentdelete";
frm.action="/board/read/<%=addr%>/commentdelete";
frm.submit();
return true;
}
......@@ -89,12 +113,12 @@
}
</script>
<form action="/board/read/commentwrite" method="post">
<form action="/board/read/<%=addr%>/commentwrite" method="post">
<table border="1">
<input type="hidden" name="idx" value="<%=row.idx%>"/>
<tr>
<td>닉네임</td>
<td>댓글</td>
<td>내용</td>
</tr>
<%
for(var i=0; i<comment_length; i++){
......@@ -115,7 +139,7 @@
}
%>
<tr>
<td><%=usernick%></td>
<td><%=nickname%></td>
<td><textarea name="comment" id="comment" cols="30" rows="2" required></textarea></td>
<td colspan="2">
<button type="submit">댓글 쓰기</button>
......
......@@ -22,7 +22,7 @@
<a class="navbar-brand" href="/main">묵호의 놀이터</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
<li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
<li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
</ul>
......
......@@ -18,7 +18,7 @@
<a class="navbar-brand" href="/main">묵호의 놀이터</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
<li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
<li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
<li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
<li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
</ul>
......@@ -28,9 +28,33 @@
</div>
</div>
</nav>
<%
var addr;
%>
<div class="container px-5 my-5">
<h1><%= title %></h1>
<form action="/board/write" method="post">
<%
switch(title){
case '공지사항 글 쓰기':
addr = 'notice';
break;
case '작곡가 구인 글 쓰기':
addr = 'composer';
break;
case '가수 구인 글 쓰기':
addr = 'singer';
break;
case '자유게시판 글 쓰기':
addr = 'free';
break;
case '건의사항 글 쓰기':
addr = 'suggestion';
break;
%>
<%
}
%>
<form action="/board/write/<%=addr%>" method="post">
<table border="1">
<tr>
......